From 758c11b22c2ae02520b8983cb681726f86dad9de Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 25 Jul 2011 12:10:34 -0700 Subject: [PATCH] Ignore various files that are probably not tests when searching for tests Closes #732 --- src/test/compiletest/compiletest.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/compiletest/compiletest.rs b/src/test/compiletest/compiletest.rs index ae6f229fc81..52f398e0ba2 100644 --- a/src/test/compiletest/compiletest.rs +++ b/src/test/compiletest/compiletest.rs @@ -162,7 +162,11 @@ fn make_tests(&config config) -> test::test_desc[] { } 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 {