>From b12f3e74b1945659a0fe2198c75453beab2ced7d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 15 Dec 2014 14:33:09 +0100 Subject: [PATCH] Use /opt/lmi/gui_test as default path for for the test files. Only use the current directory if that directory doesn't exist, after warning the user about it. --- main_wx_test.cpp | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-) diff --git a/main_wx_test.cpp b/main_wx_test.cpp index 5acb363..710a4e7 100644 --- a/main_wx_test.cpp +++ b/main_wx_test.cpp @@ -422,17 +422,19 @@ bool application_test::process_command_line(int& argc, char* argv[]) // Ensure that the path used for the test files is always valid and // absolute, so that it doesn't change even if the program current // directory changes for whatever reason. - if(test_files_path_.empty() || !fs::exists(test_files_path_)) + if(test_files_path_.empty()) { - if(!test_files_path_.empty()) - { - warning() - << "Test files path '" - << test_files_path_.native_file_string() - << "' doesn't exist." - << std::flush - ; - } + test_files_path_ = "/opt/lmi/gui_test"; + } + + if (!fs::exists(test_files_path_)) + { + warning() + << "Test files path '" + << test_files_path_.native_file_string() + << "' doesn't exist." + << std::flush + ; test_files_path_ = fs::current_path(); } else -- 1.7.9