forked from OSchip/llvm-project
Remove the expectedFailure decorator for the fixed bug:
rdar://problem/8435794 settings set target.process.output-path does not seem to work Also change the test case from test_set_output_path to test_set_error_output_path as it now exercises both setting target.process.error-path and target.process.output-path. llvm-svn: 124198
This commit is contained in:
parent
85f240c788
commit
93b0c8b2aa
|
@ -16,6 +16,7 @@ class SettingsCommandTestCase(TestBase):
|
|||
"""Cleanup the test byproducts."""
|
||||
system(["/bin/sh", "-c", "rm -f output1.txt"])
|
||||
system(["/bin/sh", "-c", "rm -f output2.txt"])
|
||||
system(["/bin/sh", "-c", "rm -f stderr.txt"])
|
||||
system(["/bin/sh", "-c", "rm -f stdout.txt"])
|
||||
|
||||
def test_set_prompt(self):
|
||||
|
@ -140,22 +141,25 @@ class SettingsCommandTestCase(TestBase):
|
|||
substrs = ["The host environment variable 'MY_HOST_ENV_VAR1' successfully passed.",
|
||||
"The host environment variable 'MY_HOST_ENV_VAR2' successfully passed."])
|
||||
|
||||
@unittest2.expectedFailure
|
||||
# rdar://problem/8435794
|
||||
# settings set target.process.output-path does not seem to work
|
||||
def test_set_output_path(self):
|
||||
"""Test that setting target.process.output-path for the launched process works."""
|
||||
def test_set_error_output_path(self):
|
||||
"""Test that setting target.process.error/output-path for the launched process works."""
|
||||
self.buildDefault()
|
||||
|
||||
exe = os.path.join(os.getcwd(), "a.out")
|
||||
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
|
||||
|
||||
# Set the output-path and verify it is set.
|
||||
self.runCmd("settings set target.process.output-path 'stdout.txt'")
|
||||
# And add a hook to restore original setting of target.process.output-path
|
||||
# later on during tearDown().
|
||||
# Set the error-path and output-path and verify both are set.
|
||||
self.runCmd("settings set target.process.error-path stderr.txt")
|
||||
self.runCmd("settings set target.process.output-path stdout.txt")
|
||||
# And add hooks to restore the original settings during tearDown().
|
||||
self.addTearDownHook(
|
||||
lambda: self.runCmd("settings set -r target.process.output-path"))
|
||||
self.addTearDownHook(
|
||||
lambda: self.runCmd("settings set -r target.process.error-path"))
|
||||
|
||||
self.expect("settings show target.process.error-path",
|
||||
SETTING_MSG("target.process.error-path"),
|
||||
startstr = "target.process.error-path (string) = 'stderr.txt'")
|
||||
|
||||
self.expect("settings show target.process.output-path",
|
||||
SETTING_MSG("target.process.output-path"),
|
||||
|
@ -163,6 +167,17 @@ class SettingsCommandTestCase(TestBase):
|
|||
|
||||
self.runCmd("run", RUN_SUCCEEDED)
|
||||
|
||||
# The 'stderr.txt' file should now exist.
|
||||
self.assertTrue(os.path.isfile("stderr.txt"),
|
||||
"'stderr.txt' exists due to target.process.error-path.")
|
||||
|
||||
# Read the output file produced by running the program.
|
||||
with open('stderr.txt', 'r') as f:
|
||||
output = f.read()
|
||||
|
||||
self.expect(output, exe=False,
|
||||
startstr = "This message should go to standard error.")
|
||||
|
||||
# The 'stdout.txt' file should now exist.
|
||||
self.assertTrue(os.path.isfile("stdout.txt"),
|
||||
"'stdout.txt' exists due to target.process.output-path.")
|
||||
|
|
|
@ -62,6 +62,7 @@ main(int argc, char const *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
std::cerr << "This message should go to standard error.\n";
|
||||
std::cout << "This message should go to standard out.\n";
|
||||
|
||||
outfile.close();
|
||||
|
|
Loading…
Reference in New Issue