File tree Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change 11//! Tests for the jobserver protocol.
22
3+ use cargo_util:: is_ci;
34use std:: net:: TcpListener ;
5+ use std:: process:: Command ;
46use std:: thread;
57
68use cargo_test_support:: { cargo_exe, project} ;
@@ -56,8 +58,17 @@ fn jobserver_exists() {
5658 p. cargo ( "build -j2" ) . run ( ) ;
5759}
5860
59- #[ cargo_test( requires_make ) ]
61+ #[ cargo_test]
6062fn makes_jobserver_used ( ) {
63+ let make = if cfg ! ( windows) {
64+ "mingw32-make"
65+ } else {
66+ "make"
67+ } ;
68+ if !is_ci ( ) && Command :: new ( make) . arg ( "--version" ) . output ( ) . is_err ( ) {
69+ return ;
70+ }
71+
6172 let p = project ( )
6273 . file (
6374 "Cargo.toml" ,
151162 drop ( ( a2, a3) ) ;
152163 } ) ;
153164
154- p. process ( " make" )
165+ p. process ( make)
155166 . env ( "CARGO" , cargo_exe ( ) )
156167 . env ( "ADDR" , addr. to_string ( ) )
157168 . arg ( "-j2" )
@@ -161,6 +172,15 @@ all:
161172
162173#[ cargo_test]
163174fn jobserver_and_j ( ) {
175+ let make = if cfg ! ( windows) {
176+ "mingw32-make"
177+ } else {
178+ "make"
179+ } ;
180+ if !is_ci ( ) && Command :: new ( make) . arg ( "--version" ) . output ( ) . is_err ( ) {
181+ return ;
182+ }
183+
164184 let p = project ( )
165185 . file ( "src/lib.rs" , "" )
166186 . file (
172192 )
173193 . build ( ) ;
174194
175- p. process ( " make" )
195+ p. process ( make)
176196 . env ( "CARGO" , cargo_exe ( ) )
177197 . arg ( "-j2" )
178198 . with_stderr (
You can’t perform that action at this time.
0 commit comments