@@ -74,6 +74,7 @@ fn execute_single_test(case: &dyn TestCase, exec_opts: ExecuteOptions) -> Outcom
74
74
println ! ( "------ {} ------" , case. name( ) ) ;
75
75
let self_exe = std:: env:: current_exe ( ) . unwrap ( ) ;
76
76
let tmp = tempfile:: tempdir ( ) . unwrap ( ) ;
77
+ let mut temp_logs_dir = None ;
77
78
let mut cmd = if exec_opts. trace {
78
79
if cfg ! ( target_os = "linux" ) {
79
80
let mut cmd = std:: process:: Command :: new ( "strace" ) ;
@@ -83,21 +84,23 @@ fn execute_single_test(case: &dyn TestCase, exec_opts: ExecuteOptions) -> Outcom
83
84
cmd
84
85
} else if cfg ! ( target_os = "windows" ) {
85
86
let mut cmd = std:: process:: Command :: new (
86
- "C:\\ Program Files (x86)\\ Windows Kits\\ 10\\ Debuggers\\ x64\\ cdb.exe"
87
+ "C:\\ Program Files (x86)\\ Windows Kits\\ 10\\ Debuggers\\ x64\\ cdb.exe" ,
87
88
) ;
88
89
// disable debug heap
89
90
cmd. arg ( "-hd" ) ;
90
91
// follow children
91
92
cmd. arg ( "-o" ) ;
92
93
93
- let script_file_path = tmp. path ( ) . join ( "script.txt" ) ;
94
-
94
+ let script_file_path = tmp. path ( ) . join ( "cdb- script.txt" ) ;
95
+ let logs_path = tmp . path ( ) . join ( format ! ( "{}-ntapi-logs" , case . name ( ) ) ) ;
95
96
std:: fs:: write (
96
97
& script_file_path,
97
98
[
98
- "!logexts.loge" ,
99
+ & format ! ( "!logexts.loge {}" , logs_path . display ( ) ) ,
99
100
"!logexts.logc e *" ,
100
101
"!logexts.logo e d" ,
102
+ "!logexts.logo e t" ,
103
+ "!logexts.logo e v" ,
101
104
"g" ,
102
105
"!logexts.logb p" ,
103
106
"q" ,
@@ -106,6 +109,8 @@ fn execute_single_test(case: &dyn TestCase, exec_opts: ExecuteOptions) -> Outcom
106
109
)
107
110
. unwrap ( ) ;
108
111
112
+ temp_logs_dir. replace ( logs_path) ;
113
+
109
114
cmd. arg ( "-cf" ) . arg ( & script_file_path) ;
110
115
111
116
cmd. arg ( self_exe) ;
@@ -126,6 +131,9 @@ fn execute_single_test(case: &dyn TestCase, exec_opts: ExecuteOptions) -> Outcom
126
131
cmd. env ( crate :: WORKER_ENV_NAME , "1" ) ;
127
132
cmd. env ( "TEST" , case. name ( ) ) ;
128
133
let status = cmd. status ( ) . unwrap ( ) ;
134
+ if let Some ( p) = temp_logs_dir {
135
+ std:: fs:: rename ( p, format ! ( "./strace-{}" , case. name( ) ) ) . unwrap ( ) ;
136
+ }
129
137
if status. success ( ) {
130
138
Outcome :: Success
131
139
} else {
0 commit comments