File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ use crate::support;
2
2
use std:: env;
3
3
use std:: fs:: { self , File } ;
4
4
use std:: io:: prelude:: * ;
5
+ use std:: process:: Command ;
5
6
6
7
use crate :: support:: { paths, Execs } ;
7
8
@@ -11,6 +12,18 @@ fn cargo_process(s: &str) -> Execs {
11
12
execs
12
13
}
13
14
15
+ fn mercurial_available ( ) -> bool {
16
+ let result = Command :: new ( "hg" )
17
+ . arg ( "--version" )
18
+ . output ( )
19
+ . map ( |o| o. status . success ( ) )
20
+ . unwrap_or ( false ) ;
21
+ if !result {
22
+ println ! ( "`hg` not available, skipping test" ) ;
23
+ }
24
+ result
25
+ }
26
+
14
27
#[ test]
15
28
fn simple_lib ( ) {
16
29
cargo_process ( "init --lib --vcs none --edition 2015" )
@@ -467,6 +480,9 @@ fn terminating_newline_in_new_git_ignore() {
467
480
468
481
#[ test]
469
482
fn terminating_newline_in_new_mercurial_ignore ( ) {
483
+ if !mercurial_available ( ) {
484
+ return ;
485
+ }
470
486
cargo_process ( "init --vcs hg --lib" )
471
487
. env ( "USER" , "foo" )
472
488
. run ( ) ;
You can’t perform that action at this time.
0 commit comments