File tree Expand file tree Collapse file tree 4 files changed +20
-3
lines changed
src/tools/compiletest/src Expand file tree Collapse file tree 4 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ impl CompareMode {
117117 }
118118}
119119
120+ /// Configuration for compiletest
120121#[ derive( Clone ) ]
121122pub struct Config {
122123 /// `true` to to overwrite stderr/stdout files instead of complaining about changes in output.
@@ -254,6 +255,8 @@ pub struct Config {
254255 pub linker : Option < String > ,
255256 pub llvm_components : String ,
256257 pub llvm_cxxflags : String ,
258+
259+ /// Path to a NodeJS executable. Used for JS doctests, emscripten and WASM tests
257260 pub nodejs : Option < String > ,
258261}
259262
Original file line number Diff line number Diff line change @@ -333,7 +333,10 @@ pub struct TestProps {
333333 pub normalize_stdout : Vec < ( String , String ) > ,
334334 pub normalize_stderr : Vec < ( String , String ) > ,
335335 pub failure_status : i32 ,
336+ // Whether or not `rustfix` should apply the `CodeSuggestion`s of this test and compile the
337+ // resulting Rust code.
336338 pub run_rustfix : bool ,
339+ // If true, `rustfix` will only apply `MachineApplicable` suggestions.
337340 pub rustfix_only_machine_applicable : bool ,
338341 pub assembly_output : Option < String > ,
339342}
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+
14use crate :: errors:: { Error , ErrorKind } ;
25use crate :: runtest:: ProcRes ;
36use serde_json;
47use std:: path:: Path ;
58use std:: str:: FromStr ;
69
7- // These structs are a subset of the ones found in
8- // `syntax::json`.
9-
1010#[ derive( Deserialize ) ]
1111struct Diagnostic {
1212 message : String ,
Original file line number Diff line number Diff line change @@ -598,6 +598,8 @@ fn collect_tests_from_dir(
598598 Ok ( ( ) )
599599}
600600
601+
602+ /// Returns true if `file_name` looks like a proper test file name.
601603pub fn is_test ( file_name : & OsString ) -> bool {
602604 let file_name = file_name. to_str ( ) . unwrap ( ) ;
603605
@@ -1048,3 +1050,12 @@ fn test_extract_gdb_version() {
10481050 7012050 : "GNU gdb (GDB) 7.12.50.20161027-git" ,
10491051 }
10501052}
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