diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 375302e27..66511d52a 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -2,7 +2,7 @@ name: Coverage on: push: - branches: ['master'] + branches: ["master"] pull_request: jobs: @@ -16,9 +16,9 @@ jobs: toolchain: stable override: true - uses: actions-rs/tarpaulin@v0.1 - - uses: codecov/codecov-action@v1.0.2 - with: - token: ${{secrets.CODECOV_TOKEN}} + - uses: codecov/codecov-action@v2.1.0 + # A codecov token is not needed for public repos if the repo is linked + # on codecov.io. See https://docs.codecov.com/docs/frequently-asked-questions#where-is-the-repository-upload-token-found - uses: actions/upload-artifact@v1 with: name: code-coverage-report diff --git a/data-url/Cargo.toml b/data-url/Cargo.toml index aa0acee3a..78145c4a7 100644 --- a/data-url/Cargo.toml +++ b/data-url/Cargo.toml @@ -13,7 +13,7 @@ rust-version = "1.45" matches = "0.1" [dev-dependencies] -rustc-test = "0.3" +tester = "0.9" serde = {version = "1.0", features = ["derive"]} serde_json = "1.0" diff --git a/data-url/tests/wpt.rs b/data-url/tests/wpt.rs index 9c9a2990d..c2e52e0bb 100644 --- a/data-url/tests/wpt.rs +++ b/data-url/tests/wpt.rs @@ -1,3 +1,5 @@ +use tester as test; + #[macro_use] extern crate serde; @@ -32,7 +34,7 @@ fn run_data_url( fn collect_data_url(add_test: &mut F) where - F: FnMut(String, bool, rustc_test::TestFn), + F: FnMut(String, bool, test::TestFn), { let known_failures = ["data://test:test/,X"]; @@ -53,9 +55,9 @@ where add_test( format!("data: URL {:?}", input), should_panic, - rustc_test::TestFn::dyn_test_fn(move || { + test::TestFn::DynTestFn(Box::new(move || { run_data_url(input, expected_mime, expected_body, should_panic) - }), + })), ); } } @@ -72,7 +74,7 @@ fn run_base64(input: String, expected: Option>) { fn collect_base64(add_test: &mut F) where - F: FnMut(String, bool, rustc_test::TestFn), + F: FnMut(String, bool, test::TestFn), { let known_failures = []; @@ -83,7 +85,7 @@ where add_test( format!("base64 {:?}", input), should_panic, - rustc_test::TestFn::dyn_test_fn(move || run_base64(input, expected)), + test::TestFn::DynTestFn(Box::new(move || run_base64(input, expected))), ); } } @@ -100,7 +102,7 @@ fn run_mime(input: String, expected: Option) { fn collect_mime(add_test: &mut F) where - F: FnMut(String, bool, rustc_test::TestFn), + F: FnMut(String, bool, test::TestFn), { let known_failures = []; @@ -136,7 +138,7 @@ where format!("MIME type {:?}", input) }, should_panic, - rustc_test::TestFn::dyn_test_fn(move || run_mime(input, expected)), + test::TestFn::DynTestFn(Box::new(move || run_mime(input, expected))), ); } } @@ -144,16 +146,22 @@ where fn main() { let mut tests = Vec::new(); { - let mut add_one = |name: String, should_panic: bool, run: rustc_test::TestFn| { - let mut desc = rustc_test::TestDesc::new(rustc_test::DynTestName(name)); - if should_panic { - desc.should_panic = rustc_test::ShouldPanic::Yes - } - tests.push(rustc_test::TestDescAndFn { desc, testfn: run }) + let mut add_one = |name: String, should_panic: bool, run: test::TestFn| { + let desc = test::TestDesc { + name: test::DynTestName(name), + ignore: false, + should_panic: match should_panic { + true => test::ShouldPanic::Yes, + false => test::ShouldPanic::No, + }, + allow_fail: false, + test_type: test::TestType::Unknown, + }; + tests.push(test::TestDescAndFn { desc, testfn: run }) }; collect_data_url(&mut add_one); collect_base64(&mut add_one); collect_mime(&mut add_one); } - rustc_test::test_main(&std::env::args().collect::>(), tests) + test::test_main(&std::env::args().collect::>(), tests, None) } diff --git a/idna/Cargo.toml b/idna/Cargo.toml index 9389c1b32..31b08302e 100644 --- a/idna/Cargo.toml +++ b/idna/Cargo.toml @@ -22,7 +22,7 @@ name = "unit" [dev-dependencies] assert_matches = "1.3" bencher = "0.1" -rustc-test = "0.3" +tester = "0.9" serde_json = "1.0" [dependencies] diff --git a/idna/tests/punycode.rs b/idna/tests/punycode.rs index c0123c639..1a51cbc92 100644 --- a/idna/tests/punycode.rs +++ b/idna/tests/punycode.rs @@ -63,9 +63,9 @@ pub fn collect_tests(add_test: &mut F) { }; add_test( test_name, - TestFn::dyn_test_fn(move || { + TestFn::DynTestFn(Box::new(move || { one_test(get_string(&o, "decoded"), get_string(&o, "encoded")) - }), + })), ) } _ => panic!(), diff --git a/idna/tests/tests.rs b/idna/tests/tests.rs index 5f0f8cde3..0704c81c1 100644 --- a/idna/tests/tests.rs +++ b/idna/tests/tests.rs @@ -1,4 +1,4 @@ -use rustc_test as test; +use tester as test; mod punycode; mod uts46; @@ -8,12 +8,18 @@ fn main() { { let mut add_test = |name, run| { tests.push(test::TestDescAndFn { - desc: test::TestDesc::new(test::DynTestName(name)), + desc: test::TestDesc { + name: test::DynTestName(name), + ignore: false, + should_panic: test::ShouldPanic::No, + allow_fail: false, + test_type: test::TestType::Unknown, + }, testfn: run, }) }; punycode::collect_tests(&mut add_test); uts46::collect_tests(&mut add_test); } - test::test_main(&std::env::args().collect::>(), tests) + test::test_main(&std::env::args().collect::>(), tests, None) } diff --git a/idna/tests/uts46.rs b/idna/tests/uts46.rs index c95766d60..03ba82192 100644 --- a/idna/tests/uts46.rs +++ b/idna/tests/uts46.rs @@ -65,7 +65,7 @@ pub fn collect_tests(add_test: &mut F) { let test_name = format!("UTS #46 line {}", i + 1); add_test( test_name, - TestFn::dyn_test_fn(move || { + TestFn::DynTestFn(Box::new(move || { let config = idna::Config::default() .use_std3_ascii_rules(true) .verify_dns_length(true) @@ -109,7 +109,7 @@ pub fn collect_tests(add_test: &mut F) { to_ascii_t_result, |e| e.starts_with('C') || e == "V2", ); - }), + })), ) } }