summaryrefslogtreecommitdiffstats
path: root/clang/tools/scan-build-py/tests/unit/test_report.py
diff options
context:
space:
mode:
Diffstat (limited to 'clang/tools/scan-build-py/tests/unit/test_report.py')
-rw-r--r--clang/tools/scan-build-py/tests/unit/test_report.py30
1 files changed, 16 insertions, 14 deletions
diff --git a/clang/tools/scan-build-py/tests/unit/test_report.py b/clang/tools/scan-build-py/tests/unit/test_report.py
index d505afc20a8..3f249ce2aa0 100644
--- a/clang/tools/scan-build-py/tests/unit/test_report.py
+++ b/clang/tools/scan-build-py/tests/unit/test_report.py
@@ -4,15 +4,15 @@
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
+import libear
import libscanbuild.report as sut
-from . import fixtures
import unittest
import os
import os.path
def run_bug_parse(content):
- with fixtures.TempDir() as tmpdir:
+ with libear.TemporaryDirectory() as tmpdir:
file_name = os.path.join(tmpdir, 'test.html')
with open(file_name, 'w') as handle:
handle.writelines(content)
@@ -21,7 +21,7 @@ def run_bug_parse(content):
def run_crash_parse(content, preproc):
- with fixtures.TempDir() as tmpdir:
+ with libear.TemporaryDirectory() as tmpdir:
file_name = os.path.join(tmpdir, preproc + '.info.txt')
with open(file_name, 'w') as handle:
handle.writelines(content)
@@ -77,20 +77,22 @@ class ParseFileTest(unittest.TestCase):
def test_parse_real_crash(self):
import libscanbuild.runner as sut2
import re
- 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('int main() { return 0')
# produce failure report
- opts = {'directory': os.getcwd(),
- 'clang': 'clang',
- 'file': filename,
- 'report': ['-fsyntax-only', '-E', filename],
- 'language': 'c',
- 'output_dir': tmpdir,
- 'error_type': 'other_error',
- 'error_output': 'some output',
- 'exit_code': 13}
+ opts = {
+ 'clang': 'clang',
+ 'directory': os.getcwd(),
+ 'flags': [],
+ 'file': filename,
+ 'output_dir': tmpdir,
+ 'language': 'c',
+ 'error_type': 'other_error',
+ 'error_output': 'some output',
+ 'exit_code': 13
+ }
sut2.report_failure(opts)
# find the info file
pp_file = None
@@ -123,7 +125,7 @@ class ReportMethodTest(unittest.TestCase):
'/prefix/src/file'))
-class GetPrefixFromCompilationDatabaseTest(fixtures.TestCase):
+class GetPrefixFromCompilationDatabaseTest(unittest.TestCase):
def test_with_different_filenames(self):
self.assertEqual(
OpenPOWER on IntegriCloud