Failed Conditions
Pull Request — master (#1182)
by Lasse
01:41
created

bears.tests.c_languages.skip_test()   A

Complexity

Conditions 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 2
dl 0
loc 6
rs 9.4286
1
import sys
2
import unittest
3
4
sys.path.insert(0, ".")
5
from bears.tests.LocalBearTestHelper import generate_local_bear_test
6
from bears.c_languages.ClangBear import ClangBear
7
8
9
ClangBearTest = generate_local_bear_test(
10
    ClangBear,
11
    (["int main() {}"], ),
12
    (["bad things, this is no C code"],  # Has no fixit
13
     ["struct { int f0; } x = { f0 :1 };"],  # Has a fixit and no range
14
     ["int main() {int *b; return b}"]),  # Has a fixit and a range
15
    'test.c')
16
17
18
ClangBearIgnoreTest = generate_local_bear_test(
19
    ClangBear,
20
    # Should ignore the warning, valid!
21
    (["struct { int f0; } x = { f0 :1 };"],),
22
    (),
23
    'test.c',
24
    settings={'clang_cli_options': '-w'})
25
26
27
if __name__ == '__main__':
28
    unittest.main(verbosity=2)
29