From bbe436a27cf53bc2fba08668235f5a73317fe643 Mon Sep 17 00:00:00 2001 From: Piers Daniell Date: Mon, 21 Oct 2019 16:47:25 -0600 Subject: [PATCH] Generate a non-zero exit code on test failure If there are any failed tests, or the test run was not compelte, the process will now generate EXIT_FAILURE (1) instead of EXIT_SUCCESS (0). Affects: cts-runner Components: Framework VK-GL-CTS issue: 1982 Change-Id: I50fb7d51c095a09f53476b5ba56b72835337f339 --- external/openglcts/modules/runner/glcTestRunner.hpp | 1 + external/openglcts/modules/runner/glcTestRunnerMain.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/external/openglcts/modules/runner/glcTestRunner.hpp b/external/openglcts/modules/runner/glcTestRunner.hpp index 4ae9a61..962d334 100644 --- a/external/openglcts/modules/runner/glcTestRunner.hpp +++ b/external/openglcts/modules/runner/glcTestRunner.hpp @@ -102,6 +102,7 @@ public: ~TestRunner(void); bool iterate(void); + bool isConformant() const { return m_summary.isConformant; } private: TestRunner(const TestRunner& other); diff --git a/external/openglcts/modules/runner/glcTestRunnerMain.cpp b/external/openglcts/modules/runner/glcTestRunnerMain.cpp index 8a75b23..44c5c85 100644 --- a/external/openglcts/modules/runner/glcTestRunnerMain.cpp +++ b/external/openglcts/modules/runner/glcTestRunnerMain.cpp @@ -112,6 +112,7 @@ static void printHelp(const char* binName) int main(int argc, char** argv) { CommandLine cmdLine; + int exitStatus = EXIT_SUCCESS; if (!parseCommandLine(cmdLine, argc, argv)) { @@ -129,7 +130,14 @@ int main(int argc, char** argv) for (;;) { if (!runner.iterate()) + { + if (!runner.isConformant()) + { + exitStatus = EXIT_FAILURE; + } + break; + } } } catch (const std::exception& e) @@ -138,5 +146,5 @@ int main(int argc, char** argv) return -1; } - return 0; + return exitStatus; } -- 2.7.4