summaryrefslogtreecommitdiffstats
path: root/clang/tools/scan-build-py/tests/unit/test_clang.py
diff options
context:
space:
mode:
authorLaszlo Nagy <rizsotto.mailinglist@gmail.com>2016-04-19 12:03:03 +0000
committerLaszlo Nagy <rizsotto.mailinglist@gmail.com>2016-04-19 12:03:03 +0000
commit8bd63e5518f12352387e0e4a183dc331b657c4d1 (patch)
tree92f1d02a11d6815affa4160032773b80cd0bd376 /clang/tools/scan-build-py/tests/unit/test_clang.py
parent79b25d5ea4fd31267a163a9862f153d20e4fdbfe (diff)
downloadbcm5719-llvm-8bd63e5518f12352387e0e4a183dc331b657c4d1.tar.gz
bcm5719-llvm-8bd63e5518f12352387e0e4a183dc331b657c4d1.zip
D17487: [analyzer][scan-build-py] flag filter modification for compilation database creation
llvm-svn: 266726
Diffstat (limited to 'clang/tools/scan-build-py/tests/unit/test_clang.py')
-rw-r--r--clang/tools/scan-build-py/tests/unit/test_clang.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/tools/scan-build-py/tests/unit/test_clang.py b/clang/tools/scan-build-py/tests/unit/test_clang.py
index 2f1fd79d4a9..04414a85b82 100644
--- a/clang/tools/scan-build-py/tests/unit/test_clang.py
+++ b/clang/tools/scan-build-py/tests/unit/test_clang.py
@@ -4,14 +4,15 @@
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
+import libear
import libscanbuild.clang as sut
-from . import fixtures
+import unittest
import os.path
-class GetClangArgumentsTest(fixtures.TestCase):
+class GetClangArgumentsTest(unittest.TestCase):
def test_get_clang_arguments(self):
- with fixtures.TempDir() as tmpdir:
+ with libear.TemporaryDirectory() as tmpdir:
filename = os.path.join(tmpdir, 'test.c')
with open(filename, 'w') as handle:
handle.write('')
@@ -20,8 +21,8 @@ class GetClangArgumentsTest(fixtures.TestCase):
['clang', '-c', filename, '-DNDEBUG', '-Dvar="this is it"'],
tmpdir)
- self.assertIn('NDEBUG', result)
- self.assertIn('var="this is it"', result)
+ self.assertTrue('NDEBUG' in result)
+ self.assertTrue('var="this is it"' in result)
def test_get_clang_arguments_fails(self):
self.assertRaises(
@@ -29,7 +30,7 @@ class GetClangArgumentsTest(fixtures.TestCase):
['clang', '-###', '-fsyntax-only', '-x', 'c', 'notexist.c'], '.')
-class GetCheckersTest(fixtures.TestCase):
+class GetCheckersTest(unittest.TestCase):
def test_get_checkers(self):
# this test is only to see is not crashing
result = sut.get_checkers('clang', [])
OpenPOWER on IntegriCloud