diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2019-09-11 18:49:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-11 18:49:45 (GMT) |
commit | ee536b2020b1f0baad1286dbd4345e13870324af (patch) | |
tree | 2486233603db05a76aaef863bd6639455e3dfef7 /Lib/test/test_check_c_globals.py | |
parent | 9936371af298d465095ae70bc9c2943b4b16eac4 (diff) | |
download | cpython-ee536b2020b1f0baad1286dbd4345e13870324af.zip cpython-ee536b2020b1f0baad1286dbd4345e13870324af.tar.gz cpython-ee536b2020b1f0baad1286dbd4345e13870324af.tar.bz2 |
bpo-36876: Add a tool that identifies unsupported global C variables. (#15877)
Diffstat (limited to 'Lib/test/test_check_c_globals.py')
-rw-r--r-- | Lib/test/test_check_c_globals.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Lib/test/test_check_c_globals.py b/Lib/test/test_check_c_globals.py new file mode 100644 index 0000000..009560e --- /dev/null +++ b/Lib/test/test_check_c_globals.py @@ -0,0 +1,22 @@ +import unittest +import test.test_tools + +test.test_tools.skip_if_missing('c-analyzer') +with test.test_tools.imports_under_tool('c-analyzer'): + from c_globals.__main__ import main + + +class ActualChecks(unittest.TestCase): + + # XXX Also run the check in "make check". + @unittest.expectedFailure + def test_check_c_globals(self): + try: + main('check', {}) + except NotImplementedError: + raise unittest.SkipTest('not supported on this host') + + +if __name__ == '__main__': + # Test needs to be a package, so we can do relative imports. + unittest.main() |