1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:47:46 +00:00

LibTest: Add support for xfail JavaScriptTestRunner tests

This is meant to be used in a similar manner to skipping tests, with the
extra advantage that if the test begins passing unexpectedly, the test
will fail.

Being notified of unexpected passes allows for the test to be updated to
the correct expectation.
This commit is contained in:
Shannon Booth 2023-07-22 19:39:31 +12:00 committed by Andreas Kling
parent 2c06ad3a05
commit af60c740e3
4 changed files with 32 additions and 4 deletions

View file

@ -120,8 +120,11 @@ void TestRunner::do_run_single_test(DeprecatedString const& test_path, size_t cu
case Test::Result::Pass:
++m_counts.tests_passed;
break;
case Test::Result::ExpectedFail:
++m_counts.tests_passed;
break;
case Test::Result::Skip:
++m_counts.tests_skipped;
++m_counts.tests_expected_failed;
break;
case Test::Result::Fail:
++m_counts.tests_failed;
@ -196,7 +199,8 @@ void TestRunner::do_run_single_test(DeprecatedString const& test_path, size_t cu
outln("{} ({})", test_result.file_path.basename(), test_result.result == Test::Result::Fail ? "failed" : "crashed");
} else {
print_modifiers({ Test::CLEAR, Test::FG_ORANGE });
outln("{} (skipped)", test_result.file_path.basename());
auto const status = test_result.result == Test::Result::Skip ? "skipped"sv : "expected fail"sv;
outln("{} ({})", test_result.file_path.basename(), status);
}
print_modifiers({ Test::CLEAR });
}