Ignore various files that are probably not tests when searching for tests

Closes #732
This commit is contained in:
Brian Anderson 2011-07-25 12:10:34 -07:00
parent 42e57f64b7
commit 758c11b22c

View File

@ -162,7 +162,11 @@ fn make_tests(&config config) -> test::test_desc[] {
} }
fn is_test(&str testfile) -> bool { fn is_test(&str testfile) -> bool {
str::ends_with(testfile, ".rs") || str::ends_with(testfile, ".rc") auto name = fs::basename(testfile);
(str::ends_with(name, ".rs") || str::ends_with(name, ".rc"))
&& !(str::starts_with(name, ".")
|| str::starts_with(name, "#")
|| str::starts_with(name, "~"))
} }
fn make_test(&config config, &str testfile) -> test::test_desc { fn make_test(&config config, &str testfile) -> test::test_desc {