@@ -10,7 +10,6 @@ extern crate log;
10
10
extern crate lazy_static;
11
11
#[ macro_use]
12
12
extern crate serde_derive;
13
- extern crate test;
14
13
15
14
use crate :: common:: CompareMode ;
16
15
use crate :: common:: { expected_output_path, output_base_dir, output_relative_path, UI_EXTENSIONS } ;
@@ -24,7 +23,7 @@ use std::fs;
24
23
use std:: io:: { self , ErrorKind } ;
25
24
use std:: path:: { Path , PathBuf } ;
26
25
use std:: process:: Command ;
27
- use test :: ColorConfig ;
26
+ use libtest :: ColorConfig ;
28
27
use crate :: util:: logv;
29
28
use walkdir:: WalkDir ;
30
29
use env_logger;
@@ -510,7 +509,7 @@ pub fn run_tests(config: &Config) {
510
509
// Let tests know which target they're running as
511
510
env:: set_var ( "TARGET" , & config. target ) ;
512
511
513
- let res = test :: run_tests_console ( & opts, tests) ;
512
+ let res = libtest :: run_tests_console ( & opts, tests) ;
514
513
match res {
515
514
Ok ( true ) => { }
516
515
Ok ( false ) => panic ! ( "Some tests failed" ) ,
@@ -520,19 +519,20 @@ pub fn run_tests(config: &Config) {
520
519
}
521
520
}
522
521
523
- pub fn test_opts ( config : & Config ) -> test:: TestOpts {
524
- test:: TestOpts {
522
+ pub fn test_opts ( config : & Config ) -> libtest:: TestOpts {
523
+ libtest:: TestOpts {
524
+ exclude_should_panic : false ,
525
525
filter : config. filter . clone ( ) ,
526
526
filter_exact : config. filter_exact ,
527
527
run_ignored : if config. run_ignored {
528
- test :: RunIgnored :: Yes
528
+ libtest :: RunIgnored :: Yes
529
529
} else {
530
- test :: RunIgnored :: No
530
+ libtest :: RunIgnored :: No
531
531
} ,
532
532
format : if config. quiet {
533
- test :: OutputFormat :: Terse
533
+ libtest :: OutputFormat :: Terse
534
534
} else {
535
- test :: OutputFormat :: Pretty
535
+ libtest :: OutputFormat :: Pretty
536
536
} ,
537
537
logfile : config. logfile . clone ( ) ,
538
538
run_tests : true ,
@@ -545,11 +545,11 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
545
545
test_threads : None ,
546
546
skip : vec ! [ ] ,
547
547
list : false ,
548
- options : test :: Options :: new ( ) ,
548
+ options : libtest :: Options :: new ( ) ,
549
549
}
550
550
}
551
551
552
- pub fn make_tests ( config : & Config ) -> Vec < test :: TestDescAndFn > {
552
+ pub fn make_tests ( config : & Config ) -> Vec < libtest :: TestDescAndFn > {
553
553
debug ! ( "making tests from {:?}" , config. src_base. display( ) ) ;
554
554
let mut tests = Vec :: new ( ) ;
555
555
collect_tests_from_dir (
@@ -567,7 +567,7 @@ fn collect_tests_from_dir(
567
567
base : & Path ,
568
568
dir : & Path ,
569
569
relative_dir_path : & Path ,
570
- tests : & mut Vec < test :: TestDescAndFn > ,
570
+ tests : & mut Vec < libtest :: TestDescAndFn > ,
571
571
) -> io:: Result < ( ) > {
572
572
// Ignore directories that contain a file named `compiletest-ignore-dir`.
573
573
if dir. join ( "compiletest-ignore-dir" ) . exists ( ) {
@@ -632,7 +632,7 @@ pub fn is_test(file_name: &OsString) -> bool {
632
632
!invalid_prefixes. iter ( ) . any ( |p| file_name. starts_with ( p) )
633
633
}
634
634
635
- pub fn make_test ( config : & Config , testpaths : & TestPaths ) -> Vec < test :: TestDescAndFn > {
635
+ pub fn make_test ( config : & Config , testpaths : & TestPaths ) -> Vec < libtest :: TestDescAndFn > {
636
636
let early_props = if config. mode == Mode :: RunMake {
637
637
// Allow `ignore` directives to be in the Makefile.
638
638
EarlyProps :: from_file ( config, & testpaths. file . join ( "Makefile" ) )
@@ -644,11 +644,11 @@ pub fn make_test(config: &Config, testpaths: &TestPaths) -> Vec<test::TestDescAn
644
644
// since we run the pretty printer across all tests by default.
645
645
// If desired, we could add a `should-fail-pretty` annotation.
646
646
let should_panic = match config. mode {
647
- Pretty => test :: ShouldPanic :: No ,
647
+ Pretty => libtest :: ShouldPanic :: No ,
648
648
_ => if early_props. should_fail {
649
- test :: ShouldPanic :: Yes
649
+ libtest :: ShouldPanic :: Yes
650
650
} else {
651
- test :: ShouldPanic :: No
651
+ libtest :: ShouldPanic :: No
652
652
} ,
653
653
} ;
654
654
@@ -675,8 +675,8 @@ pub fn make_test(config: &Config, testpaths: &TestPaths) -> Vec<test::TestDescAn
675
675
&& config. target . contains ( "emscripten" ) )
676
676
|| ( config. mode == DebugInfoGdb && !early_props. ignore . can_run_gdb ( ) )
677
677
|| ( config. mode == DebugInfoLldb && !early_props. ignore . can_run_lldb ( ) ) ;
678
- test :: TestDescAndFn {
679
- desc : test :: TestDesc {
678
+ libtest :: TestDescAndFn {
679
+ desc : libtest :: TestDesc {
680
680
name : make_test_name ( config, testpaths, revision) ,
681
681
ignore,
682
682
should_panic,
@@ -786,7 +786,7 @@ fn make_test_name(
786
786
config : & Config ,
787
787
testpaths : & TestPaths ,
788
788
revision : Option < & String > ,
789
- ) -> test :: TestName {
789
+ ) -> libtest :: TestName {
790
790
// Convert a complete path to something like
791
791
//
792
792
// run-pass/foo/bar/baz.rs
@@ -797,7 +797,7 @@ fn make_test_name(
797
797
Some ( ref mode) => format ! ( " ({})" , mode. to_str( ) ) ,
798
798
None => String :: new ( ) ,
799
799
} ;
800
- test :: DynTestName ( format ! (
800
+ libtest :: DynTestName ( format ! (
801
801
"[{}{}] {}{}" ,
802
802
config. mode,
803
803
mode_suffix,
@@ -811,7 +811,7 @@ fn make_test_closure(
811
811
ignore : Ignore ,
812
812
testpaths : & TestPaths ,
813
813
revision : Option < & String > ,
814
- ) -> test :: TestFn {
814
+ ) -> libtest :: TestFn {
815
815
let mut config = config. clone ( ) ;
816
816
if config. mode == DebugInfoBoth {
817
817
// If both gdb and lldb were ignored, then the test as a whole
@@ -825,7 +825,7 @@ fn make_test_closure(
825
825
826
826
let testpaths = testpaths. clone ( ) ;
827
827
let revision = revision. cloned ( ) ;
828
- test :: DynTestFn ( Box :: new ( move || {
828
+ libtest :: DynTestFn ( Box :: new ( move || {
829
829
runtest:: run ( config, & testpaths, revision. as_ref ( ) . map ( |s| s. as_str ( ) ) )
830
830
} ) )
831
831
}
0 commit comments