[Lldb-commits] [lldb] r226625 - Fix some platform specific paths in TestSettings.py.

Zachary Turner zturner at google.com
Tue Jan 20 16:40:27 PST 2015


Author: zturner
Date: Tue Jan 20 18:40:27 2015
New Revision: 226625

URL: http://llvm.org/viewvc/llvm-project?rev=226625&view=rev
Log:
Fix some platform specific paths in TestSettings.py.

We were referring to hardcoded paths /bin/ls and /bin/cat.  For
the purposes of this test, the actual value it's set to doesn't
matter, and it might as well be a non-existent path.  All that
matters is that the before and after values have to match, and
that trailing whitespace is stripped.  On Windows FileSpec
(correctly) converts /bin/ls to D:\bin\ls though, so the before
and after values won't match.  So this patch just correctly builds
up a valid path in a platform-agnostic manner, and verifies that
it matches before and after the set.

Modified:
    lldb/trunk/test/settings/TestSettings.py

Modified: lldb/trunk/test/settings/TestSettings.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/settings/TestSettings.py?rev=226625&r1=226624&r2=226625&view=diff
==============================================================================
--- lldb/trunk/test/settings/TestSettings.py (original)
+++ lldb/trunk/test/settings/TestSettings.py Tue Jan 20 18:40:27 2015
@@ -373,10 +373,14 @@ class SettingsCommandTestCase(TestBase):
             startstr = 'target.arg0 (string) = "cde"')
         self.runCmd("settings clear target.arg0", check=False)
         # file
-        self.runCmd ("settings set target.output-path /bin/ls")   # Set to known value
-        self.runCmd ("settings set target.output-path /bin/cat ") # Set to new value with trailing whitespaces
+        path1 = os.path.join(os.getcwd(), "path1.txt")
+        path2 = os.path.join(os.getcwd(), "path2.txt")
+        self.runCmd ("settings set target.output-path %s" % path1)   # Set to known value
         self.expect ("settings show target.output-path", SETTING_MSG("target.output-path"),
-            startstr = 'target.output-path (file) = ', substrs=['/bin/cat"'])
+            startstr = 'target.output-path (file) = ', substrs=[path1])
+        self.runCmd ("settings set target.output-path %s " % path2) # Set to new value with trailing whitespaces
+        self.expect ("settings show target.output-path", SETTING_MSG("target.output-path"),
+            startstr = 'target.output-path (file) = ', substrs=[path2])
         self.runCmd("settings clear target.output-path", check=False)
         # enum
         self.runCmd ("settings set stop-disassembly-display never")   # Set to known value





More information about the lldb-commits mailing list