[lldb/test] Fix wrong target command failure message on Windows
authorMed Ismail Bennani <medismail.bennani@gmail.com>
Mon, 4 May 2020 17:17:10 +0000 (19:17 +0200)
committerMed Ismail Bennani <medismail.bennani@gmail.com>
Mon, 4 May 2020 17:22:34 +0000 (19:22 +0200)
This patch fixes the test failure happening on Windows introduced by
`015117411e11458f9816ba4359246132164a4297`.

Since the failure message comes from the OS, the test needs to support both
UNIX and Windows messages.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
lldb/test/API/commands/target/basic/TestTargetCommand.py

index 8335753..2704e0e 100644 (file)
@@ -326,7 +326,7 @@ class targetCommandTestCase(TestBase):
     @no_debug_info_test
     def test_target_create_nonexistent_core_file(self):
         self.expect("target create -c doesntexist", error=True,
-                    substrs=["Cannot open 'doesntexist': No such file or directory"])
+                    patterns=["Cannot open 'doesntexist'", ": (No such file or directory|The system cannot find the file specified)"])
 
     # Write only files don't seem to be supported on Windows.
     @skipIfWindows
@@ -340,7 +340,7 @@ class targetCommandTestCase(TestBase):
     @no_debug_info_test
     def test_target_create_nonexistent_sym_file(self):
         self.expect("target create -s doesntexist doesntexisteither", error=True,
-                    substrs=["Cannot open '", "': No such file or directory"])
+                    patterns=["Cannot open '", ": (No such file or directory|The system cannot find the file specified)"])
 
     @skipIfWindows
     @no_debug_info_test