Lines Matching refs:test
174 int Isolate::ChildProcessFn(const std::tuple<std::string, std::string>& test) { in ChildProcessFn() argument
180 std::string filter("--gtest_filter=" + GetTestName(test)); in ChildProcessFn()
220 Test* test = new Test(tests_[cur_test_index_], cur_test_index_, run_index, read_fd.release()); in LaunchTests() local
221 running_by_pid_.emplace(pid, test); in LaunchTests()
222 running_[run_index] = test; in LaunchTests()
223 running_by_test_index_[cur_test_index_] = test; in LaunchTests()
226 pollfd->fd = test->fd(); in LaunchTests()
241 Test* test = running_[i]; in ReadTestsOutput() local
242 if (!test->Read()) { in ReadTestsOutput()
243 test->CloseFd(); in ReadTestsOutput()
263 Test* test = test_ptr.get(); in CheckTestsFinished() local
264 test->Stop(); in CheckTestsFinished()
267 test->ReadUntilClosed(); in CheckTestsFinished()
268 if (test->result() == TEST_NONE) { in CheckTestsFinished()
270 std::string output(test->name() + " terminated by signal: " + strsignal(WTERMSIG(status)) + in CheckTestsFinished()
272 test->AppendOutput(output); in CheckTestsFinished()
273 test->set_result(TEST_FAIL); in CheckTestsFinished()
277 std::string output(test->name() + " exited with exitcode " + std::to_string(exit_code) + in CheckTestsFinished()
279 test->AppendOutput(output); in CheckTestsFinished()
280 test->set_result(TEST_FAIL); in CheckTestsFinished()
284 test->SetResultFromOutput(); in CheckTestsFinished()
287 } else if (test->result() == TEST_TIMEOUT) { in CheckTestsFinished()
289 std::string timeout_str(test->name() + " killed because of timeout at " + in CheckTestsFinished()
291 test->AppendOutput(timeout_str); in CheckTestsFinished()
294 if (test->ExpectFail()) { in CheckTestsFinished()
295 if (test->result() == TEST_FAIL) { in CheckTestsFinished()
297 test->set_result(TEST_XFAIL); in CheckTestsFinished()
298 } else if (test->result() == TEST_PASS) { in CheckTestsFinished()
300 test->set_result(TEST_XPASS); in CheckTestsFinished()
304 test->Print(options_.gtest_format()); in CheckTestsFinished()
306 switch (test->result()) { in CheckTestsFinished()
309 if (test->slow()) { in CheckTestsFinished()
332 size_t test_index = test->test_index(); in CheckTestsFinished()
334 running_indices_.push_back(test->run_index()); in CheckTestsFinished()
337 size_t run_index = test->run_index(); in CheckTestsFinished()
358 Test* test = entry.second.get(); in CheckTestsTimeout() local
359 if (test->result() == TEST_TIMEOUT) { in CheckTestsTimeout()
363 if (NanoTime() > test->start_ns() + deadline_threshold_ns_) { in CheckTestsTimeout()
364 test->set_result(TEST_TIMEOUT); in CheckTestsTimeout()
366 test->set_slow(false); in CheckTestsTimeout()
369 } else if (!test->slow() && NanoTime() > test->start_ns() + slow_threshold_ns_) { in CheckTestsTimeout()
371 test->set_slow(true); in CheckTestsTimeout()
387 const Test* test = entry.second; in HandleSignals() local
388 uint64_t run_time_ms = (NanoTime() - test->start_ns()) / kNsPerMs; in HandleSignals()
389 printf(" %s (elapsed time %" PRId64 " ms)\n", test->name().c_str(), run_time_ms); in HandleSignals()
442 const Test* test = entry.second.get(); in PrintResults() local
443 if (results.match_func(*test)) { in PrintResults()
445 printf(" %s", test->name().c_str()); in PrintResults()
447 results.print_func(options_, *test); in PrintResults()
469 .match_func = [](const Test& test) { return test.slow(); }, in __anon7262e4f70102()
471 [](const Options& options, const Test& test) { in __anon7262e4f70202()
472 printf(" (%" PRIu64 " ms, exceeded %" PRIu64 " ms)", test.RunTimeNs() / kNsPerMs, in __anon7262e4f70202()
482 .match_func = [](const Test& test) { return test.result() == TEST_XPASS; }, in __anon7262e4f70302()
491 .match_func = [](const Test& test) { return test.result() == TEST_FAIL; }, in __anon7262e4f70402()
500 .match_func = [](const Test& test) { return test.result() == TEST_TIMEOUT; }, in __anon7262e4f70502()
502 [](const Options&, const Test& test) { in __anon7262e4f70602()
503 printf(" (stopped at %" PRIu64 " ms)", test.RunTimeNs() / kNsPerMs); in __anon7262e4f70602()
512 .match_func = [](const Test& test) { return test.result() == TEST_SKIPPED; }, in __anon7262e4f70702()
663 const Test* test = entry.second.get(); in WriteXmlResults() local
664 const std::string& suite_name = test->suite_name(); in WriteXmlResults()
665 if (test->result() == TEST_XFAIL) { in WriteXmlResults()
675 info->tests.push_back(test); in WriteXmlResults()
676 info->elapsed_ms += double(test->RunTimeNs()) / kNsPerMs; in WriteXmlResults()
677 if (test->result() != TEST_PASS) { in WriteXmlResults()
688 for (auto test : suite_entry.tests) { in WriteXmlResults() local
690 test->test_name().c_str(), double(test->RunTimeNs()) / kNsPerMs, in WriteXmlResults()
692 if (test->result() == TEST_PASS) { in WriteXmlResults()
696 const std::string escaped_output = XmlEscape(test->output()); in WriteXmlResults()