@@ -27,8 +27,8 @@ def test_multi_targets(self):
27
27
# Random module in src/, defaults to --lib.
28
28
('src/lmod1.rs' , [('src/lib.rs' , '--lib' )]),
29
29
# Target failure. Perhaps this should run rustc directly?
30
- ('mystery.rs' , []),
31
- ('build.rs' , []),
30
+ ('mystery.rs' , [( None , '' ) ]),
31
+ ('build.rs' , [( None , '' ) ]),
32
32
# Shared module in test, not possible to easily determine which
33
33
# test it belongs to.
34
34
('tests/common/helpers.rs' , [('tests/test1.rs' , '--test test1' ),
@@ -53,11 +53,17 @@ def test_multi_targets(self):
53
53
54
54
for (path , targets ) in expected_targets :
55
55
path = os .path .join ('tests' , 'multi-targets' , path )
56
- targets = [(os .path .normpath (
57
- os .path .join (plugin_path , 'tests' , 'multi-targets' , x [0 ])),
58
- x [1 ].split ()) for x in targets ]
56
+ joined_targets = []
57
+ for (target_path , args ) in targets :
58
+ args = args .split ()
59
+ if target_path :
60
+ joined = os .path .normpath (
61
+ os .path .join (plugin_path , 'tests' , 'multi-targets' , target_path ))
62
+ joined_targets .append ((joined , args ))
63
+ else :
64
+ joined_targets .append ((None , args ))
59
65
self ._with_open_file (path ,
60
- lambda view : self ._test_multi_targets (view , targets ))
66
+ lambda view : self ._test_multi_targets (view , joined_targets ))
61
67
62
68
def _test_multi_targets (self , view , expected_targets ):
63
69
expected_targets .sort ()
0 commit comments