@@ -22,17 +22,28 @@ def test_target_linux(codeql, rust):
22
22
@pytest .mark .ql_test ("cfg_functions.ql" , expected = ".override.expected" )
23
23
@pytest .mark .ql_test ("arch_functions.ql" , expected = f".{ platform .system ()} .expected" )
24
24
def test_cfg_override (codeql , rust ):
25
- # currently codeql CLI has a limitation not allow to pass `=` in values via `--extractor-option`
26
- os .environ ["CODEQL_EXTRACTOR_RUST_OPTION_CARGO_CFG_OVERRIDES" ] = "cfg_flag,cfg_key=value,-target_pointer_width=64,target_pointer_width=32,test"
27
- codeql .database .create ()
25
+ overrides = "," .join ((
26
+ "cfg_flag" ,
27
+ "cfg_key=value" ,
28
+ "-target_pointer_width=64" ,
29
+ "target_pointer_width=32" ,
30
+ "test" ,
31
+ ))
32
+ codeql .database .create (extractor_option = f"cargo_cfg_overrides={ overrides } " )
28
33
29
34
@pytest .mark .ql_test ("arch_functions.ql" , expected = f".{ platform .system ()} .expected" )
30
35
@pytest .mark .parametrize ("features" ,
31
36
[
32
37
pytest .param (p ,
33
38
marks = pytest .mark .ql_test ("feature_functions.ql" , expected = f".{ e } .expected" ),
34
- id = "all" if p == "*" else p ) # CI does not like tests with *...
35
- for p , e in (("foo" , "foo" ), ("bar" , "bar" ), ("*" , "all" ), ("foo,bar" , "all" ))
39
+ id = id )
40
+ for p , e , id in (
41
+ ("foo" , "foo" , "foo" ),
42
+ ("bar" , "bar" , "bar" ),
43
+ # as long as the integration test runner does not sanitize filenames we must
44
+ # replace `*` and `,` in the parameter id
45
+ ("*" , "all" , "all" ),
46
+ ("foo,bar" , "all" , "foo+bar" ))
36
47
])
37
48
def test_features (codeql , rust , features ):
38
49
codeql .database .create (extractor_option = f"cargo_features={ features } " )
0 commit comments