Lines Matching refs:testCase
65 struct TestCase *testCase[TEST_DEFAULT_CASE_MAX];
122 static void RunCase(const char *testCase, char *param[])
135 cout << testCase << ":" << endl;
138 cout << "execl: " << testCase << " failed, " << strerror(errno) << endl;
158 size = strlen(testCase) + 1;
165 if (memcpy_s(g_testsuitesFailedCase[g_testsuitesFailedCount], size, testCase, size) != EOK) {
271 g_param.testCase[g_param.testCaseNum] = (struct TestCase *)malloc(sizeof(struct TestCase));
272 if (g_param.testCase[g_param.testCaseNum] == nullptr) {
276 (void)memset_s(g_param.testCase[g_param.testCaseNum], sizeof(struct TestCase), 0, sizeof(struct TestCase));
277 struct TestCase *testCase = g_param.testCase[g_param.testCaseNum];
278 testCase->caseLen = strlen(argv[*index]);
279 if (memcpy_s(testCase->bin, TEST_PATH_MAX, argv[*index], testCase->caseLen + 1) != EOK) {
280 testCase->caseLen = 0;
284 testCase->param[0] = testCase->bin;
287 testCase->param[j] = (char *)argv[*index];
347 static void IsCase(vector<string> files, struct TestCase *testCase)
352 if (fileLen <= testCase->caseLen) {
356 const string &suffix = file.c_str() + (fileLen - testCase->caseLen);
357 if (strcmp(suffix.c_str(), testCase->bin) != 0) {
361 if (memcpy_s(testCase->bin, TEST_PATH_MAX, file.c_str(), fileLen + 1) != EOK) {
362 testCase->caseLen = 0;
365 testCase->caseLen = fileLen;
369 cout << "liteos_unittest_run.bin: not find test case: " << testCase->bin << endl;
379 IsCase(files, g_param.testCase[i]);
392 free(g_param.testCase[index]);
393 g_param.testCase[index] = nullptr;
459 RunCase(g_param.testCase[index]->bin, g_param.testCase[index]->param);