diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2017-08-23 15:56:16 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2017-08-23 15:10:23 +0000 |
commit | 9ace166de7d54c5ba6b189dae78ea9602fe8b1a2 (patch) | |
tree | 38dd55e0072a26e54609a8c9f10a0a7aa4561e29 /tests/auto/blackbox/testdata/localDeployment | |
parent | 957b22f7337e7598e781a1af0e5cde04632943c9 (diff) |
Fix localDeployment autotest on Windows
Change-Id: I310f48021d7a1b60c51ac2d4732d42a7886f324d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/blackbox/testdata/localDeployment')
-rw-r--r-- | tests/auto/blackbox/testdata/localDeployment/main.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/auto/blackbox/testdata/localDeployment/main.cpp b/tests/auto/blackbox/testdata/localDeployment/main.cpp index f07f8e4e3..c991b6d27 100644 --- a/tests/auto/blackbox/testdata/localDeployment/main.cpp +++ b/tests/auto/blackbox/testdata/localDeployment/main.cpp @@ -36,7 +36,17 @@ int main(int argc, char *argv[]) return 1; std::string s = argv[0]; - std::ifstream in(std::string(s.substr(0, s.find_last_of("/")) + "/../share/main.cpp").c_str()); + for (auto &c : s) { + if (c == '\\') + c = '/'; + } + const std::string mainFilePath = + std::string(s.substr(0, s.find_last_of("/")) + "/../share/main.cpp"); + std::ifstream in(mainFilePath.c_str()); + if (!in.is_open()) { + std::cerr << "Failed to open file: " << mainFilePath; + return 1; + } std::string str((std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>()); std::cout << str << std::endl; |