@@ -765,14 +765,7 @@ feature on
765765fn rebuild_tests_if_lib_changes ( ) {
766766 let p = project ( )
767767 . 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;" )
776769 . build ( ) ;
777770
778771 p. cargo ( "build -Zchecksum-freshness" )
@@ -784,21 +777,18 @@ fn rebuild_tests_if_lib_changes() {
784777
785778 p. change_file ( "src/lib.rs" , "" ) ;
786779
787- p. cargo ( "build -Zchecksum-freshness -v " )
780+ p. cargo ( "build -Zchecksum-freshness" )
788781 . masquerade_as_nightly_cargo ( & [ "checksum-freshness" ] )
789782 . run ( ) ;
790- p. cargo ( "test -Zchecksum-freshness -v" )
783+ p. cargo ( "test -Zchecksum-freshness -v --test foo-test " )
791784 . masquerade_as_nightly_cargo ( & [ "checksum-freshness" ] )
792- . with_status ( 101 )
793785 . with_stderr_data ( str![ [ r#"
794786[DIRTY] foo v0.0.1 ([ROOT]/foo): the dependency foo was rebuilt ([TIME_DIFF_AFTER_LAST_BUILD])
795787[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+
802792"# ] ] )
803793 . run ( ) ;
804794}
0 commit comments