@@ -10,7 +10,6 @@ extern crate log;
1010extern crate lazy_static;
1111#[ macro_use]
1212extern crate serde_derive;
13- extern crate test;
1413
1514use crate :: common:: CompareMode ;
1615use crate :: common:: { expected_output_path, output_base_dir, output_relative_path, UI_EXTENSIONS } ;
@@ -24,7 +23,7 @@ use std::fs;
2423use std:: io:: { self , ErrorKind } ;
2524use std:: path:: { Path , PathBuf } ;
2625use std:: process:: Command ;
27- use test :: ColorConfig ;
26+ use libtest :: ColorConfig ;
2827use crate :: util:: logv;
2928use walkdir:: WalkDir ;
3029use env_logger;
@@ -510,7 +509,7 @@ pub fn run_tests(config: &Config) {
510509 // Let tests know which target they're running as
511510 env:: set_var ( "TARGET" , & config. target ) ;
512511
513- let res = test :: run_tests_console ( & opts, tests) ;
512+ let res = libtest :: run_tests_console ( & opts, tests) ;
514513 match res {
515514 Ok ( true ) => { }
516515 Ok ( false ) => panic ! ( "Some tests failed" ) ,
@@ -520,19 +519,20 @@ pub fn run_tests(config: &Config) {
520519 }
521520}
522521
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 ,
525525 filter : config. filter . clone ( ) ,
526526 filter_exact : config. filter_exact ,
527527 run_ignored : if config. run_ignored {
528- test :: RunIgnored :: Yes
528+ libtest :: RunIgnored :: Yes
529529 } else {
530- test :: RunIgnored :: No
530+ libtest :: RunIgnored :: No
531531 } ,
532532 format : if config. quiet {
533- test :: OutputFormat :: Terse
533+ libtest :: OutputFormat :: Terse
534534 } else {
535- test :: OutputFormat :: Pretty
535+ libtest :: OutputFormat :: Pretty
536536 } ,
537537 logfile : config. logfile . clone ( ) ,
538538 run_tests : true ,
@@ -545,11 +545,11 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
545545 test_threads : None ,
546546 skip : vec ! [ ] ,
547547 list : false ,
548- options : test :: Options :: new ( ) ,
548+ options : libtest :: Options :: new ( ) ,
549549 }
550550}
551551
552- pub fn make_tests ( config : & Config ) -> Vec < test :: TestDescAndFn > {
552+ pub fn make_tests ( config : & Config ) -> Vec < libtest :: TestDescAndFn > {
553553 debug ! ( "making tests from {:?}" , config. src_base. display( ) ) ;
554554 let mut tests = Vec :: new ( ) ;
555555 collect_tests_from_dir (
@@ -567,7 +567,7 @@ fn collect_tests_from_dir(
567567 base : & Path ,
568568 dir : & Path ,
569569 relative_dir_path : & Path ,
570- tests : & mut Vec < test :: TestDescAndFn > ,
570+ tests : & mut Vec < libtest :: TestDescAndFn > ,
571571) -> io:: Result < ( ) > {
572572 // Ignore directories that contain a file named `compiletest-ignore-dir`.
573573 if dir. join ( "compiletest-ignore-dir" ) . exists ( ) {
@@ -632,7 +632,7 @@ pub fn is_test(file_name: &OsString) -> bool {
632632 !invalid_prefixes. iter ( ) . any ( |p| file_name. starts_with ( p) )
633633}
634634
635- pub fn make_test ( config : & Config , testpaths : & TestPaths ) -> Vec < test :: TestDescAndFn > {
635+ pub fn make_test ( config : & Config , testpaths : & TestPaths ) -> Vec < libtest :: TestDescAndFn > {
636636 let early_props = if config. mode == Mode :: RunMake {
637637 // Allow `ignore` directives to be in the Makefile.
638638 EarlyProps :: from_file ( config, & testpaths. file . join ( "Makefile" ) )
@@ -644,11 +644,11 @@ pub fn make_test(config: &Config, testpaths: &TestPaths) -> Vec<test::TestDescAn
644644 // since we run the pretty printer across all tests by default.
645645 // If desired, we could add a `should-fail-pretty` annotation.
646646 let should_panic = match config. mode {
647- Pretty => test :: ShouldPanic :: No ,
647+ Pretty => libtest :: ShouldPanic :: No ,
648648 _ => if early_props. should_fail {
649- test :: ShouldPanic :: Yes
649+ libtest :: ShouldPanic :: Yes
650650 } else {
651- test :: ShouldPanic :: No
651+ libtest :: ShouldPanic :: No
652652 } ,
653653 } ;
654654
@@ -675,8 +675,8 @@ pub fn make_test(config: &Config, testpaths: &TestPaths) -> Vec<test::TestDescAn
675675 && config. target . contains ( "emscripten" ) )
676676 || ( config. mode == DebugInfoGdb && !early_props. ignore . can_run_gdb ( ) )
677677 || ( config. mode == DebugInfoLldb && !early_props. ignore . can_run_lldb ( ) ) ;
678- test :: TestDescAndFn {
679- desc : test :: TestDesc {
678+ libtest :: TestDescAndFn {
679+ desc : libtest :: TestDesc {
680680 name : make_test_name ( config, testpaths, revision) ,
681681 ignore,
682682 should_panic,
@@ -786,7 +786,7 @@ fn make_test_name(
786786 config : & Config ,
787787 testpaths : & TestPaths ,
788788 revision : Option < & String > ,
789- ) -> test :: TestName {
789+ ) -> libtest :: TestName {
790790 // Convert a complete path to something like
791791 //
792792 // run-pass/foo/bar/baz.rs
@@ -797,7 +797,7 @@ fn make_test_name(
797797 Some ( ref mode) => format ! ( " ({})" , mode. to_str( ) ) ,
798798 None => String :: new ( ) ,
799799 } ;
800- test :: DynTestName ( format ! (
800+ libtest :: DynTestName ( format ! (
801801 "[{}{}] {}{}" ,
802802 config. mode,
803803 mode_suffix,
@@ -811,7 +811,7 @@ fn make_test_closure(
811811 ignore : Ignore ,
812812 testpaths : & TestPaths ,
813813 revision : Option < & String > ,
814- ) -> test :: TestFn {
814+ ) -> libtest :: TestFn {
815815 let mut config = config. clone ( ) ;
816816 if config. mode == DebugInfoBoth {
817817 // If both gdb and lldb were ignored, then the test as a whole
@@ -825,7 +825,7 @@ fn make_test_closure(
825825
826826 let testpaths = testpaths. clone ( ) ;
827827 let revision = revision. cloned ( ) ;
828- test :: DynTestFn ( Box :: new ( move || {
828+ libtest :: DynTestFn ( Box :: new ( move || {
829829 runtest:: run ( config, & testpaths, revision. as_ref ( ) . map ( |s| s. as_str ( ) ) )
830830 } ) )
831831}
0 commit comments