File tree 4 files changed +20
-3
lines changed
src/tools/compiletest/src
4 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ impl CompareMode {
117
117
}
118
118
}
119
119
120
+ /// Configuration for compiletest
120
121
#[ derive( Clone ) ]
121
122
pub struct Config {
122
123
/// `true` to to overwrite stderr/stdout files instead of complaining about changes in output.
@@ -254,6 +255,8 @@ pub struct Config {
254
255
pub linker : Option < String > ,
255
256
pub llvm_components : String ,
256
257
pub llvm_cxxflags : String ,
258
+
259
+ /// Path to a NodeJS executable. Used for JS doctests, emscripten and WASM tests
257
260
pub nodejs : Option < String > ,
258
261
}
259
262
Original file line number Diff line number Diff line change @@ -333,7 +333,10 @@ pub struct TestProps {
333
333
pub normalize_stdout : Vec < ( String , String ) > ,
334
334
pub normalize_stderr : Vec < ( String , String ) > ,
335
335
pub failure_status : i32 ,
336
+ // Whether or not `rustfix` should apply the `CodeSuggestion`s of this test and compile the
337
+ // resulting Rust code.
336
338
pub run_rustfix : bool ,
339
+ // If true, `rustfix` will only apply `MachineApplicable` suggestions.
337
340
pub rustfix_only_machine_applicable : bool ,
338
341
pub assembly_output : Option < String > ,
339
342
}
Original file line number Diff line number Diff line change
1
+ //! These structs are a subset of the ones found in `syntax::json`.
2
+ //! They are only used for deserialization of JSON output provided by libtest.
3
+
1
4
use crate :: errors:: { Error , ErrorKind } ;
2
5
use crate :: runtest:: ProcRes ;
3
6
use serde_json;
4
7
use std:: path:: Path ;
5
8
use std:: str:: FromStr ;
6
9
7
- // These structs are a subset of the ones found in
8
- // `syntax::json`.
9
-
10
10
#[ derive( Deserialize ) ]
11
11
struct Diagnostic {
12
12
message : String ,
Original file line number Diff line number Diff line change @@ -598,6 +598,8 @@ fn collect_tests_from_dir(
598
598
Ok ( ( ) )
599
599
}
600
600
601
+
602
+ /// Returns true if `file_name` looks like a proper test file name.
601
603
pub fn is_test ( file_name : & OsString ) -> bool {
602
604
let file_name = file_name. to_str ( ) . unwrap ( ) ;
603
605
@@ -1048,3 +1050,12 @@ fn test_extract_gdb_version() {
1048
1050
7012050 : "GNU gdb (GDB) 7.12.50.20161027-git" ,
1049
1051
}
1050
1052
}
1053
+
1054
+ #[ test]
1055
+ fn is_test_test ( ) {
1056
+ assert_eq ! ( true , is_test( & OsString :: from( "a_test.rs" ) ) ) ;
1057
+ assert_eq ! ( false , is_test( & OsString :: from( ".a_test.rs" ) ) ) ;
1058
+ assert_eq ! ( false , is_test( & OsString :: from( "a_cat.gif" ) ) ) ;
1059
+ assert_eq ! ( false , is_test( & OsString :: from( "#a_dog_gif" ) ) ) ;
1060
+ assert_eq ! ( false , is_test( & OsString :: from( "~a_temp_file" ) ) ) ;
1061
+ }
You can’t perform that action at this time.
0 commit comments