Tests: an Annex B folder whose tests are all skipped fails

annex_b_runs counted skipped tests toward its check that a folder has
tests to run, so a folder where every test needs a missing built-in or
is asynchronous passed without running anything. It now requires at
least one test to run, as the ES5 groups do.
This commit is contained in:
dotCooCoo committed 2026-11-21 05:17:25 -08:00
1 parent 3f243e90f8
commit bd752e95ad
1 file changed
+14 -1
+14 -1
View File
@@ -666,7 +666,7 @@ fn run_annex_b(dir: &Path) {
let mut counts = RunCounts::default();
counts.add(es5);
counts.add(later);
assert!(counts.tests + counts.skipped > 0, "no Annex B tests to run under {}", root.display());
assert!(counts.tests > 0, "no Annex B tests ran under {}", root.display());
panicked += counts.panicked;
println!("test262 {folder} through the interpreter: {}.", counts.summary());
if *folder == ANNEX_B_LANGUAGE {
@@ -864,6 +864,19 @@ fn an_unreadable_annex_b_folder_fails_and_only_an_absent_one_skips() {
std::fs::remove_dir_all(&dir).unwrap();
}
#[test]
fn an_annex_b_folder_whose_tests_are_all_skipped_fails() {
let dir = scratch("all-skipped");
std::fs::create_dir_all(dir.join("harness")).unwrap();
std::fs::create_dir_all(dir.join("test/annexB/language")).unwrap();
std::fs::write(dir.join("harness/assert.js"), "").unwrap();
std::fs::write(dir.join("harness/sta.js"), "").unwrap();
std::fs::write(dir.join("test/annexB/language/a.js"), "/*---\nesid: sec-x\nflags: [async]\n---*/\n").unwrap();
let outcome = std::panic::catch_unwind(|| run_annex_b(&dir));
std::fs::remove_dir_all(&dir).unwrap();
assert!(outcome.is_err(), "a folder where every test is skipped passes");
}
#[test]
fn a_file_over_the_limit_is_refused_before_it_is_read() {
let dir = scratch("size");