@@ -31,16 +31,21 @@ fn find_tests(args: &Arguments, requirements: &[Requirements]) -> Vec<Trial> {
31
31
. flat_map ( |req| req. exact ( exact_filter) )
32
32
. collect ( ) ;
33
33
34
- if is_nextest ( ) {
35
- if exact_tests. is_empty ( ) {
36
- panic ! ( "Failed to find exact match for filter {exact_filter}" ) ;
37
- } else if exact_tests. len ( ) > 1 {
38
- panic ! (
39
- "Only expected one but found {} exact matches for filter {exact_filter}" ,
40
- exact_tests. len( )
41
- ) ;
34
+ match NextestKind :: determine ( ) {
35
+ NextestKind :: InUse { process_per_test } => {
36
+ if exact_tests. is_empty ( ) {
37
+ panic ! ( "Failed to find exact match for filter {exact_filter}" ) ;
38
+ }
39
+ if process_per_test && exact_tests. len ( ) > 1 {
40
+ panic ! (
41
+ "Only expected one but found {} exact matches for filter {exact_filter}" ,
42
+ exact_tests. len( )
43
+ ) ;
44
+ }
42
45
}
46
+ NextestKind :: NotInUse => { }
43
47
}
48
+
44
49
exact_tests
45
50
} else if is_full_scan_forbidden ( args) {
46
51
panic ! ( "Exact filter was expected to be used" ) ;
@@ -52,8 +57,23 @@ fn find_tests(args: &Arguments, requirements: &[Requirements]) -> Vec<Trial> {
52
57
tests
53
58
}
54
59
55
- fn is_nextest ( ) -> bool {
56
- std:: env:: var ( "NEXTEST" ) . as_deref ( ) == Ok ( "1" )
60
+ #[ derive( Clone , Copy , Debug ) ]
61
+ enum NextestKind {
62
+ NotInUse ,
63
+ InUse { process_per_test : bool } ,
64
+ }
65
+
66
+ impl NextestKind {
67
+ fn determine ( ) -> Self {
68
+ if std:: env:: var ( "NEXTEST" ) . as_deref ( ) == Ok ( "1" ) {
69
+ // Process-per-test means that exactly one test should be run.
70
+ let process_per_test =
71
+ std:: env:: var ( "NEXTEST_EXECUTION_MODE" ) . as_deref ( ) == Ok ( "process-per-test" ) ;
72
+ Self :: InUse { process_per_test }
73
+ } else {
74
+ Self :: NotInUse
75
+ }
76
+ }
57
77
}
58
78
59
79
fn is_full_scan_forbidden ( args : & Arguments ) -> bool {
0 commit comments