From df9440d5ac4ac23f9a2fd2e6e8ac4c6beb473ba0 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 25 Apr 2017 17:08:12 +0200 Subject: [PATCH] Also test subdirectories of `rust/src/test/run-pass` --- tests/compiletest.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/compiletest.rs b/tests/compiletest.rs index 100b79401d..6e5890d6ad 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -92,9 +92,17 @@ fn compile_test() { let mut unsupported = Vec::new(); let mut unimplemented_intrinsic = Vec::new(); let mut limits = Vec::new(); - for file in std::fs::read_dir(path).unwrap() { + let mut files: Vec<_> = std::fs::read_dir(path).unwrap().collect(); + while let Some(file) = files.pop() { let file = file.unwrap(); let path = file.path(); + if file.metadata().unwrap().is_dir() { + if !path.to_str().unwrap().ends_with("auxiliary") { + // add subdirs recursively + files.extend(std::fs::read_dir(path).unwrap()); + } + continue; + } if !file.metadata().unwrap().is_file() || !path.to_str().unwrap().ends_with(".rs") { continue; }