-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* xml5ever: remove unused rust-test dev-dependency This isn't actually used by any code in the crate. * rcdom: port tests/xml-tree-builder to a custom runner This doesn't distribute the individual tests across the build-in harness, hurting parallelism and process isolation. On the other hand it's a minimal change to port off the rustc-test dependency which hasn't been actively maintained and currently doesn't compile. * rcdom: Port remaining tests to a custom runner Move the custom test runner into its own `util::runner` module and use it instead of rustc_test for the other test files. This allows `cargo test` to complete under rust 1.77.1. * github actions: Remove rustc-test/capture feature check This is no longer available since the depdendency has been removed.
- Loading branch information
Showing
8 changed files
with
93 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2024 The html5ever Project Developers. See the | ||
// COPYRIGHT file at the top-level directory of this distribution. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
/// Simple container for storing tests for later execution | ||
pub struct Test { | ||
pub name: String, | ||
pub skip: bool, | ||
pub test: Box<dyn Fn()>, | ||
} | ||
|
||
impl Test { | ||
/// Invoke the stored test function | ||
/// | ||
/// A status message is printed if the wrapped closure completes | ||
/// or is marked as skipped. The test should panic to report | ||
/// failure. | ||
pub fn run(&self) { | ||
print!("test {} ...", self.name); | ||
if self.skip { | ||
println!(" SKIPPED"); | ||
} else { | ||
(self.test)(); | ||
println!(" ok"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters