Skip to content

Commit 34c88ef

Browse files
committed
Tests for dynamic regexes will now run during 'check-stage2'.
Before, tests for dynamic regexes ran during stage1 and tests for native regexes ran during stage2. But the buildbots don't test stage1, so now both dynamic and native tests are run during stage2. Closes #13740.
1 parent 6c3bdbe commit 34c88ef

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/libregex/test/mod.rs

+15-5
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,17 @@
1212
#[phase(syntax)]
1313
extern crate regex_macros;
1414

15-
// Dirty hack: During stage1, test dynamic regexs. For stage2, we test
16-
// native regexs.
17-
#[cfg(stage1)]
15+
#[cfg(not(stage1))]
16+
#[path = "bench.rs"]
17+
mod native_bench;
18+
19+
#[cfg(not(stage1))]
20+
#[path = "tests.rs"]
21+
mod native_tests;
22+
23+
// Due to macro scoping rules, this definition only applies for the modules
24+
// defined below. Effectively, it allows us to use the same tests for both
25+
// native and dynamic regexes.
1826
macro_rules! regex(
1927
($re:expr) => (
2028
match ::regex::Regex::new($re) {
@@ -24,6 +32,8 @@ macro_rules! regex(
2432
);
2533
)
2634

27-
mod bench;
28-
mod tests;
35+
#[path = "bench.rs"]
36+
mod dynamic_bench;
37+
#[path = "tests.rs"]
38+
mod dynamic_tests;
2939

0 commit comments

Comments
 (0)