[PATCH] D24470: [analyzer] scan-build-py: Remove relative path hack for SATestsBuild.py

Devin Coughlin via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 14 11:22:59 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL281516: [analyzer] scan-build-py: Remove relative path hack for SATestsBuild.py (authored by dcoughlin).

Changed prior to commit:
  https://reviews.llvm.org/D24470?vs=71046&id=71401#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D24470

Files:
  cfe/trunk/tools/scan-build-py/libscanbuild/runner.py
  cfe/trunk/tools/scan-build-py/tests/unit/test_runner.py

Index: cfe/trunk/tools/scan-build-py/tests/unit/test_runner.py
===================================================================
--- cfe/trunk/tools/scan-build-py/tests/unit/test_runner.py
+++ cfe/trunk/tools/scan-build-py/tests/unit/test_runner.py
@@ -219,20 +219,6 @@
         self.assertEqual(['-DNDEBUG', '-UNDEBUG'], test(['-DNDEBUG']))
         self.assertEqual(['-DSomething', '-UNDEBUG'], test(['-DSomething']))
 
-    def test_set_file_relative_path(self):
-        def test(expected, input):
-            spy = Spy()
-            self.assertEqual(spy.success,
-                             sut.set_file_path_relative(input, spy.call))
-            self.assertEqual(expected, spy.arg['file'])
-
-        test('source.c',
-             {'file': '/home/me/source.c', 'directory': '/home/me'})
-        test('me/source.c',
-             {'file': '/home/me/source.c', 'directory': '/home'})
-        test('../home/me/source.c',
-             {'file': '/home/me/source.c', 'directory': '/tmp'})
-
     def test_set_language_fall_through(self):
         def language(expected, input):
             spy = Spy()
Index: cfe/trunk/tools/scan-build-py/libscanbuild/runner.py
===================================================================
--- cfe/trunk/tools/scan-build-py/libscanbuild/runner.py
+++ cfe/trunk/tools/scan-build-py/libscanbuild/runner.py
@@ -205,19 +205,8 @@
     return continuation(opts)
 
 
- at require(['file', 'directory'])
-def set_file_path_relative(opts, continuation=filter_debug_flags):
-    """ Set source file path to relative to the working directory.
-
-    The only purpose of this function is to pass the SATestBuild.py tests. """
-
-    opts.update({'file': os.path.relpath(opts['file'], opts['directory'])})
-
-    return continuation(opts)
-
-
 @require(['language', 'compiler', 'file', 'flags'])
-def language_check(opts, continuation=set_file_path_relative):
+def language_check(opts, continuation=filter_debug_flags):
     """ Find out the language from command line parameters or file name
     extension. The decision also influenced by the compiler invocation. """
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24470.71401.patch
Type: text/x-patch
Size: 2109 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160914/e52f395e/attachment.bin>


More information about the cfe-commits mailing list