X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftest-harness.h;h=b2109184d66e6e4e87fcd4cd4e5685477a12f2a3;hp=e6dc5178de3310ab99750d8d93672f6131c0550c;hb=620fa335f1282a61369a4109345d26707c481037;hpb=e1d022ecfbbb669aaea81033cbef346f040062c6 diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-harness.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-harness.h index e6dc517..b210918 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-harness.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-harness.h @@ -2,7 +2,7 @@ #define TEST_HARNESS_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,49 +20,55 @@ #include #include +#include +#include + namespace TestHarness { - enum ExitStatus { - EXIT_STATUS_TESTCASE_SUCCEEDED, // 0 - EXIT_STATUS_TESTCASE_FAILED, // 1 - EXIT_STATUS_TESTCASE_ABORTED, // 2 - EXIT_STATUS_FORK_FAILED, // 3 - EXIT_STATUS_WAITPID_FAILED, // 4 - EXIT_STATUS_BAD_ARGUMENT, // 5 - EXIT_STATUS_TESTCASE_NOT_FOUND // 6 + EXIT_STATUS_TESTCASE_SUCCEEDED, // 0 + EXIT_STATUS_TESTCASE_FAILED, // 1 + EXIT_STATUS_TESTCASE_ABORTED, // 2 + EXIT_STATUS_FORK_FAILED, // 3 + EXIT_STATUS_WAITPID_FAILED, // 4 + EXIT_STATUS_BAD_ARGUMENT, // 5 + EXIT_STATUS_TESTCASE_NOT_FOUND // 6 }; -const int MAX_NUM_CHILDREN(16); +const int32_t MAX_NUM_CHILDREN(16); struct TestCase { - int testCase; - const char* testCaseName; + int32_t testCase; + const char* testCaseName; + std::chrono::steady_clock::time_point startTime; TestCase() : testCase(0), - testCaseName(NULL) + testCaseName(NULL), + startTime() { } - TestCase(int tc, const char* name) + TestCase(int32_t tc, const char* name) : testCase(tc), - testCaseName(name) + testCaseName(name), + startTime() { } TestCase(const TestCase& rhs) : testCase(rhs.testCase), - testCaseName(rhs.testCaseName) + testCaseName(rhs.testCaseName), + startTime(rhs.startTime) { } TestCase& operator=(const TestCase& rhs) { - testCase = rhs.testCase; + testCase = rhs.testCase; testCaseName = rhs.testCaseName; + startTime = rhs.startTime; return *this; - } }; @@ -70,7 +76,7 @@ struct TestCase * Run a test case * @param[in] testCase The Testkit-lite test case to run */ -int RunTestCase( struct testcase_s& testCase ); +int32_t RunTestCase(struct testcase_s& testCase); /** * Run all test cases in parallel @@ -79,16 +85,15 @@ int RunTestCase( struct testcase_s& testCase ); * @param[in] reRunFailed True if failed test cases should be re-run * @return 0 on success */ -int RunAllInParallel(const char* processName, testcase tc_array[], bool reRunFailed); +int32_t RunAllInParallel(const char* processName, testcase tc_array[], bool reRunFailed); /** * Run all test cases in serial * @param[in] processName The name of this process * @param[in] tc_array The array of auto-generated testkit-lite test cases - * @param[in] reRunFailed True if failed test cases should be re-run * @return 0 on success */ -int RunAll(const char* processName, testcase tc_array[], bool reRunFailed); +int32_t RunAll(const char* processName, testcase tc_array[]); /** * Find the named test case in the given array, and run it @@ -96,7 +101,7 @@ int RunAll(const char* processName, testcase tc_array[], bool reRunFailed); * @param[in] testCaseName the name of the test case to run * @return 0 on success */ -int FindAndRunTestCase(::testcase tc_array[], const char* testCaseName); +int32_t FindAndRunTestCase(::testcase tc_array[], const char* testCaseName); /** * Display usage instructions for this program