Generate a non-zero exit code on test failure
authorPiers Daniell <pdaniell@nvidia.com>
Mon, 21 Oct 2019 22:47:25 +0000 (16:47 -0600)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 5 Dec 2019 10:05:42 +0000 (05:05 -0500)
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
external/openglcts/modules/runner/glcTestRunnerMain.cpp

index 4ae9a61..962d334 100644 (file)
@@ -102,6 +102,7 @@ public:
        ~TestRunner(void);
 
        bool iterate(void);
+       bool isConformant() const { return m_summary.isConformant; }
 
 private:
        TestRunner(const TestRunner& other);
index 8a75b23..44c5c85 100644 (file)
@@ -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;
 }