1
- use std:: path:: PathBuf ;
2
-
3
- use once_cell:: sync:: Lazy ;
4
-
5
- static DRIVER : Lazy < PathBuf > = Lazy :: new ( || {
6
- let mut cargo = std:: process:: Command :: new ( env ! ( "CARGO" ) ) ;
7
- let res = cargo
8
- . args ( [ "build" , "--example" , "arrow" ] )
9
- . status ( )
10
- . expect ( "cargo should run fine" ) ;
11
- assert ! ( res. success( ) , "cargo invocation should be successful" ) ;
12
-
13
- let path = PathBuf :: from ( env ! ( "CARGO_TARGET_TMPDIR" ) )
14
- . ancestors ( )
15
- . nth ( 1 )
16
- . expect ( "first parent in target dir" )
17
- . join ( "debug" )
18
- . join ( "examples" )
19
- . join ( if cfg ! ( windows) { "arrow.exe" } else { "arrow" } ) ;
20
- assert ! ( path. is_file( ) , "Expecting driver to be located at {path:?}" ) ;
21
- path
22
- } ) ;
1
+ static DRIVER : & str = concat ! ( env!( "CARGO" ) , " run --example arrow" ) ;
23
2
24
3
mod baseline {
25
4
use crate :: driver:: DRIVER ;
5
+ use serial_test:: serial;
26
6
7
+ #[ serial]
27
8
#[ test]
28
9
fn our_implementation_used_by_git ( ) -> crate :: Result {
29
- let mut exe = DRIVER . to_string_lossy ( ) . into_owned ( ) ;
10
+ let mut exe = DRIVER . to_owned ( ) ;
30
11
if cfg ! ( windows) {
31
12
exe = exe. replace ( '\\' , "/" ) ;
32
13
}
@@ -85,6 +66,7 @@ pub(crate) mod apply {
85
66
driver:: { apply, apply:: Delay , Operation } ,
86
67
Driver ,
87
68
} ;
69
+ use serial_test:: serial;
88
70
89
71
use crate :: driver:: { shutdown:: extract_client, DRIVER } ;
90
72
@@ -95,7 +77,7 @@ pub(crate) mod apply {
95
77
}
96
78
97
79
pub ( crate ) fn driver_with_process ( ) -> Driver {
98
- let mut exe = DRIVER . to_string_lossy ( ) . into_owned ( ) ;
80
+ let mut exe = DRIVER . to_owned ( ) ;
99
81
if cfg ! ( windows) {
100
82
exe = exe. replace ( '\\' , "/" ) ;
101
83
}
@@ -108,6 +90,7 @@ pub(crate) mod apply {
108
90
}
109
91
}
110
92
93
+ #[ serial]
111
94
#[ test]
112
95
fn missing_driver_means_no_filter_is_applied ( ) -> crate :: Result {
113
96
let mut state = gix_filter:: driver:: State :: default ( ) ;
@@ -134,6 +117,7 @@ pub(crate) mod apply {
134
117
Ok ( ( ) )
135
118
}
136
119
120
+ #[ serial]
137
121
#[ test]
138
122
fn a_crashing_process_can_restart_it ( ) -> crate :: Result {
139
123
let mut state = gix_filter:: driver:: State :: default ( ) ;
@@ -167,6 +151,7 @@ pub(crate) mod apply {
167
151
Ok ( ( ) )
168
152
}
169
153
154
+ #[ serial]
170
155
#[ test]
171
156
fn process_status_abort_disables_capability ( ) -> crate :: Result {
172
157
let mut state = gix_filter:: driver:: State :: default ( ) ;
@@ -193,6 +178,7 @@ pub(crate) mod apply {
193
178
Ok ( ( ) )
194
179
}
195
180
181
+ #[ serial]
196
182
#[ test]
197
183
fn process_status_strange_shuts_down_process ( ) -> crate :: Result {
198
184
let mut state = gix_filter:: driver:: State :: default ( ) ;
@@ -218,6 +204,7 @@ pub(crate) mod apply {
218
204
Ok ( ( ) )
219
205
}
220
206
207
+ #[ serial]
221
208
#[ test]
222
209
fn smudge_and_clean_failure_is_translated_to_observable_error_for_required_drivers ( ) -> crate :: Result {
223
210
let mut state = gix_filter:: driver:: State :: default ( ) ;
@@ -239,6 +226,7 @@ pub(crate) mod apply {
239
226
Ok ( ( ) )
240
227
}
241
228
229
+ #[ serial]
242
230
#[ test]
243
231
fn smudge_and_clean_failure_means_nothing_if_required_is_false ( ) -> crate :: Result {
244
232
let mut state = gix_filter:: driver:: State :: default ( ) ;
@@ -262,6 +250,7 @@ pub(crate) mod apply {
262
250
Ok ( ( ) )
263
251
}
264
252
253
+ #[ serial]
265
254
#[ test]
266
255
fn smudge_and_clean_series ( ) -> crate :: Result {
267
256
let mut state = gix_filter:: driver:: State :: default ( ) ;
0 commit comments