@@ -3004,6 +3004,7 @@ fn json_artifact_includes_test_flag() {
3004
3004
"overflow_checks": true,
3005
3005
"test": false
3006
3006
},
3007
+ "executable": null,
3007
3008
"features": [],
3008
3009
"package_id":"foo 0.0.1 ([..])",
3009
3010
"target":{
@@ -3026,6 +3027,7 @@ fn json_artifact_includes_test_flag() {
3026
3027
"overflow_checks": true,
3027
3028
"test": true
3028
3029
},
3030
+ "executable": "[..]/foo-[..]",
3029
3031
"features": [],
3030
3032
"package_id":"foo 0.0.1 ([..])",
3031
3033
"target":{
@@ -3042,6 +3044,81 @@ fn json_artifact_includes_test_flag() {
3042
3044
) . run ( ) ;
3043
3045
}
3044
3046
3047
+ #[ test]
3048
+ fn json_artifact_includes_executable_for_library_tests ( ) {
3049
+ let p = project ( )
3050
+ . file ( "src/main.rs" , "fn main() { }" )
3051
+ . file ( "src/lib.rs" , r#"#[test] fn lib_test() {}"# )
3052
+ . build ( ) ;
3053
+
3054
+ p. cargo ( "test --lib -v --no-run --message-format=json" )
3055
+ . with_json ( r#"
3056
+ {
3057
+ "executable": "[..]/foo/target/debug/foo-[..][EXE]",
3058
+ "features": [],
3059
+ "filenames": "{...}",
3060
+ "fresh": false,
3061
+ "package_id": "foo 0.0.1 ([..])",
3062
+ "profile": "{...}",
3063
+ "reason": "compiler-artifact",
3064
+ "target": {
3065
+ "crate_types": [ "lib" ],
3066
+ "kind": [ "lib" ],
3067
+ "edition": "2015",
3068
+ "name": "foo",
3069
+ "src_path": "[..]/foo/src/lib.rs"
3070
+ }
3071
+ }
3072
+ "# )
3073
+ . run ( ) ;
3074
+ }
3075
+
3076
+ #[ test]
3077
+ fn json_artifact_includes_executable_for_integration_tests ( ) {
3078
+ let p = project ( )
3079
+ . file ( "src/main.rs" , "fn main() {}" )
3080
+ . file ( "tests/integration_test.rs" , r#"#[test] fn integration_test() {}"# )
3081
+ . build ( ) ;
3082
+
3083
+ p. cargo ( "test -v --no-run --message-format=json --test integration_test" )
3084
+ . with_json ( r#"
3085
+ {
3086
+ "executable": "[..]/foo/target/debug/foo[EXE]",
3087
+ "features": [],
3088
+ "filenames": "{...}",
3089
+ "fresh": false,
3090
+ "package_id": "foo 0.0.1 ([..])",
3091
+ "profile": "{...}",
3092
+ "reason": "compiler-artifact",
3093
+ "target": {
3094
+ "crate_types": [ "bin" ],
3095
+ "kind": [ "bin" ],
3096
+ "edition": "2015",
3097
+ "name": "foo",
3098
+ "src_path": "[..]/foo/src/main.rs"
3099
+ }
3100
+ }
3101
+
3102
+ {
3103
+ "executable": "[..]/foo/target/debug/integration_test-[..][EXE]",
3104
+ "features": [],
3105
+ "filenames": "{...}",
3106
+ "fresh": false,
3107
+ "package_id": "foo 0.0.1 ([..])",
3108
+ "profile": "{...}",
3109
+ "reason": "compiler-artifact",
3110
+ "target": {
3111
+ "crate_types": [ "bin" ],
3112
+ "kind": [ "test" ],
3113
+ "edition": "2015",
3114
+ "name": "integration_test",
3115
+ "src_path": "[..]/foo/tests/integration_test.rs"
3116
+ }
3117
+ }
3118
+ "# )
3119
+ . run ( ) ;
3120
+ }
3121
+
3045
3122
#[ test]
3046
3123
fn test_build_script_links ( ) {
3047
3124
let p = project ( )
0 commit comments