From cfa72a70ef8371eab29da003dbb4d932adba189a Mon Sep 17 00:00:00 2001 From: Piers Daniell Date: Fri, 6 Sep 2019 12:27:31 -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: dEQP-VK.* Components: Framework VK-GL-CTS issue: 1982 Change-Id: I061d9a3b6703e1f23c48ce8a31e943744f915c92 --- framework/platform/tcuMain.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/framework/platform/tcuMain.cpp b/framework/platform/tcuMain.cpp index 1641a1c..f3e0fb4 100644 --- a/framework/platform/tcuMain.cpp +++ b/framework/platform/tcuMain.cpp @@ -27,6 +27,7 @@ #include "tcuApp.hpp" #include "tcuResource.hpp" #include "tcuTestLog.hpp" +#include "tcuTestSessionExecutor.hpp" #include "deUniquePtr.hpp" #include @@ -36,6 +37,8 @@ tcu::Platform* createPlatform (void); int main (int argc, char** argv) { + int exitStatus = EXIT_SUCCESS; + #if (DE_OS != DE_OS_WIN32) // Set stdout to line-buffered mode (will be fully buffered by default if stdout is pipe). setvbuf(stdout, DE_NULL, _IOLBF, 4*1024); @@ -53,7 +56,15 @@ int main (int argc, char** argv) for (;;) { if (!app->iterate()) + { + if (cmdLine.getRunMode() == tcu::RUNMODE_EXECUTE && + (!app->getResult().isComplete || app->getResult().numFailed)) + { + exitStatus = EXIT_FAILURE; + } + break; + } } } catch (const std::exception& e) @@ -61,5 +72,5 @@ int main (int argc, char** argv) tcu::die("%s", e.what()); } - return 0; + return exitStatus; } -- 2.7.4