5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
28 EXIT_STATUS_TESTCASE_SUCCEEDED, // 0
29 EXIT_STATUS_TESTCASE_FAILED, // 1
30 EXIT_STATUS_TESTCASE_ABORTED, // 2
31 EXIT_STATUS_FORK_FAILED, // 3
32 EXIT_STATUS_WAITPID_FAILED, // 4
33 EXIT_STATUS_BAD_ARGUMENT, // 5
34 EXIT_STATUS_TESTCASE_NOT_FOUND // 6
37 const int MAX_NUM_CHILDREN(16);
42 const char* testCaseName;
50 TestCase(int tc, const char* name)
55 TestCase(const TestCase& rhs)
56 : testCase(rhs.testCase),
57 testCaseName(rhs.testCaseName)
60 TestCase& operator=(const TestCase& rhs)
62 testCase = rhs.testCase;
63 testCaseName = rhs.testCaseName;
71 * @param[in] testCase The Testkit-lite test case to run
73 int RunTestCase( struct testcase_s& testCase );
76 * Run all test cases in parallel
77 * @param[in] processName The name of this process
78 * @param[in] tc_array The array of auto-generated testkit-lite test cases
79 * @param[in] reRunFailed True if failed test cases should be re-run
80 * @return 0 on success
82 int RunAllInParallel(const char* processName, testcase tc_array[], bool reRunFailed);
85 * Run all test cases in serial
86 * @param[in] processName The name of this process
87 * @param[in] tc_array The array of auto-generated testkit-lite test cases
88 * @return 0 on success
90 int RunAll( const char* processName, testcase tc_array[] );
93 * Find the named test case in the given array, and run it
94 * @param[in] tc_array The array of auto-generated testkit-lite test cases
95 * @param[in] testCaseName the name of the test case to run
96 * @return 0 on success
98 int FindAndRunTestCase(::testcase tc_array[], const char* testCaseName);
101 * Display usage instructions for this program
102 * @param[in] program The name of this program
104 void Usage(const char* program);
106 } // namespace TestHarness