File tree 2 files changed +13
-8
lines changed
2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,13 @@ script:
13
13
- rm -rf target/ Cargo.lock
14
14
- cargo test --features debugging
15
15
16
- # only test regex_macros if it compiles
17
- - if [[ "$(cargo build --features 'debugging test-regex_macros')" = 101 ]]; then cargo test --features 'debugging test-regex_macros'; fi
16
+ - # only test regex_macros if it compiles
17
+ - |
18
+ #!/bin/bash
19
+ cargo test --no-run --features 'debugging test-regex_macros'
20
+ if [ "$?" = 101 ]; then
21
+ cargo test --features 'debugging test-regex_macros'
22
+ fi
18
23
19
24
# trigger rebuild of the clippy-service, to keep it up to date with clippy itself
20
25
after_success :
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ extern crate compiletest_rs as compiletest;
3
3
use std:: path:: PathBuf ;
4
4
use std:: env:: var;
5
5
6
- fn run_mode ( mode : & ' static str ) {
6
+ fn run_mode ( dir : & ' static str , mode : & ' static str ) {
7
7
let mut config = compiletest:: default_config ( ) ;
8
8
9
9
let cfg_mode = mode. parse ( ) . ok ( ) . expect ( "Invalid mode" ) ;
@@ -14,21 +14,21 @@ fn run_mode(mode: &'static str) {
14
14
}
15
15
16
16
config. mode = cfg_mode;
17
- config. src_base = PathBuf :: from ( format ! ( "tests/{}" , mode ) ) ;
17
+ config. src_base = PathBuf :: from ( format ! ( "tests/{}" , dir ) ) ;
18
18
19
19
compiletest:: run_tests ( & config) ;
20
20
}
21
21
22
22
#[ test]
23
23
#[ cfg( not( feature = "test-regex_macros" ) ) ]
24
24
fn compile_test ( ) {
25
- run_mode ( "run-pass" ) ;
26
- run_mode ( "compile-fail" ) ;
25
+ run_mode ( "run-pass" , "run-pass" ) ;
26
+ run_mode ( "compile-fail" , "compile-fail" ) ;
27
27
}
28
28
29
29
#[ test]
30
30
#[ cfg( feature = "test-regex_macros" ) ]
31
31
fn compile_test ( ) {
32
- run_mode ( "run-pass-regex_macros" ) ;
33
- run_mode ( "compile-fail-regex_macros" ) ;
32
+ run_mode ( "run-pass-regex_macros" , "run-pass" ) ;
33
+ run_mode ( "compile-fail-regex_macros" , "compile-fail" ) ;
34
34
}
You can’t perform that action at this time.
0 commit comments