summaryrefslogtreecommitdiff
path: root/tools/scan-build-py/tests/unit/test_clang.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/scan-build-py/tests/unit/test_clang.py')
-rw-r--r--tools/scan-build-py/tests/unit/test_clang.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/scan-build-py/tests/unit/test_clang.py b/tools/scan-build-py/tests/unit/test_clang.py
index 2f1fd79d4a..04414a85b8 100644
--- a/tools/scan-build-py/tests/unit/test_clang.py
+++ b/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', [])