File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ //! Tests for `-Zbuild-analysis`.
2
+
3
+ use crate :: prelude:: * ;
4
+
5
+ use cargo_test_support:: basic_manifest;
6
+ use cargo_test_support:: project;
7
+ use cargo_test_support:: str;
8
+
9
+ #[ cargo_test]
10
+ fn gated ( ) {
11
+ let p = project ( )
12
+ . file ( "Cargo.toml" , & basic_manifest ( "foo" , "0.0.0" ) )
13
+ . file ( "src/lib.rs" , "" )
14
+ . build ( ) ;
15
+
16
+ p. cargo ( "check" )
17
+ . env ( "CARGO_BUILD_ANALYSIS_ENABLED" , "true" )
18
+ . masquerade_as_nightly_cargo ( & [ "build-analysis" ] )
19
+ . with_stderr_data ( str![ [ r#"
20
+ [CHECKING] foo v0.0.0 ([ROOT]/foo)
21
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
22
+
23
+ "# ] ] )
24
+ . run ( ) ;
25
+ }
26
+
27
+ #[ cargo_test]
28
+ fn simple ( ) {
29
+ let p = project ( )
30
+ . file ( "Cargo.toml" , & basic_manifest ( "foo" , "0.0.0" ) )
31
+ . file ( "src/lib.rs" , "" )
32
+ . build ( ) ;
33
+
34
+ p. cargo ( "check -Zbuild-analysis" )
35
+ . env ( "CARGO_BUILD_ANALYSIS_ENABLED" , "true" )
36
+ . masquerade_as_nightly_cargo ( & [ "build-analysis" ] )
37
+ . with_stderr_data ( str![ [ r#"
38
+ [CHECKING] foo v0.0.0 ([ROOT]/foo)
39
+ [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
40
+
41
+ "# ] ] )
42
+ . run ( ) ;
43
+ }
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ mod bad_manifest_path;
11
11
mod bench;
12
12
mod binary_name;
13
13
mod build;
14
+ mod build_analysis;
14
15
mod build_dir;
15
16
mod build_plan;
16
17
mod build_script;
You can’t perform that action at this time.
0 commit comments