MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / test_sarif_rule_properties

Function test_sarif_rule_properties

test/cli/sarif_test.py:430–455  ·  view source on GitHub ↗

Test that rules have required properties.

()

Source from the content-addressed store, hash-verified

428
429
430def test_sarif_rule_properties():
431 """Test that rules have required properties."""
432 sarif = run_sarif_check(TEST_CODE)
433
434 run = sarif["runs"][0]
435 driver = run["tool"]["driver"]
436 rules = driver["rules"]
437
438 for rule in rules:
439 assert "properties" in rule
440 props = rule["properties"]
441
442 # Required properties
443 assert "precision" in props
444 assert props["precision"] in ["very-high", "high", "medium", "low"]
445
446 assert "problem.severity" in props
447 assert props["problem.severity"] in [
448 "error",
449 "warning",
450 "style",
451 "performance",
452 "portability",
453 "information",
454 "note",
455 ]
456
457
458def test_sarif_rule_coverage():

Callers

nothing calls this directly

Calls 1

run_sarif_checkFunction · 0.85

Tested by

no test coverage detected