@@ -11,6 +11,19 @@ def exists(env):
11
11
_unittests = []
12
12
def register_unit_test (env , test ):
13
13
_unittests .append (test .path )
14
+
15
+ hygienic = env .GetOption ('install-mode' ) == 'hygienic'
16
+ if hygienic and getattr (test .attributes , "AIB_INSTALL_ACTIONS" , []):
17
+ installed = getattr (test .attributes , "AIB_INSTALL_ACTIONS" )
18
+ else :
19
+ installed = [test ]
20
+
21
+ env .Command (
22
+ target = "#@{}" .format (os .path .basename (installed [0 ].get_path ())),
23
+ source = installed ,
24
+ action = "${SOURCES[0]}"
25
+ )
26
+
14
27
env .Alias ('$UNITTEST_ALIAS' , test )
15
28
16
29
def unit_test_list_builder_action (env , target , source ):
@@ -42,22 +55,6 @@ def build_cpp_unit_test(env, target, source, **kwargs):
42
55
result = env .Program (target , source , ** kwargs )
43
56
env .RegisterUnitTest (result [0 ])
44
57
45
- hygienic = env .GetOption ('install-mode' ) == 'hygienic'
46
- if not hygienic :
47
- installed_test = env .Install ('#/build/unittests/' , result [0 ])
48
- env .Command (
49
- target = "#@{}" .format (os .path .basename (installed_test [0 ].path )),
50
- source = installed_test ,
51
- action = "${SOURCES[0]}"
52
- )
53
- else :
54
- test_bin_name = os .path .basename (result [0 ].path )
55
- env .Command (
56
- target = "#@{}" .format (test_bin_name ),
57
- source = ["$PREFIX_BINDIR/{}" .format (test_bin_name )],
58
- action = "${SOURCES[0]}"
59
- )
60
-
61
58
return result
62
59
63
60
0 commit comments