@@ -22,17 +22,28 @@ def test_target_linux(codeql, rust):
2222@pytest .mark .ql_test ("cfg_functions.ql" , expected = ".override.expected" )
2323@pytest .mark .ql_test ("arch_functions.ql" , expected = f".{ platform .system ()} .expected" )
2424def 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 } " )
2833
2934@pytest .mark .ql_test ("arch_functions.ql" , expected = f".{ platform .system ()} .expected" )
3035@pytest .mark .parametrize ("features" ,
3136 [
3237 pytest .param (p ,
3338 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" ))
3647 ])
3748def test_features (codeql , rust , features ):
3849 codeql .database .create (extractor_option = f"cargo_features={ features } " )
0 commit comments