Lines Matching refs:test_id
167 std::string GetTestName(size_t test_id) const { in GetTestName()
168 VerifyTestId(test_id); in GetTestName()
169 return name_ + "." + test_list_[test_id].GetName(); in GetTestName()
172 Test& GetTest(size_t test_id) { in GetTest() argument
173 VerifyTestId(test_id); in GetTest()
174 return test_list_[test_id]; in GetTest()
177 const Test& GetTest(size_t test_id) const { in GetTest()
178 VerifyTestId(test_id); in GetTest()
179 return test_list_[test_id]; in GetTest()
182 void SetTestResult(size_t test_id, TestResult result) { in SetTestResult() argument
183 VerifyTestId(test_id); in SetTestResult()
184 test_list_[test_id].SetResult(result); in SetTestResult()
187 TestResult GetTestResult(size_t test_id) const { in GetTestResult()
188 VerifyTestId(test_id); in GetTestResult()
189 return test_list_[test_id].GetResult(); in GetTestResult()
192 void SetTestTime(size_t test_id, int64_t elapsed_time_ns) { in SetTestTime() argument
193 VerifyTestId(test_id); in SetTestTime()
194 test_list_[test_id].SetTestTime(elapsed_time_ns); in SetTestTime()
197 int64_t GetTestTime(size_t test_id) const { in GetTestTime()
198 VerifyTestId(test_id); in GetTestTime()
199 return test_list_[test_id].GetTestTime(); in GetTestTime()
203 void VerifyTestId(size_t test_id) const { in VerifyTestId()
204 if(test_id >= test_list_.size()) { in VerifyTestId()
205 fprintf(stderr, "test_id %zu out of range [0, %zu)\n", test_id, test_list_.size()); in VerifyTestId()
315 static void OnTestEndPrint(const TestCase& testcase, size_t test_id) { in OnTestEndPrint() argument
317 printf("%s\n", testcase.GetTestName(test_id).c_str()); in OnTestEndPrint()
319 const std::string& test_output = testcase.GetTest(test_id).GetTestOutput(); in OnTestEndPrint()
322 TestResult result = testcase.GetTestResult(test_id); in OnTestEndPrint()
328 printf("%s", testcase.GetTestName(test_id).c_str()); in OnTestEndPrint()
330 printf(" (%" PRId64 " ms)", testcase.GetTestTime(test_id) / 1000000); in OnTestEndPrint()
338 static void OnTestEndPrint(const TestCase& testcase, size_t test_id) { in OnTestEndPrint() argument
339 TestResult result = testcase.GetTestResult(test_id); in OnTestEndPrint()
348 printf("%s", testcase.GetTestName(test_id).c_str()); in OnTestEndPrint()
350 printf(" (%" PRId64 " ms)", testcase.GetTestTime(test_id) / 1000000); in OnTestEndPrint()
354 const std::string& test_output = testcase.GetTest(test_id).GetTestOutput(); in OnTestEndPrint()
591 size_t testcase_id, test_id; member
615 static ChildProcInfo RunChildProcess(const std::string& test_name, int testcase_id, int test_id, in RunChildProcess() argument
652 child_proc.test_id = test_id; in RunChildProcess()
665 … std::string test_name = testcase_list[child_proc.testcase_id].GetTestName(child_proc.test_id); in HandleSignals()
717 int test_id = child_proc.test_id; in ReadChildProcOutput() local
723 testcase.GetTest(test_id).AppendTestOutput(buf); in ReadChildProcOutput()
788 int test_id = child_proc.test_id; in CollectChildTestResult() local
789 testcase.SetTestTime(test_id, child_proc.end_time_ns - child_proc.start_time_ns); in CollectChildTestResult()
798 testcase.SetTestResult(test_id, TEST_TIMEOUT); in CollectChildTestResult()
801 testcase.GetTestName(test_id).c_str(), testcase.GetTestTime(test_id) / 1000000); in CollectChildTestResult()
802 testcase.GetTest(test_id).AppendTestOutput(buf); in CollectChildTestResult()
806 testcase.SetTestResult(test_id, TEST_FAILED); in CollectChildTestResult()
809 testcase.GetTestName(test_id).c_str(), strsignal(WTERMSIG(child_proc.exit_status))); in CollectChildTestResult()
810 testcase.GetTest(test_id).AppendTestOutput(buf); in CollectChildTestResult()
814 testcase.SetTestResult(test_id, exitcode == 0 ? TEST_SUCCESS : TEST_FAILED); in CollectChildTestResult()
818 testcase.GetTestName(test_id).c_str(), exitcode); in CollectChildTestResult()
819 testcase.GetTest(test_id).AppendTestOutput(buf); in CollectChildTestResult()
881 size_t test_id = child_proc.test_id; in RunTestInSeparateProc() local
885 OnTestEndPrint(testcase, test_id); in RunTestInSeparateProc()
890 if (testcase.GetTestResult(test_id) != TEST_SUCCESS) { in RunTestInSeparateProc()