1# -*- Python -*- vim: set ft=python ts=4 sw=4 expandtab tw=79:
2
3import site
4
5# Load the custom analyzer test format, which runs the test again with Z3 if it
6# is available.
7site.addsitedir(os.path.dirname(__file__))
8import analyzer_test
9config.test_format = analyzer_test.AnalyzerTest(
10        config.test_format.execute_external, config.use_z3_solver)
11
12# Filtering command used by Clang Analyzer tests (when comparing .plist files
13# with reference output)
14config.substitutions.append(('%normalize_plist',
15    "grep -Ev '%s|%s|%s'" %
16        ('^[[:space:]]*<string>.* version .*</string>[[:space:]]*$',
17         '^[[:space:]]*<string>/.*</string>[[:space:]]*$',
18         '^[[:space:]]*<string>.:.*</string>[[:space:]]*$')))
19
20# Filtering command for testing SARIF output against reference output.
21config.substitutions.append(('%normalize_sarif',
22    "grep -Ev '^[[:space:]]*(%s|%s|%s)[[:space:]]*$'" %
23        ('"uri": "file:.*%basename_t"',
24         '"version": ".* version .*"',
25         '"version": "2.1.0"')))
26
27if not config.root.clang_staticanalyzer:
28    config.unsupported = True
29