@@ -765,14 +765,7 @@ feature on
765
765
fn rebuild_tests_if_lib_changes ( ) {
766
766
let p = project ( )
767
767
. file ( "src/lib.rs" , "pub fn foo() {}" )
768
- . file (
769
- "tests/foo.rs" ,
770
- r#"
771
- extern crate foo;
772
- #[test]
773
- fn test() { foo::foo(); }
774
- "# ,
775
- )
768
+ . file ( "tests/foo-test.rs" , "extern crate foo;" )
776
769
. build ( ) ;
777
770
778
771
p. cargo ( "build -Zchecksum-freshness" )
@@ -784,21 +777,18 @@ fn rebuild_tests_if_lib_changes() {
784
777
785
778
p. change_file ( "src/lib.rs" , "" ) ;
786
779
787
- p. cargo ( "build -Zchecksum-freshness -v " )
780
+ p. cargo ( "build -Zchecksum-freshness" )
788
781
. masquerade_as_nightly_cargo ( & [ "checksum-freshness" ] )
789
782
. run ( ) ;
790
- p. cargo ( "test -Zchecksum-freshness -v" )
783
+ p. cargo ( "test -Zchecksum-freshness -v --test foo-test " )
791
784
. masquerade_as_nightly_cargo ( & [ "checksum-freshness" ] )
792
- . with_status ( 101 )
793
785
. with_stderr_data ( str![ [ r#"
794
786
[DIRTY] foo v0.0.1 ([ROOT]/foo): the dependency foo was rebuilt ([TIME_DIFF_AFTER_LAST_BUILD])
795
787
[COMPILING] foo v0.0.1 ([ROOT]/foo)
796
- [RUNNING] `rustc --crate-name foo [..]
797
- [RUNNING] `rustc --crate-name foo [..]
798
- error[E0425]: cannot find function `foo` in crate `foo`
799
- ...
800
- [ERROR] could not compile `foo` (test "foo") due to 1 previous error
801
- ...
788
+ [RUNNING] `rustc --crate-name foo_test [..]`
789
+ [FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
790
+ [RUNNING] `[ROOT]/foo/target/debug/deps/foo_test-[HASH][EXE]`
791
+
802
792
"# ] ] )
803
793
. run ( ) ;
804
794
}
0 commit comments