Skip to content

Commit 758c11b

Browse files
committed
Ignore various files that are probably not tests when searching for tests
Closes #732
1 parent 42e57f6 commit 758c11b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/test/compiletest/compiletest.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,11 @@ fn make_tests(&config config) -> test::test_desc[] {
162162
}
163163

164164
fn is_test(&str testfile) -> bool {
165-
str::ends_with(testfile, ".rs") || str::ends_with(testfile, ".rc")
165+
auto name = fs::basename(testfile);
166+
(str::ends_with(name, ".rs") || str::ends_with(name, ".rc"))
167+
&& !(str::starts_with(name, ".")
168+
|| str::starts_with(name, "#")
169+
|| str::starts_with(name, "~"))
166170
}
167171

168172
fn make_test(&config config, &str testfile) -> test::test_desc {

0 commit comments

Comments
 (0)