@@ -14,8 +14,7 @@ def _native_dep_lib_name(ctx):
14
14
def _lib_has_no_native_libs_test_impl (ctx ):
15
15
env = analysistest .begin (ctx )
16
16
tut = analysistest .target_under_test (env )
17
- actions = analysistest .target_actions (env )
18
- action = actions [0 ]
17
+ action = tut .actions [0 ]
19
18
assert_argv_contains (env , action , "--crate-type=lib" )
20
19
assert_argv_contains_prefix_suffix (env , action , "-Lnative=" , "/native_deps" )
21
20
assert_argv_contains_not (env , action , "-lstatic=native_dep" )
@@ -25,8 +24,7 @@ def _lib_has_no_native_libs_test_impl(ctx):
25
24
def _rlib_has_no_native_libs_test_impl (ctx ):
26
25
env = analysistest .begin (ctx )
27
26
tut = analysistest .target_under_test (env )
28
- actions = analysistest .target_actions (env )
29
- action = actions [0 ]
27
+ action = tut .actions [0 ]
30
28
assert_argv_contains (env , action , "--crate-type=rlib" )
31
29
assert_argv_contains_not (env , action , "-lstatic=native_dep" )
32
30
assert_argv_contains_not (env , action , "-ldylib=native_dep" )
@@ -35,45 +33,40 @@ def _rlib_has_no_native_libs_test_impl(ctx):
35
33
def _dylib_has_native_libs_test_impl (ctx ):
36
34
env = analysistest .begin (ctx )
37
35
tut = analysistest .target_under_test (env )
38
- actions = analysistest .target_actions (env )
39
- action = actions [0 ]
36
+ action = tut .actions [0 ]
40
37
assert_argv_contains (env , action , "--crate-type=dylib" )
41
38
assert_argv_contains (env , action , "-lstatic=native_dep" )
42
39
return analysistest .end (env )
43
40
44
41
def _cdylib_has_native_libs_test_impl (ctx ):
45
42
env = analysistest .begin (ctx )
46
43
tut = analysistest .target_under_test (env )
47
- actions = analysistest .target_actions (env )
48
- action = actions [0 ]
44
+ action = tut .actions [0 ]
49
45
assert_argv_contains (env , action , "--crate-type=cdylib" )
50
46
assert_argv_contains_prefix_suffix (env , action , "link-arg=" , "/native_deps/" + _native_dep_lib_name (ctx ))
51
47
return analysistest .end (env )
52
48
53
49
def _staticlib_has_native_libs_test_impl (ctx ):
54
50
env = analysistest .begin (ctx )
55
51
tut = analysistest .target_under_test (env )
56
- actions = analysistest .target_actions (env )
57
- action = actions [0 ]
52
+ action = tut .actions [0 ]
58
53
assert_argv_contains (env , action , "--crate-type=staticlib" )
59
54
assert_argv_contains_prefix_suffix (env , action , "link-arg=" , "/native_deps/" + _native_dep_lib_name (ctx ))
60
55
return analysistest .end (env )
61
56
62
57
def _proc_macro_has_native_libs_test_impl (ctx ):
63
58
env = analysistest .begin (ctx )
64
59
tut = analysistest .target_under_test (env )
65
- actions = analysistest .target_actions (env )
66
- asserts .equals (env , 1 , len (actions ))
67
- action = actions [0 ]
60
+ asserts .equals (env , 1 , len (tut .actions ))
61
+ action = tut .actions [0 ]
68
62
assert_argv_contains (env , action , "--crate-type=proc-macro" )
69
63
assert_argv_contains_prefix_suffix (env , action , "link-arg=" , "/native_deps/" + _native_dep_lib_name (ctx ))
70
64
return analysistest .end (env )
71
65
72
66
def _bin_has_native_libs_test_impl (ctx ):
73
67
env = analysistest .begin (ctx )
74
68
tut = analysistest .target_under_test (env )
75
- actions = analysistest .target_actions (env )
76
- action = actions [0 ]
69
+ action = tut .actions [0 ]
77
70
assert_argv_contains_prefix_suffix (env , action , "link-arg=" , "/native_deps/" + _native_dep_lib_name (ctx ))
78
71
return analysistest .end (env )
79
72
@@ -89,8 +82,7 @@ def _extract_linker_args(argv):
89
82
def _bin_has_native_dep_and_alwayslink_test_impl (ctx ):
90
83
env = analysistest .begin (ctx )
91
84
tut = analysistest .target_under_test (env )
92
- actions = analysistest .target_actions (env )
93
- action = actions [0 ]
85
+ action = tut .actions [0 ]
94
86
95
87
if ctx .target_platform_has_constraint (ctx .attr ._macos_constraint [platform_common .ConstraintValueInfo ]):
96
88
want = [
@@ -120,8 +112,7 @@ def _bin_has_native_dep_and_alwayslink_test_impl(ctx):
120
112
def _cdylib_has_native_dep_and_alwayslink_test_impl (ctx ):
121
113
env = analysistest .begin (ctx )
122
114
tut = analysistest .target_under_test (env )
123
- actions = analysistest .target_actions (env )
124
- action = actions [0 ]
115
+ action = tut .actions [0 ]
125
116
126
117
if ctx .target_platform_has_constraint (ctx .attr ._macos_constraint [platform_common .ConstraintValueInfo ]):
127
118
want = [
0 commit comments