From 52a76a7bd29a3218904fbd3f5d2cc815a4a1b6bb Mon Sep 17 00:00:00 2001 From: Martchus Date: Sun, 12 Mar 2017 20:25:06 +0100 Subject: [PATCH] Show warning when a testfile could not be located TODO: Would throwing an exception instead break something? --- tests/testutils.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/testutils.cpp b/tests/testutils.cpp index 1cb429c..5712a16 100644 --- a/tests/testutils.cpp +++ b/tests/testutils.cpp @@ -157,7 +157,13 @@ string TestApplication::testFilePath(const string &name) const } // file still not found -> return default path - return "./testfiles/" + name; + path = "./testfiles/" + name; + file.clear(); + file.open(path = m_testFilesPathEnvValue + name, ios_base::in); + if(!file.good()) { + cerr << "Warning: The testfile \"" << path << "\" can not be located." << endl; + } + return path; } #ifdef PLATFORM_UNIX