File tree 4 files changed +11
-7
lines changed
4 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`"
193
193
"" ,
194
194
"rustfix-coverage" ,
195
195
"enable this to generate a Rustfix coverage file, which is saved in \
196
- `/tmp /rustfix_missing_coverage.txt`",
196
+ `/<build_base> /rustfix_missing_coverage.txt`",
197
197
) ;
198
198
}
199
199
"bench" => {
Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ pub struct Config {
247
247
248
248
/// If true, this will generate a coverage file with UI test files that run `MachineApplicable`
249
249
/// diagnostics but are missing `run-rustfix` annotations. The generated coverage file is
250
- /// created in `/tmp /rustfix_missing_coverage.txt`
250
+ /// created in `/<build_base> /rustfix_missing_coverage.txt`
251
251
pub rustfix_coverage : bool ,
252
252
253
253
// Configuration for various run-make tests frobbing things like C compilers
Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
237
237
"" ,
238
238
"rustfix-coverage" ,
239
239
"enable this to generate a Rustfix coverage file, which is saved in \
240
- `/tmp /rustfix_missing_coverage.txt`",
240
+ `./<build_base> /rustfix_missing_coverage.txt`",
241
241
)
242
242
. optflag ( "h" , "help" , "show this message" ) ;
243
243
@@ -486,9 +486,10 @@ pub fn run_tests(config: &Config) {
486
486
// we first make sure that the coverage file does not exist.
487
487
// It will be created later on.
488
488
if config. rustfix_coverage {
489
- let coverage_file_path = Path :: new ( "/tmp/rustfix_missing_coverage.txt" ) ;
489
+ let mut coverage_file_path = config. build_base . clone ( ) ;
490
+ coverage_file_path. push ( "rustfix_missing_coverage.txt" ) ;
490
491
if coverage_file_path. exists ( ) {
491
- if let Err ( e) = fs:: remove_file ( coverage_file_path) {
492
+ if let Err ( e) = fs:: remove_file ( & coverage_file_path) {
492
493
panic ! ( "Could not delete {} due to {}" , coverage_file_path. display( ) , e)
493
494
}
494
495
}
Original file line number Diff line number Diff line change @@ -2829,11 +2829,14 @@ impl<'test> TestCx<'test> {
2829
2829
if suggestions. len ( ) > 0
2830
2830
&& !self . props . run_rustfix
2831
2831
&& !self . props . rustfix_only_machine_applicable {
2832
- let coverage_file_path = Path :: new ( "/tmp/rustfix_missing_coverage.txt" ) ;
2832
+ let mut coverage_file_path = self . config . build_base . clone ( ) ;
2833
+ coverage_file_path. push ( "rustfix_missing_coverage.txt" ) ;
2834
+ debug ! ( "coverage_file_path: {}" , coverage_file_path. display( ) ) ;
2835
+
2833
2836
let mut file = OpenOptions :: new ( )
2834
2837
. create ( true )
2835
2838
. append ( true )
2836
- . open ( coverage_file_path)
2839
+ . open ( coverage_file_path. as_path ( ) )
2837
2840
. expect ( "could not create or open file" ) ;
2838
2841
2839
2842
if let Err ( _) = writeln ! ( file, "{}" , self . testpaths. file. display( ) ) {
You can’t perform that action at this time.
0 commit comments