Adds pass command to clif-util. (#487)

* Adds pass command to clif-util.
This commit is contained in:
Caroline Cullen
2018-09-04 16:31:24 -07:00
committed by Dan Gohman
parent 17bb62c16c
commit 59b83912ba
8 changed files with 207 additions and 30 deletions

View File

@@ -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