Adds pass command to clif-util. (#487)
* Adds pass command to clif-util.
This commit is contained in:
committed by
Dan Gohman
parent
17bb62c16c
commit
59b83912ba
@@ -79,6 +79,24 @@ pub fn run(verbose: bool, files: &[String]) -> TestResult {
|
||||
runner.run()
|
||||
}
|
||||
|
||||
/// Used for 'pass' subcommand.
|
||||
/// Commands are interpreted as test and executed.
|
||||
///
|
||||
/// Directories are scanned recursively for test cases ending in `.clif`.
|
||||
///
|
||||
pub fn run_passes(verbose: bool, passes: &[String], target: &str, file: &String) -> TestResult {
|
||||
let mut runner = TestRunner::new(verbose);
|
||||
|
||||
let path = Path::new(file);
|
||||
if path.is_file() {
|
||||
runner.push_test(path);
|
||||
} else {
|
||||
runner.push_dir(path);
|
||||
}
|
||||
|
||||
runner.run_passes(passes, target)
|
||||
}
|
||||
|
||||
/// Create a new subcommand trait object to match `parsed.command`.
|
||||
///
|
||||
/// This function knows how to create all of the possible `test <foo>` commands that can appear in
|
||||
|
||||
Reference in New Issue
Block a user