From 83887fb7dce2620e59027d66e02d6dee597424f6 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 21 Jan 2015 00:40:27 +0000 Subject: [PATCH] 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. llvm-svn: 226625 --- lldb/test/settings/TestSettings.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lldb/test/settings/TestSettings.py b/lldb/test/settings/TestSettings.py index 14054c1..27fa896 100644 --- a/lldb/test/settings/TestSettings.py +++ b/lldb/test/settings/TestSettings.py @@ -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 -- 2.7.4