/** Run the tests. * @note This is only here temporarily. * @note Command line arguments currently are ignored. * In future versions, this part will be auto-generated. * @return Exit status. * @retval 0 if all tests ran successfully. * @retval 1 if there were test errors or failures. */ int main(void) { int retVal = 0; runFixture(&GroupTestFixture, 0); runFixture(&GroupTestFixture, 1); runFixture(&GroupTestFixture, 2); return retVal; }
/** Run the tests. * @note This is only here temporarily. * @note Command line arguments currently are ignored. * In future versions, this part will be auto-generated. * @return Exit status. * @retval 0 if all tests ran successfully. * @retval 1 if there were test errors or failures. */ int main(void) { int retVal = 0; runFixture(&AceUnitTestFixture); if (runnerData->testCaseFailureCount != TEST_FAILURES_FOR_VERIFICATION) { fprintf(stderr, "Test Cases: %d Errors: %d\n", runnerData->testCaseCount, runnerData->testCaseFailureCount); retVal = 1; } if (runnerData->testCaseCount != TEST_CASES_FOR_VERIFICATION) { fprintf(stderr, "Test Cases: %d but expected %d\n", runnerData->testCaseCount, TEST_CASES_FOR_VERIFICATION); retVal = 1; } return retVal; }
int run_test(const char* name) { int ret = 0; // Run all tests for NULL parameter if(name == NULL) { // We suppose that there is only one suite runSuite(&suite1); // Verify all test were executed if(runnerData->testCaseCount != TEST_CASES_FOR_VERIFICATION) { printf("Test Cases: %d but expected %d\n", (int) runnerData->testCaseCount, TEST_CASES_FOR_VERIFICATION); ret = -1; } } else { bool found = false; const TestSuite_t *const *suites = suite1.suites; if (suites != NULL) { for(; NULL != *suites; suites++) { // Find specific test function name from test fixtures TestFixture_t* fixture = (TestFixture_t*)*suites; if(!strncmp(fixture->name, name, strlen(name))) { runFixture(fixture, NULL); found = true; break; } } } if(!found) { printf("Cannot find requested test : [%s]\n", name); return -2; } } if(runnerData->testCaseFailureCount != 0) ret = -3; printf("Test Cases: %d Success: %d Errors: %d\n", (int)runnerData->testCaseCount, (int)runnerData->testCaseCount - runnerData->testCaseFailureCount, (int)runnerData->testCaseFailureCount); runnerData->testCaseCount = 0; runnerData->testCaseFailureCount = 0; return ret; }