Wrap all references to build artifacts in the LLDB testsuite (NFC)

in TestBase::getBuildArtifact(). This NFC commit is in preparation for
https://reviews.llvm.org/D42281 (compile the LLDB tests out-of-tree).

Differential Revision: https://reviews.llvm.org/D42280

llvm-svn: 323007
diff --git a/lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py b/lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
index c038c07..5eff454 100644
--- a/lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
+++ b/lldb/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
@@ -19,7 +19,7 @@
     @skipUnlessPlatform(['android'])
     def test_cache_line_size(self):
         self.build(dictionary=self.getBuildFlags())
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target and target.IsValid(), "Target is valid")
 
diff --git a/lldb/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py b/lldb/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py
index dd6dbe0..e8c767b 100644
--- a/lldb/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py
+++ b/lldb/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py
@@ -20,7 +20,7 @@
     def setUp(self):
         TestBase.setUp(self)
         self.source = 'main.cpp'
-        self.exe_name = 'a.out'
+        self.exe_name = self.getBuildArtifact("a.out")
         self.generateSource(self.source)
 
     @skipIfNoSBHeaders
@@ -39,7 +39,7 @@
 
     def sanity_check_executable(self, exe_name):
         """Sanity check executable compiled from the auto-generated program."""
-        exe = os.path.join(os.getcwd(), exe_name)
+        exe = self.getBuildArtifact(exe_name)
         self.runCmd("file %s" % exe, CURRENT_EXECUTABLE_SET)
 
         self.line_to_break = line_number(
diff --git a/lldb/packages/Python/lldbsuite/test/api/listeners/TestListener.py b/lldb/packages/Python/lldbsuite/test/api/listeners/TestListener.py
index 65232f0..760a379 100644
--- a/lldb/packages/Python/lldbsuite/test/api/listeners/TestListener.py
+++ b/lldb/packages/Python/lldbsuite/test/api/listeners/TestListener.py
@@ -35,7 +35,7 @@
             lldb.SBTarget.GetBroadcasterClassName(),
             lldb.SBTarget.eBroadcastBitBreakpointChanged)
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
 
diff --git a/lldb/packages/Python/lldbsuite/test/arm/breakpoint-it/TestBreakpointIt.py b/lldb/packages/Python/lldbsuite/test/arm/breakpoint-it/TestBreakpointIt.py
index 1abab39..3051063 100644
--- a/lldb/packages/Python/lldbsuite/test/arm/breakpoint-it/TestBreakpointIt.py
+++ b/lldb/packages/Python/lldbsuite/test/arm/breakpoint-it/TestBreakpointIt.py
@@ -21,7 +21,7 @@
     @skipIf(archs=no_match(["arm"]))
     def test_false(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         self.runCmd("target create %s" % exe)
         lldbutil.run_break_set_by_symbol(self, "bkpt_false",
@@ -34,7 +34,7 @@
     @skipIf(archs=no_match(["arm"]))
     def test_true(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         self.runCmd("target create %s" % exe)
         bpid = lldbutil.run_break_set_by_symbol(self, "bkpt_true",
diff --git a/lldb/packages/Python/lldbsuite/test/benchmarks/continue/TestBenchmarkContinue.py b/lldb/packages/Python/lldbsuite/test/benchmarks/continue/TestBenchmarkContinue.py
index 7433669..acc0922 100644
--- a/lldb/packages/Python/lldbsuite/test/benchmarks/continue/TestBenchmarkContinue.py
+++ b/lldb/packages/Python/lldbsuite/test/benchmarks/continue/TestBenchmarkContinue.py
@@ -30,7 +30,8 @@
 
     def data_formatter_commands(self):
         """Benchmark different ways to continue a process"""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file "+self.getBuildArtifact("a.out"),
+                    CURRENT_EXECUTABLE_SET)
 
         bkpt = self.target().FindBreakpointByID(
             lldbutil.run_break_set_by_source_regexp(
diff --git a/lldb/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py b/lldb/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py
index a9899d9..064e7b3 100644
--- a/lldb/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py
+++ b/lldb/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py
@@ -39,7 +39,7 @@
 
     def run_lldb_repeated_exprs(self, exe_name, count):
         import pexpect
-        exe = os.path.join(os.getcwd(), exe_name)
+        exe = self.getBuildArtifact(exe_name)
 
         # Set self.child_prompt, which is "(lldb) ".
         self.child_prompt = '(lldb) '
diff --git a/lldb/packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py b/lldb/packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py
index a223d2c..ebc128b 100644
--- a/lldb/packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py
+++ b/lldb/packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py
@@ -44,7 +44,7 @@
 
     def run_lldb_repeated_exprs(self, exe_name, count):
         import pexpect
-        exe = os.path.join(os.getcwd(), exe_name)
+        exe = self.getBuildArtifact(exe_name)
 
         # Set self.child_prompt, which is "(lldb) ".
         self.child_prompt = '(lldb) '
diff --git a/lldb/packages/Python/lldbsuite/test/benchmarks/libcxxlist/TestBenchmarkLibcxxList.py b/lldb/packages/Python/lldbsuite/test/benchmarks/libcxxlist/TestBenchmarkLibcxxList.py
index 659382e..4ebb111 100644
--- a/lldb/packages/Python/lldbsuite/test/benchmarks/libcxxlist/TestBenchmarkLibcxxList.py
+++ b/lldb/packages/Python/lldbsuite/test/benchmarks/libcxxlist/TestBenchmarkLibcxxList.py
@@ -30,7 +30,8 @@
 
     def data_formatter_commands(self):
         """Benchmark the std::list data formatter (libc++)"""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"),
+                    CURRENT_EXECUTABLE_SET)
 
         bkpt = self.target().FindBreakpointByID(
             lldbutil.run_break_set_by_source_regexp(
diff --git a/lldb/packages/Python/lldbsuite/test/benchmarks/libcxxmap/TestBenchmarkLibcxxMap.py b/lldb/packages/Python/lldbsuite/test/benchmarks/libcxxmap/TestBenchmarkLibcxxMap.py
index 343f93d..0c50661 100644
--- a/lldb/packages/Python/lldbsuite/test/benchmarks/libcxxmap/TestBenchmarkLibcxxMap.py
+++ b/lldb/packages/Python/lldbsuite/test/benchmarks/libcxxmap/TestBenchmarkLibcxxMap.py
@@ -30,7 +30,8 @@
 
     def data_formatter_commands(self):
         """Benchmark the std::map data formatter (libc++)"""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " +self.getBuildArtifact("a.out"),
+                    CURRENT_EXECUTABLE_SET)
 
         bkpt = self.target().FindBreakpointByID(
             lldbutil.run_break_set_by_source_regexp(
diff --git a/lldb/packages/Python/lldbsuite/test/concurrent_base.py b/lldb/packages/Python/lldbsuite/test/concurrent_base.py
index 4a7ae0b..e9ccd09 100644
--- a/lldb/packages/Python/lldbsuite/test/concurrent_base.py
+++ b/lldb/packages/Python/lldbsuite/test/concurrent_base.py
@@ -114,7 +114,7 @@
             watchpoint_func. The inferior is continued until exit or a crash takes place, and the number of events seen by LLDB
             is verified to match the expected number of events.
         """
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Get the target
diff --git a/lldb/packages/Python/lldbsuite/test/darwin_log.py b/lldb/packages/Python/lldbsuite/test/darwin_log.py
index 3207ef0..9395bbd 100644
--- a/lldb/packages/Python/lldbsuite/test/darwin_log.py
+++ b/lldb/packages/Python/lldbsuite/test/darwin_log.py
@@ -346,7 +346,7 @@
         self.build(dictionary=self.d)
         self.setTearDownCleanup(dictionary=self.d)
 
-        exe = os.path.join(os.getcwd(), self.exe_name)
+        exe = self.getBuildArtifact(self.exe_name)
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py b/lldb/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py
index 8699b31..f2dc528 100644
--- a/lldb/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py
+++ b/lldb/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py
@@ -46,7 +46,7 @@
         self.setTearDownCleanup()
 
         import pexpect
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         prompt = "(lldb) "
 
         # Pass CRASH so the process will crash and stop in batch mode.
@@ -86,7 +86,7 @@
         self.setTearDownCleanup()
 
         import pexpect
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         prompt = "(lldb) "
 
         # Now do it again, and make sure if we don't crash, we quit:
@@ -129,7 +129,7 @@
         self.setTearDownCleanup()
 
         import pexpect
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         prompt = "(lldb) "
 
         # Finally, start up the process by hand, attach to it, and wait for its completion.
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/anonymous-struct/TestCallUserAnonTypedef.py b/lldb/packages/Python/lldbsuite/test/expression_command/anonymous-struct/TestCallUserAnonTypedef.py
index 2d4504f..6a8fb5d 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/anonymous-struct/TestCallUserAnonTypedef.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/anonymous-struct/TestCallUserAnonTypedef.py
@@ -32,7 +32,8 @@
         """Test typedeffed untagged struct arguments for function call expressions"""
         self.build()
 
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file "+self.getBuildArtifact("a.out"),
+                    CURRENT_EXECUTABLE_SET)
         lldbutil.run_break_set_by_file_and_line(
             self,
             "main.cpp",
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py b/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
index 16736f7..079ab6d 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
@@ -30,7 +30,8 @@
     def test_with(self):
         """Test calling std::String member function."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"),
+                    CURRENT_EXECUTABLE_SET)
 
         # Some versions of GCC encode two locations for the 'return' statement
         # in main.cpp
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py b/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
index a48a38a..6351177 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
@@ -31,7 +31,7 @@
     def test(self):
         """Test gathering result from interrupted function call."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         # Some versions of GCC encode two locations for the 'return' statement
         # in main.cpp
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py b/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
index fda81ae..ff3bd99 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
@@ -37,7 +37,7 @@
         self.build()
 
         # Set breakpoint in main and run exe
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=-1, loc_exact=True)
 
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py b/lldb/packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py
index dcfb648..dd31424 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py
@@ -22,7 +22,7 @@
         self.expr_syscall()
 
     def expr_syscall(self):
-        exe = os.path.join(os.getcwd(), 'a.out')
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py b/lldb/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py
index c4126a3..f14b02b 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py
@@ -43,7 +43,7 @@
         self.addTearDownHook(cleanup)
 
         """Test expr + formatters for good interoperability."""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/TestIRInterpreterPHINodes.py b/lldb/packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/TestIRInterpreterPHINodes.py
index 894d0bf..a5607f1 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/TestIRInterpreterPHINodes.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/TestIRInterpreterPHINodes.py
@@ -17,7 +17,7 @@
         """Test support for PHI nodes in the IR interpreter."""
 
         self.build()
-        exe = os.path.join(os.getcwd(), 'a.out')
+        exe = self.getBuildArtifact("a.out")
         self.runCmd('file ' + exe, CURRENT_EXECUTABLE_SET)
 
         # Break on the first assignment to i
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py b/lldb/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py
index 5c5110b..c0f5010 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py
@@ -34,7 +34,7 @@
         """Test the IR interpreter"""
         self.build()
 
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.c", self.line, num_expected_locations=1, loc_exact=False)
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/multiline/TestMultilineExpressions.py b/lldb/packages/Python/lldbsuite/test/expression_command/multiline/TestMultilineExpressions.py
index aa369eb..7f639a4 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/multiline/TestMultilineExpressions.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/multiline/TestMultilineExpressions.py
@@ -28,7 +28,7 @@
         """Test that multiline expressions work correctly"""
         self.build()
         import pexpect
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         prompt = "(lldb) "
 
         # So that the child gets torn down after the test.
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py b/lldb/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py
index b4e9a8b..1dbafc3 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py
@@ -28,7 +28,7 @@
         self.main_source = "main.cpp"
         self.main_source_spec = lldb.SBFileSpec(self.main_source)
         self.line = line_number('main.cpp', '// breakpoint_in_main')
-        self.exe = os.path.join(os.getcwd(), "a.out")
+        self.exe = self.getBuildArtifact("a.out")
 
     def test_expr_options(self):
         """These expression command options should work as expected."""
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py b/lldb/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py
index e6c9d43..b6471d0 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py
@@ -34,7 +34,7 @@
         # Execute the cleanup function during test case tear down.
         self.addTearDownHook(cleanup)
 
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.m", self.line, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py b/lldb/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py
index 118b9f3..7b963b5 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py
@@ -28,7 +28,7 @@
         # Execute the cleanup function during test case tear down.
         self.addTearDownHook(cleanup)
 
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         self.runCmd('break set -p here')
 
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py b/lldb/packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py
index 12452a9..f4ee1b0 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py
@@ -22,7 +22,7 @@
         """Test that nested persistent types work."""
         self.build()
 
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         self.runCmd("breakpoint set --name main")
 
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py b/lldb/packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py
index 3d4df30..f56cb11 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py
@@ -22,7 +22,7 @@
         """Test that lldb persistent types works correctly."""
         self.build()
 
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         self.runCmd("breakpoint set --name main")
 
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/persistent_variables/TestPersistentVariables.py b/lldb/packages/Python/lldbsuite/test/expression_command/persistent_variables/TestPersistentVariables.py
index b6f0279..441a60b 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/persistent_variables/TestPersistentVariables.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/persistent_variables/TestPersistentVariables.py
@@ -19,7 +19,7 @@
         """Test that lldb persistent variables works correctly."""
         self.build()
 
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         self.runCmd("breakpoint set --source-pattern-regexp break")
 
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py b/lldb/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py
index 13f8f58..4530342 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py
@@ -37,7 +37,7 @@
         self.addTearDownHook(cleanup)
 
         """Test expr + formatters for good interoperability."""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.m", self.line, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/radar_8638051/Test8638051.py b/lldb/packages/Python/lldbsuite/test/expression_command/radar_8638051/Test8638051.py
index ca43585..0027fc2 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/radar_8638051/Test8638051.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/radar_8638051/Test8638051.py
@@ -19,7 +19,7 @@
         """The following expression commands should not crash."""
         self.build()
 
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         self.runCmd("breakpoint set -n c")
 
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py b/lldb/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py
index c4d899c..c44cb6f 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py
@@ -23,7 +23,7 @@
         """The evaluating printf(...) after break stop and then up a stack frame."""
         self.build()
 
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_symbol(
             self, 'foo', sym_exact=True, num_expected_locations=1)
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py b/lldb/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py
index 4fc2463..dfef873 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py
@@ -29,7 +29,7 @@
         """The following expression commands should just work."""
         self.build()
 
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self,
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py b/lldb/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py
index 1cd11a8..3af7d80 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py
@@ -45,7 +45,7 @@
         """These basic expression commands should work as expected."""
         self.build()
 
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=False)
@@ -107,7 +107,7 @@
         """Test SBFrame.EvaluateExpression() API for evaluating an expression."""
         self.build()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -208,7 +208,7 @@
         """Throw some expression commands with quotes at lldb."""
         self.build()
 
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=False)
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py b/lldb/packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py
index 35ac151..8a949bc 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py
@@ -31,7 +31,7 @@
         """Test some more expression commands."""
         self.build()
 
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=False)
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py b/lldb/packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py
index dfe95a1..590e2cf 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py
@@ -37,7 +37,7 @@
         """Test top-level expressions."""
         self.build()
 
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=False)
diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py b/lldb/packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
index 1ce7514..bac8e54 100644
--- a/lldb/packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
+++ b/lldb/packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
@@ -28,7 +28,7 @@
     def test(self):
         """The expression parser's type search should be wider than the current compilation unit."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/apropos_with_process/TestAproposWithProcess.py b/lldb/packages/Python/lldbsuite/test/functionalities/apropos_with_process/TestAproposWithProcess.py
index aecbab1..fdafbcc 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/apropos_with_process/TestAproposWithProcess.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/apropos_with_process/TestAproposWithProcess.py
@@ -26,7 +26,7 @@
     def test_apropos_with_process(self):
         """Test that apropos env doesn't crash trying to touch the process plugin commmand."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break in main() aftre the variables are assigned values.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/archives/TestBSDArchives.py b/lldb/packages/Python/lldbsuite/test/functionalities/archives/TestBSDArchives.py
index f825eaa..a0c0968 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/archives/TestBSDArchives.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/archives/TestBSDArchives.py
@@ -35,7 +35,7 @@
         """Break inside a() and b() defined within libfoo.a."""
         self.build()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside a() by file and line first.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py b/lldb/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
index 7bddc0c..5827dc3 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
@@ -37,7 +37,7 @@
         self.line_breakpoint = line_number('main.c', '// break line')
 
     def asan_tests(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.expect(
             "file " + exe,
             patterns=["Current executable set to .*a.out"])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py b/lldb/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
index 0943d99ee..53f5ab9 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
@@ -39,7 +39,7 @@
         self.line_crash = line_number('main.c', '// BOOM line')
 
     def asan_tests(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.expect(
             "file " + exe,
             patterns=["Current executable set to .*a.out"])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py b/lldb/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py
index a4e3948..38848e8 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py
@@ -52,7 +52,7 @@
 
     def do_test(self, commands):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         for c in commands:
             self.runCmd(c)
@@ -81,7 +81,7 @@
     @skipIfDarwinEmbedded # <rdar://problem/33888742>  # debugserver on ios has an extra fd open on launch
     def test_fd_leak_multitarget(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         breakpoint = target.BreakpointCreateBySourceRegex(
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
index 9b116a0..46191d8 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
@@ -30,7 +30,7 @@
 
     def address_breakpoints(self):
         """Test address breakpoints set with shared library of SBAddress work correctly."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
index 9630e39..0123e73 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
@@ -36,7 +36,7 @@
 
     def make_target_and_bkpt(self, additional_options=None, num_expected_loc=1, 
                              pattern="Set a breakpoint here"):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.target = self.dbg.CreateTarget(exe)
         self.assertTrue(self.target.IsValid(), "Target is not valid")
         
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
index 88ccc46..97611a2 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
@@ -39,7 +39,7 @@
         if case_insensitive:
             exe = exe.upper()
 
-        exe = os.path.join(os.getcwd(), exe)
+        exe = self.getBuildArtifact(exe)
 
         # Create a target by the debugger.
         self.target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
index 386eafb..3b29548 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
@@ -51,7 +51,7 @@
 
     def breakpoint_command_sequence(self):
         """Test a sequence of breakpoint command add, list, and delete."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add three breakpoints on the same line.  The first time we don't specify the file,
@@ -237,7 +237,7 @@
 
     def breakpoint_command_script_parameters(self):
         """Test that the frame and breakpoint location are being properly passed to the script breakpoint command function."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint.
@@ -280,7 +280,7 @@
 
     def breakpoint_commands_on_creation(self):
         """Test that setting breakpoint commands when creating the breakpoint works"""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target.IsValid(), "Created an invalid target.")
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py
index 01af836..1fc3269 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py
@@ -31,7 +31,7 @@
         self.main_source_spec = lldb.SBFileSpec(self.main_source)
 
     def do_set_python_command_from_python(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         error = lldb.SBError()
 
         self.target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py
index baf237b..059c923 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py
@@ -31,7 +31,7 @@
 
     def regexp_break_command(self):
         """Test the super consie "b" command, which is analias for _regexp-break."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         break_results = lldbutil.run_break_set_command(
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
index 3fd9b13..959c7e8 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
@@ -59,7 +59,7 @@
 
     def breakpoint_conditions(self, inline=False):
         """Exercise breakpoint condition with 'breakpoint modify -c <expr> id'."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         if inline:
@@ -132,7 +132,7 @@
 
     def breakpoint_conditions_python(self):
         """Use Python APIs to set breakpoint conditions."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
@@ -200,7 +200,7 @@
 
     def breakpoint_invalid_conditions_python(self):
         """Use Python APIs to set breakpoint conditions."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
index 5d7b6f9..e1281e6 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
@@ -32,7 +32,7 @@
 
     def do_test_breakpoint_location_hit_count(self):
         """Use Python APIs to check breakpoint hit count."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py
index 621bd4a..02fb1e0 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py
@@ -19,7 +19,7 @@
     def test(self):
         self.build()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.expect("file " + exe,
                     patterns=["Current executable set to .*a.out"])
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
index 09e20bc..eb4bac7 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
@@ -46,7 +46,7 @@
 
     def breakpoint_ignore_count(self):
         """Exercise breakpoint ignore count with 'breakpoint set -i <count>'."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Create a breakpoint in main.c at line1.
@@ -101,7 +101,7 @@
 
     def breakpoint_ignore_count_python(self):
         """Use Python APIs to set breakpoint ignore count."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
index 255b6f7..6eaab0c 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
@@ -21,7 +21,7 @@
     @skipIf(archs=no_match(re.compile('mips*')))
     def test(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.expect("file " + exe,
                     patterns=["Current executable set to .*a.out.*"])
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_language/TestBreakpointLanguage.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_language/TestBreakpointLanguage.py
index 214c110..b690070 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_language/TestBreakpointLanguage.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_language/TestBreakpointLanguage.py
@@ -36,7 +36,7 @@
 
         self.build()
         # Create a target by the debugger.
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         error = lldb.SBError()
         # Don't read in dependencies so we don't come across false matches that
         # add unwanted breakpoint hits.
@@ -77,7 +77,7 @@
 
         self.build()
         # Create a target by the debugger.
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         error = lldb.SBError()
         # Don't read in dependencies so we don't come across false matches that
         # add unwanted breakpoint hits.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
index de24d8b..7eb465f 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
@@ -41,7 +41,7 @@
         self.line = line_number('main.c', '// Set break point at this line.')
 
     def set_breakpoint (self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, "Target %s is not valid"%(exe))
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py
index b95d2ce..8130679 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py
@@ -58,7 +58,7 @@
         self.do_check_configuring_permissions_cli()
 
     def setup_target(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a targets we are making breakpoint in and copying to:
         self.target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py
index 871363b..c9ef2a7 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py
@@ -28,7 +28,7 @@
 
     def breakpoint_options_test(self):
         """Test breakpoint command for different options."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # This should create a breakpoint with 1 locations.
@@ -78,7 +78,7 @@
 
     def breakpoint_options_language_test(self):
         """Test breakpoint command for language option."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # This should create a breakpoint with 1 locations.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
index 2410f2e..958a17d 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
@@ -16,7 +16,7 @@
         self.build()
 
         cwd = os.getcwd()
-        exe = os.path.join(cwd, 'a.out')
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
index adec9fa..e4c19fd 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
@@ -45,7 +45,7 @@
     def breakpoint_id_tests(self):
 
         # Create a target by the debugger.
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
         bp_dicts = [
@@ -69,7 +69,7 @@
     @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")
     def test_destructors(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
 
         # Don't skip prologue, so we can check the breakpoint address more
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py
index 3019e1c..26fe02b 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py
@@ -32,7 +32,7 @@
         self.main_source_spec = lldb.SBFileSpec(self.main_source)
 
     def do_cpp_exception_bkpt(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         error = lldb.SBError()
 
         self.target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py
index d044827..11ec67d 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py
@@ -20,7 +20,7 @@
     def test_asm_int_3(self):
         """Test that intrinsics like `__debugbreak();` and `asm {"int3"}` are treated like breakpoints."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Run the program.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py
index a934ad3..4b595ab 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py
@@ -46,7 +46,7 @@
         # Execute the cleanup function during test case tear down.
         self.addTearDownHook(cleanup)
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # The breakpoint list should show 3 locations.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
index 236912b..5f0e7a0 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
@@ -22,7 +22,7 @@
         self.line_foo = line_number('foo.cpp', '// !BR_foo')
         self.line_main = line_number('main.cpp', '// !BR_main')
 
-        target = self.dbg.CreateTarget("a.out")
+        target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
         self.assertTrue(target, VALID_TARGET)
 
         env= self.registerSharedLibrariesWithTarget(target, ["foo"])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py
index 21fe084..69dfac2 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py
@@ -47,12 +47,8 @@
 
     def break_multi_thread(self, removal_type):
         """Test that lldb hardware breakpoints work for multiple threads."""
-        self.runCmd(
-            "file %s" %
-            os.path.join(
-                os.getcwd(),
-                'a.out'),
-            CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"),
+                    CURRENT_EXECUTABLE_SET)
 
         # Stop in main before creating any threads.
         lldbutil.run_break_set_by_file_and_line(
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py
index fe8f430..ee67dda 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py
@@ -33,7 +33,7 @@
 
     def inlined_breakpoints(self):
         """Test 'b basic_types.cpp:176' does break (where int.cpp includes basic_type.cpp)."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # With the inline-breakpoint-strategy, our file+line breakpoint should
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/TestMoveNearest.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/TestMoveNearest.py
index 26041c3..16d5bc7 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/TestMoveNearest.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/TestMoveNearest.py
@@ -24,7 +24,7 @@
         """Test target.move-to-nearest logic"""
 
         self.build()
-        target = self.dbg.CreateTarget("a.out")
+        target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
         self.assertTrue(target, VALID_TARGET)
 
         lldbutil.run_break_set_by_symbol(self, 'main', sym_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
index f43bbb7..7992067 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
@@ -73,7 +73,7 @@
         self.dbg.SetAsync(False)
 
         # Create a target by the debugger.
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.target = self.dbg.CreateTarget(exe)
         self.assertTrue(self.target, VALID_TARGET)
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py
index 6f93994..34ce886 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py
@@ -60,7 +60,7 @@
         self.addTearDownHook(cleanup)
         self.RemoveTempFile(self.bkpts_file_path)
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create the targets we are making breakpoints in and copying them to:
         self.orig_target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/TestSourceRegexBreakpoints.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/TestSourceRegexBreakpoints.py
index 791cc70..4256c70 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/TestSourceRegexBreakpoints.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/TestSourceRegexBreakpoints.py
@@ -28,7 +28,7 @@
     def source_regex_locations(self):
         """ Test that restricting source expressions to files & to functions. """
         # Create a target by the debugger.
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
 
@@ -64,7 +64,7 @@
     def source_regex_restrictions(self):
         """ Test that restricting source expressions to files & to functions. """
         # Create a target by the debugger.
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
index 4dfeae3..c208429 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
@@ -21,7 +21,7 @@
         TestBase.setUp(self)
        
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         src = lldb.SBFileSpec("main.cpp")
 
         # Create a target by the debugger.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/command_script/TestCommandScript.py b/lldb/packages/Python/lldbsuite/test/functionalities/command_script/TestCommandScript.py
index d562cb1..e243b55 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/command_script/TestCommandScript.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/command_script/TestCommandScript.py
@@ -27,7 +27,7 @@
         self.expect('targetname',
                     substrs=['a.out'], matching=False, error=True)
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.expect("file " + exe,
                     patterns=["Current executable set to .*a.out"])
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py b/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
index 9f55f64..0e78441 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
@@ -303,8 +303,9 @@
         bugnumber="llvm.org/pr25485,<rdar://problem/28573448>")
     def test_symbol_name(self):
         self.build()
-        self.complete_from_to('''file a.out
-                                 breakpoint set -n Fo''',
+        self.complete_from_to('''file %s
+                                 breakpoint set -n Fo''' %
+                              self.getBuildArtifact("a.out"),
                               'breakpoint set -n Foo::Bar(int,\\ int)',
                               turn_off_re_match=True)
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py b/lldb/packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py
index cec06e4..904fb4c 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py
@@ -39,7 +39,7 @@
         bugnumber="llvm.org/pr26265: args in frames other than #0 are not evaluated correctly")
     def do_conditional_break(self):
         """Exercise some thread and frame APIs to break if c() is called by a()."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -112,9 +112,9 @@
         if not self.TraceOn():
             self.HideStdout()
 
-        # Separate out the "file a.out" command from .lldb file, for the sake of
+        # Separate out the "file " + self.getBuildArtifact("a.out") command from .lldb file, for the sake of
         # remote testsuite.
-        self.runCmd("file a.out")
+        self.runCmd("file " + self.getBuildArtifact("a.out"))
         self.runCmd("command source .lldb")
 
         self.runCmd("break list")
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity-chain/TestDarwinLogFilterMatchActivityChain.py b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity-chain/TestDarwinLogFilterMatchActivityChain.py
index f8ce069..c8f93c1 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity-chain/TestDarwinLogFilterMatchActivityChain.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity-chain/TestDarwinLogFilterMatchActivityChain.py
@@ -29,7 +29,7 @@
         self.source = 'main.c'
 
         # Output filename.
-        self.exe_name = 'a.out'
+        self.exe_name = self.getBuildArtifact("a.out")
         self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
 
         # Locate breakpoint.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity/TestDarwinLogFilterMatchActivity.py b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity/TestDarwinLogFilterMatchActivity.py
index 12a4302..32b2623 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity/TestDarwinLogFilterMatchActivity.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity/TestDarwinLogFilterMatchActivity.py
@@ -29,7 +29,7 @@
         self.source = 'main.c'
 
         # Output filename.
-        self.exe_name = 'a.out'
+        self.exe_name = self.getBuildArtifact("a.out")
         self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
 
         # Locate breakpoint.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/category/TestDarwinLogFilterMatchCategory.py b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/category/TestDarwinLogFilterMatchCategory.py
index 8ce4d41..088d103 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/category/TestDarwinLogFilterMatchCategory.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/category/TestDarwinLogFilterMatchCategory.py
@@ -29,7 +29,7 @@
         self.source = 'main.c'
 
         # Output filename.
-        self.exe_name = 'a.out'
+        self.exe_name = self.getBuildArtifact("a.out")
         self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
 
         # Locate breakpoint.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/message/TestDarwinLogFilterMatchMessage.py b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/message/TestDarwinLogFilterMatchMessage.py
index b7664dd..5a377f9 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/message/TestDarwinLogFilterMatchMessage.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/message/TestDarwinLogFilterMatchMessage.py
@@ -29,7 +29,7 @@
         self.source = 'main.c'
 
         # Output filename.
-        self.exe_name = 'a.out'
+        self.exe_name = self.getBuildArtifact("a.out")
         self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
 
         # Locate breakpoint.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/subsystem/TestDarwinLogFilterMatchSubsystem.py b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/subsystem/TestDarwinLogFilterMatchSubsystem.py
index 5afe649..f3d4d4d 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/subsystem/TestDarwinLogFilterMatchSubsystem.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/subsystem/TestDarwinLogFilterMatchSubsystem.py
@@ -29,7 +29,7 @@
         self.source = 'main.c'
 
         # Output filename.
-        self.exe_name = 'a.out'
+        self.exe_name = self.getBuildArtifact("a.out")
         self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
 
         # Locate breakpoint.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity-chain/TestDarwinLogFilterRegexActivityChain.py b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity-chain/TestDarwinLogFilterRegexActivityChain.py
index 74be57a..16d678a 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity-chain/TestDarwinLogFilterRegexActivityChain.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity-chain/TestDarwinLogFilterRegexActivityChain.py
@@ -29,7 +29,7 @@
         self.source = 'main.c'
 
         # Output filename.
-        self.exe_name = 'a.out'
+        self.exe_name = self.getBuildArtifact("a.out")
         self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
 
         # Locate breakpoint.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity/TestDarwinLogFilterRegexActivity.py b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity/TestDarwinLogFilterRegexActivity.py
index 55f0154..e017d56 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity/TestDarwinLogFilterRegexActivity.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity/TestDarwinLogFilterRegexActivity.py
@@ -29,7 +29,7 @@
         self.source = 'main.c'
 
         # Output filename.
-        self.exe_name = 'a.out'
+        self.exe_name = self.getBuildArtifact("a.out")
         self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
 
         # Locate breakpoint.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/category/TestDarwinLogFilterRegexCategory.py b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/category/TestDarwinLogFilterRegexCategory.py
index 6786d6f..5a618b1 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/category/TestDarwinLogFilterRegexCategory.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/category/TestDarwinLogFilterRegexCategory.py
@@ -29,7 +29,7 @@
         self.source = 'main.c'
 
         # Output filename.
-        self.exe_name = 'a.out'
+        self.exe_name = self.getBuildArtifact("a.out")
         self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
 
         # Locate breakpoint.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/subsystem/TestDarwinLogFilterRegexSubsystem.py b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/subsystem/TestDarwinLogFilterRegexSubsystem.py
index 28677b5..679db2e 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/subsystem/TestDarwinLogFilterRegexSubsystem.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/subsystem/TestDarwinLogFilterRegexSubsystem.py
@@ -29,7 +29,7 @@
         self.source = 'main.c'
 
         # Output filename.
-        self.exe_name = 'a.out'
+        self.exe_name = self.getBuildArtifact("a.out")
         self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
 
         # Locate breakpoint.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/format/TestDarwinLogMessageFormat.py b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/format/TestDarwinLogMessageFormat.py
index 65822ca..8c9e287 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/format/TestDarwinLogMessageFormat.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/format/TestDarwinLogMessageFormat.py
@@ -28,7 +28,7 @@
         self.source = 'main.c'
 
         # Output filename.
-        self.exe_name = 'a.out'
+        self.exe_name = self.getBuildArtifact("a.out")
         self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
 
         # Locate breakpoint.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/source/debug/TestDarwinLogSourceDebug.py b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/source/debug/TestDarwinLogSourceDebug.py
index 85b8e30..8979109 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/source/debug/TestDarwinLogSourceDebug.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/source/debug/TestDarwinLogSourceDebug.py
@@ -29,7 +29,7 @@
         self.source = 'main.c'
 
         # Output filename.
-        self.exe_name = 'a.out'
+        self.exe_name = self.getBuildArtifact("a.out")
         self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
 
         # Locate breakpoint.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/source/info/TestDarwinLogSourceInfo.py b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/source/info/TestDarwinLogSourceInfo.py
index 4434837..865eea2 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/source/info/TestDarwinLogSourceInfo.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/darwin_log/source/info/TestDarwinLogSourceInfo.py
@@ -29,7 +29,7 @@
         self.source = 'main.c'
 
         # Output filename.
-        self.exe_name = 'a.out'
+        self.exe_name = self.getBuildArtifact("a.out")
         self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
 
         # Locate breakpoint.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py
index 410da70..18aac23 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py
@@ -32,7 +32,7 @@
 
     def boolrefptr_data_formatter_commands(self):
         """Test the formatters we use for BOOL& and BOOL* in Objective-C."""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
index 9b430c7..891448f 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
@@ -27,7 +27,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
index 050f523..6d8a794 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
@@ -25,7 +25,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
index 2d01eb7..4e61b74 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
@@ -26,7 +26,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
index 0518a75..60767a7 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
@@ -29,7 +29,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
index e192943..c451d0f 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
@@ -29,7 +29,7 @@
     def test_with_run_command(self):
         """Check that we can properly disable all data formatter categories."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py
index 710cfa8..2d09be5 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py
@@ -25,7 +25,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
index d3d93da..d9fa44b 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
@@ -25,7 +25,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
index f4f0a48..8b354d7 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
@@ -25,7 +25,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
index bc39d8d..17d3c1d 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
@@ -96,7 +96,7 @@
 
     def plain_data_formatter_commands(self):
         """Test basic ObjC formatting behavior."""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
@@ -162,7 +162,7 @@
 
     def appkit_common_data_formatters_command(self):
         """Test formatters for AppKit classes."""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
@@ -360,7 +360,7 @@
 
     def expr_objc_data_formatter_commands(self):
         """Test common cases of expression parser <--> formatters interaction."""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
@@ -408,7 +408,7 @@
 
     def cf_data_formatter_commands(self):
         """Test formatters for Core OSX frameworks."""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
@@ -463,7 +463,7 @@
 
     def kvo_data_formatter_commands(self):
         """Test the behavior of formatters when KVO is in use."""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py
index 750e294..605b543 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py
@@ -21,7 +21,7 @@
 
     def appkit_tester_impl(self, commands):
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
index 12e62f6..41a6def 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
@@ -21,7 +21,7 @@
 
     def appkit_tester_impl(self, commands):
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
index bf60021..2c50411 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
@@ -32,7 +32,7 @@
 
     def oneness_data_formatter_commands(self):
         """Test that 1 item is not as reported as 1 items."""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py
index ebabe30..397a461 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py
@@ -29,7 +29,7 @@
 
     def data_formatter_commands(self):
         """Test that LLDB handles the clang typeclass Paren correctly."""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
index 75d1853..cc4cfd2 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
@@ -40,7 +40,7 @@
 
     def data_formatter_commands(self):
         """Test using Python synthetic children provider."""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
@@ -222,7 +222,7 @@
 
     def rdar10960550_formatter_commands(self):
         """Test that synthetic children persist stoppoints."""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         # The second breakpoint is on a multi-line expression, so the comment
         # can't be on the right line...
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
index 3355ca1..1dd1912 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
@@ -29,7 +29,7 @@
 
     def data_formatter_commands(self):
         """Test that that file and class static variables display correctly."""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
index b0b45cb..4ec7f13 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
@@ -36,7 +36,7 @@
 
     def data_formatter_commands(self):
         """Test that that file and class static variables display correctly."""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         #import lldbsuite.test.lldbutil as lldbutil
         lldbutil.run_break_set_by_file_and_line(
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
index 9e82f11..13b38cb 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
@@ -33,7 +33,7 @@
 
     def data_formatter_commands(self):
         """Test that that file and class static variables display correctly."""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py
index 8d41324..1f7a175 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py
@@ -28,7 +28,7 @@
     def test(self):
         """Test that std::atomic as defined by libc++ is correctly printed by LLDB"""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         bkpt = self.target().FindBreakpointByID(
             lldbutil.run_break_set_by_source_regexp(
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py
index 63eb5e0..81a76cc 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py
@@ -27,7 +27,7 @@
     def test(self):
         """Test that std::function as defined by libc++ is correctly printed by LLDB"""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         bkpt = self.target().FindBreakpointByID(
             lldbutil.run_break_set_by_source_regexp(
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
index f0857f4..9c9b247 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
@@ -25,7 +25,7 @@
     def test(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         bkpt = self.target().FindBreakpointByID(
             lldbutil.run_break_set_by_source_regexp(
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
index 9b4308f..b36fa6e 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
@@ -29,7 +29,7 @@
     def test_with_run_command(self):
         """Test that libc++ iterators format properly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=-1)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
index bb20b0e..3f5ec43 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
@@ -34,7 +34,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=-1)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
index e1ebbd5..3056dcf 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
@@ -24,7 +24,7 @@
     @skipIfDarwin  # rdar://25499635
     def test_with_run_command(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target and target.IsValid(), "Target is valid")
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
index fc4714e..0f57f0a 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
@@ -26,7 +26,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         bkpt = self.target().FindBreakpointByID(
             lldbutil.run_break_set_by_source_regexp(
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
index b28a7e6..cbcce47 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
@@ -27,7 +27,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         bkpt = self.target().FindBreakpointByID(
             lldbutil.run_break_set_by_source_regexp(
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
index 2f448e8..9ebbf16 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
@@ -31,7 +31,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         bkpt = self.target().FindBreakpointByID(
             lldbutil.run_break_set_by_source_regexp(
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
index ca89281..64e718b 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
@@ -31,7 +31,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         bkpt = self.target().FindBreakpointByID(
             lldbutil.run_break_set_by_source_regexp(self, "Set break point at this line."))
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
index 5b9b14d..d49b65b 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
@@ -30,7 +30,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=-1)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
index f61a715..4c60e40 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
@@ -25,7 +25,7 @@
     @add_test_categories(["libc++"])
     def test_with_run_command(self):
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_source_regexp(
             self, "Set break point at this line.")
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
index a7a0006..1aa93d7 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
@@ -27,7 +27,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=-1)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
index 9e226a1..c01d742 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
@@ -21,7 +21,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         bkpt = self.target().FindBreakpointByID(
             lldbutil.run_break_set_by_source_regexp(
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
index 90a958d..47b0a24 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
@@ -28,7 +28,7 @@
     def test_with_run_command(self):
         """Test that libstdcpp iterators format properly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=-1)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
index a8f99f4..ecbea5b 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
@@ -32,7 +32,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=-1)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
index e25c410..0abfbcb 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
@@ -29,7 +29,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_source_regexp(
             self, "Set break point at this line.")
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
index 6809dd3..9d2c105 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
@@ -21,7 +21,7 @@
     @skipIfwatchOS  # libstdcpp not ported to watchos
     def test_with_run_command(self):
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_source_regexp(
             self, "Set break point at this line.")
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
index d4e9e4d..8f6d94a 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
@@ -29,7 +29,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=-1)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py
index b38747d..81a36ee 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py
@@ -21,7 +21,7 @@
     @skipIfwatchOS  # libstdcpp not ported to watchos
     def test_with_run_command(self):
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_source_regexp(
             self, "Set break point at this line.")
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py
index 23da541..fec2e4c 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py
@@ -21,7 +21,7 @@
     @skipIfwatchOS  # libstdcpp not ported to watchos
     def test_with_run_command(self):
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_source_regexp(
             self, "Set break point at this line.")
@@ -74,7 +74,7 @@
         # reference chain and that it correctly handles the different options
         # for the frame variable command in this case.
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_source_regexp(
             self, "Set break point at this line.")
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
index 57c9e2f..7b497c6 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
@@ -32,7 +32,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=-1)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
index e3f21eb..00d2c03 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
@@ -29,7 +29,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_source_regexp(
             self, "Set break point at this line.")
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
index 8fff07d..0e3bcc0 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
@@ -25,7 +25,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py
index 75d3b4e..8bb60b8 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py
@@ -27,7 +27,7 @@
     def test_with_run_command(self):
         """Test using Python synthetic children provider to provide a typename."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
index 6e7ac2c..08768a6 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
@@ -30,7 +30,7 @@
     def test_with_run_command(self):
         """Test using Python synthetic children provider to provide a value."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
index 0c15c79..00eb3d0 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
@@ -26,7 +26,7 @@
     def test_with_run_command(self):
         """Check for an issue where capping does not work because the Target pointer appears to be changing behind our backs."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py
index d6303fe..d750762 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py
@@ -25,7 +25,7 @@
     def test_with_run_command(self):
         """Test that the user can input a format but it will not prevail over summary format's choices."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py
index 32fbf48..cc22eca 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py
@@ -25,7 +25,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py
index b7f60cf..55855dc 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py
@@ -38,7 +38,7 @@
         self.addTearDownHook(cleanup)
 
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
index 87fc2d1..1ae5e40 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
@@ -28,7 +28,7 @@
     def test_rdar11086338_with_run_command(self):
         """Test that NSArray reports its synthetic children properly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
index 85675d2..65e3264 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
@@ -28,7 +28,7 @@
     def test_rdar11988289_with_run_command(self):
         """Test that NSDictionary reports its synthetic children properly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
index 6affc5a..a365702 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
@@ -28,7 +28,7 @@
     def test_rdar12529957_with_run_command(self):
         """Test that NSSet reports its synthetic children properly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py
index 7ffddc5..8726508 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py
@@ -28,7 +28,7 @@
     def test_ostype_with_run_command(self):
         """Test the formatters we use for OSType."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py
index 49cda4a..0bfd8df 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py
@@ -31,7 +31,7 @@
 
     def printarray_data_formatter_commands(self):
         """Test that expr -Z works"""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py
index 83408e7..4326574 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py
@@ -32,7 +32,7 @@
 
     def printarray_data_formatter_commands(self):
         """Test that expr -O -Z works"""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py
index 69b9dd0..862e2b5 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py
@@ -25,7 +25,7 @@
     def test_with_run_command(self):
         """Test that a pointer/reference to a typedef is formatted as we want."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/TestPyObjSynthProvider.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/TestPyObjSynthProvider.py
index 01271b4..ba50ccd 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/TestPyObjSynthProvider.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/TestPyObjSynthProvider.py
@@ -33,7 +33,7 @@
 
     def provider_data_formatter_commands(self):
         """Test that the PythonObjectSyntheticChildProvider helper class works"""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py
index 0a03910..09888e1 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py
@@ -25,7 +25,7 @@
     def test_with_run_command(self):
         """Test that ValueObjectPrinter does not cause an infinite loop when a reference to a struct that contains a pointer to itself is printed."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py
index d7862d2..f766699 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py
@@ -30,7 +30,7 @@
             self.skipTest(
                 "llvm.org/pr16214 -- clang emits partial DWARF for structures referenced via typedef")
 
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
index 6d51976..e94f6c4 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
@@ -26,7 +26,7 @@
     def test_with_run_command(self):
         """Check for an issue where capping does not work because the Target pointer appears to be changing behind our backs."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
index 29c1214..54e9a32 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
@@ -28,7 +28,7 @@
     def test_rdar12437442_with_run_command(self):
         """Test that we update SBValues correctly as dynamic types change."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py
index 2e66b80..9435e80 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py
@@ -30,7 +30,7 @@
 
     def data_formatter_commands(self):
         """Test printing out Python summary formatters."""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py
index d970d11..d3cc4d9 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py
@@ -25,7 +25,7 @@
     def test_with_run_command(self):
         """Test that the user can input a format but it will not prevail over summary format's choices."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py
index 53073f6..f6dc47f 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py
@@ -25,7 +25,7 @@
     def test_with_run_command(self):
         """Test that that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py
index cde0ef4..d3c04af 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py
@@ -28,7 +28,7 @@
     def test_with_run_command(self):
         """Test using Python synthetic children provider."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
index 2d4cd57..c1dc152 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
@@ -28,7 +28,7 @@
     def test_with_run_command(self):
         """Check that vector types format properly"""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/dead-strip/TestDeadStrip.py b/lldb/packages/Python/lldbsuite/test/functionalities/dead-strip/TestDeadStrip.py
index 355d60a..9ba3d2d 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/dead-strip/TestDeadStrip.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/dead-strip/TestDeadStrip.py
@@ -28,7 +28,7 @@
     def test(self):
         """Test breakpoint works correctly with dead-code stripping."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break by function name f1 (live code).
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py b/lldb/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py
index cee472c..aee5f93 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py
@@ -22,7 +22,7 @@
         bugnumber="function names print fully demangled instead of name-only")
     def test(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.expect("file " + exe,
                     patterns=["Current executable set to .*a.out.*"])
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/disassembly/TestFrameDisassemble.py b/lldb/packages/Python/lldbsuite/test/functionalities/disassembly/TestFrameDisassemble.py
index 47357cf4..c5fec5b 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/disassembly/TestFrameDisassemble.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/disassembly/TestFrameDisassemble.py
@@ -30,7 +30,7 @@
 
     def frame_disassemble_test(self):
         """Sample test to ensure SBFrame::Disassemble produces SOME output"""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py b/lldb/packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
index 79e4e62..aaba156 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
@@ -39,7 +39,7 @@
         """Test fetching C++ dynamic values from pointers & references."""
         """Get argument vals for the call stack when stopped on a breakpoint."""
         self.build(dictionary=self.getBuildFlags())
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target from the debugger.
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py b/lldb/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
index 937ac92..0f130b3 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
@@ -29,7 +29,7 @@
         """Test convenience variables lldb.debugger, lldb.target, lldb.process, lldb.thread, and lldb.frame."""
         self.build()
         import pexpect
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         prompt = "(lldb) "
         python_prompt = ">>> "
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py b/lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
index f1c1519..61cd7d5 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
@@ -51,12 +51,12 @@
                 "'%s' -g -O0 -arch i386 -arch x86_64 '%s'" %
                 (os.environ["CC"], o_file))
             if self.debug_info != "dsym":
-                dsym_path = os.path.join(os.getcwd(), "a.out.dSYM")
+                dsym_path = self.getBuildArtifact("a.out.dSYM")
                 execute_command("rm -rf '%s'" % (dsym_path))
         else:
             self.build()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create the target
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py b/lldb/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
index 719f3f7..a498f0a 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
@@ -26,7 +26,7 @@
     def test_with_run_command(self):
         """Test that expr will time out and allow other threads to run if it blocks."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py b/lldb/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
index d62ccbf..8024053 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
@@ -34,7 +34,7 @@
         DWARF in .o file debugging. The only thing this test needs to do is to compile and
         set a breakpoint in the target and verify any breakpoint locations have valid debug
         info for the function, and source file and line.'''
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create the target
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py b/lldb/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py
index b7592c9..f311fac 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py
@@ -22,11 +22,12 @@
     def test_formats(self):
         """Test format string functionality."""
         self.build()
+        exe = self.getBuildArtifact("a.out")
         import pexpect
         prompt = "(lldb) "
         child = pexpect.spawn(
-            '%s %s -x -o "b main" -o r a.out' %
-            (lldbtest_config.lldbExec, self.lldbOption))
+            '%s %s -x -o "b main" -o r %s' %
+            (lldbtest_config.lldbExec, self.lldbOption, exe))
         # Turn on logging for what the child sends back.
         if self.TraceOn():
             child.logfile_read = sys.stdout
@@ -34,7 +35,7 @@
         self.child = child
 
         # Substitute 'Help!' for 'help' using the 'commands regex' mechanism.
-        child.expect_exact(prompt + 'target create "a.out"')
+        child.expect_exact(prompt + 'target create "%s"' % exe)
         child.expect_exact(prompt + 'b main')
         child.expect_exact(prompt + 'r')
         child.expect_exact(prompt)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/TestArray.py b/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/TestArray.py
index 276760d..8daf2e4 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/TestArray.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/TestArray.py
@@ -19,7 +19,7 @@
     def test_array(self):
         TestBase.setUp(self)
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
         self.runCmd("run", RUN_SUCCEEDED)
         self.expect("thread list", "Thread should be stopped",
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/TestBadReference.py b/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/TestBadReference.py
index 6529e11..e198720 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/TestBadReference.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/TestBadReference.py
@@ -19,7 +19,7 @@
     def test_bad_reference(self):
         TestBase.setUp(self)
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
         self.runCmd("run", RUN_SUCCEEDED)
         self.expect("thread list", "Thread should be stopped",
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/complicated-expression/TestComplicatedExpression.py b/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/complicated-expression/TestComplicatedExpression.py
index 2e6fad5..7823c63 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/complicated-expression/TestComplicatedExpression.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/complicated-expression/TestComplicatedExpression.py
@@ -19,7 +19,7 @@
     def test_diagnose_dereference_argument(self):
         TestBase.setUp(self)
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
         self.runCmd("run", RUN_SUCCEEDED)
         self.expect("thread list", "Thread should be stopped",
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-argument/TestDiagnoseDereferenceArgument.py b/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-argument/TestDiagnoseDereferenceArgument.py
index 7839a47..335d617 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-argument/TestDiagnoseDereferenceArgument.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-argument/TestDiagnoseDereferenceArgument.py
@@ -19,7 +19,7 @@
     def test_diagnose_dereference_argument(self):
         TestBase.setUp(self)
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
         self.runCmd("run", RUN_SUCCEEDED)
         self.expect("thread list", "Thread should be stopped",
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py b/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py
index 8e5cd43..0398a16 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py
@@ -20,7 +20,7 @@
     def test_diagnose_dereference_function_return(self):
         TestBase.setUp(self)
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
         self.runCmd("run", RUN_SUCCEEDED)
         self.expect("thread list", "Thread should be stopped",
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-this/TestDiagnoseDereferenceThis.py b/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-this/TestDiagnoseDereferenceThis.py
index 201923f..272a64e 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-this/TestDiagnoseDereferenceThis.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-this/TestDiagnoseDereferenceThis.py
@@ -19,7 +19,7 @@
     def test_diagnose_dereference_this(self):
         TestBase.setUp(self)
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
         self.runCmd("run", RUN_SUCCEEDED)
         self.expect("thread list", "Thread should be stopped",
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/TestDiagnoseInheritance.py b/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/TestDiagnoseInheritance.py
index 08ef1c7..3d9c893 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/TestDiagnoseInheritance.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/TestDiagnoseInheritance.py
@@ -19,7 +19,7 @@
     def test_diagnose_inheritance(self):
         TestBase.setUp(self)
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
         self.runCmd("run", RUN_SUCCEEDED)
         self.expect("thread list", "Thread should be stopped",
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py b/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py
index e962c26..da1fd18 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py
@@ -19,7 +19,7 @@
     def test_local_variable(self):
         TestBase.setUp(self)
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
         self.runCmd("run", RUN_SUCCEEDED)
         self.expect("thread list", "Thread should be stopped",
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/virtual-method-call/TestDiagnoseDereferenceVirtualMethodCall.py b/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/virtual-method-call/TestDiagnoseDereferenceVirtualMethodCall.py
index bc11bd1..437cdbb 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/virtual-method-call/TestDiagnoseDereferenceVirtualMethodCall.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/frame-diagnose/virtual-method-call/TestDiagnoseDereferenceVirtualMethodCall.py
@@ -19,7 +19,7 @@
     def test_diagnose_virtual_method_call(self):
         TestBase.setUp(self)
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
         self.runCmd("run", RUN_SUCCEEDED)
         self.expect("thread list", "Thread should be stopped",
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py b/lldb/packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py
index 178e165..d004e93 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py
@@ -39,7 +39,7 @@
 
     def do_test(self):
         """Test GuessLanguage for C & C++."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/frame_var/TestFrameVar.py b/lldb/packages/Python/lldbsuite/test/functionalities/frame_var/TestFrameVar.py
index b29f94b..960891b 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/frame_var/TestFrameVar.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/frame_var/TestFrameVar.py
@@ -31,7 +31,7 @@
         TestBase.setUp(self)
 
     def do_test(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py b/lldb/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
index 7b048fe..75215f8 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
@@ -125,7 +125,7 @@
 
     def inferior_asserting(self):
         """Inferior asserts upon launching; lldb should catch the event and stop."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.runCmd("run", RUN_SUCCEEDED)
@@ -142,7 +142,7 @@
 
     def inferior_asserting_python(self):
         """Inferior asserts upon launching; lldb should catch the event and stop."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -166,7 +166,7 @@
 
     def inferior_asserting_registers(self):
         """Test that lldb can read registers after asserting."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.runCmd("run", RUN_SUCCEEDED)
@@ -178,7 +178,7 @@
 
     def inferior_asserting_disassemble(self):
         """Test that lldb can disassemble frames after asserting."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
@@ -248,7 +248,7 @@
 
     def inferior_asserting_expr(self):
         """Test that the lldb expression interpreter can read symbols after asserting."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
@@ -272,7 +272,7 @@
 
     def inferior_asserting_step(self):
         """Test that lldb functions correctly after stepping through a call to assert()."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py b/lldb/packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py
index 3620de6..b1b9f4b 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py
@@ -41,7 +41,7 @@
 
     def inferior_crashing(self):
         """Inferior crashes upon launching; lldb should catch the event and stop."""
-        self.exe = os.path.join(os.getcwd(), "a.out")
+        self.exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + self.exe, CURRENT_EXECUTABLE_SET)
 
         self.runCmd("run", RUN_SUCCEEDED)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py b/lldb/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
index b233d2f..4f54f5d 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
@@ -100,7 +100,7 @@
 
     def inferior_crashing(self):
         """Inferior crashes upon launching; lldb should catch the event and stop."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.runCmd("run", RUN_SUCCEEDED)
@@ -122,7 +122,7 @@
 
     def inferior_crashing_python(self):
         """Inferior crashes upon launching; lldb should catch the event and stop."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -148,7 +148,7 @@
 
     def inferior_crashing_registers(self):
         """Test that lldb can read registers after crashing."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.runCmd("run", RUN_SUCCEEDED)
@@ -160,7 +160,7 @@
 
     def inferior_crashing_expr(self):
         """Test that the lldb expression interpreter can read symbols after crashing."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.runCmd("run", RUN_SUCCEEDED)
@@ -176,7 +176,7 @@
 
     def inferior_crashing_step(self):
         """Test that lldb functions correctly after stepping through a crash."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.set_breakpoint(self.line)
@@ -206,7 +206,7 @@
 
     def inferior_crashing_step_after_break(self):
         """Test that lldb behaves correctly when stepping after a crash."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.runCmd("run", RUN_SUCCEEDED)
@@ -231,7 +231,7 @@
 
     def inferior_crashing_expr_step_expr(self):
         """Test that lldb expressions work before and after stepping after a crash."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.runCmd("run", RUN_SUCCEEDED)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py b/lldb/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
index 9987377..d8efe65 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
@@ -83,7 +83,7 @@
 
     def recursive_inferior_crashing(self):
         """Inferior crashes upon launching; lldb should catch the event and stop."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.runCmd("run", RUN_SUCCEEDED)
@@ -117,7 +117,7 @@
 
     def recursive_inferior_crashing_python(self):
         """Inferior crashes upon launching; lldb should catch the event and stop."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -143,7 +143,7 @@
 
     def recursive_inferior_crashing_registers(self):
         """Test that lldb can read registers after crashing."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.runCmd("run", RUN_SUCCEEDED)
@@ -155,7 +155,7 @@
 
     def recursive_inferior_crashing_expr(self):
         """Test that the lldb expression interpreter can read symbols after crashing."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.runCmd("run", RUN_SUCCEEDED)
@@ -168,7 +168,7 @@
 
     def recursive_inferior_crashing_step(self):
         """Test that lldb functions correctly after stepping through a crash."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.set_breakpoint(self.line)
@@ -196,7 +196,7 @@
 
     def recursive_inferior_crashing_step_after_break(self):
         """Test that lldb behaves correctly when stepping after a crash."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.runCmd("run", RUN_SUCCEEDED)
@@ -221,7 +221,7 @@
 
     def recursive_inferior_crashing_expr_step_expr(self):
         """Test that lldb expressions work before and after stepping after a crash."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.runCmd("run", RUN_SUCCEEDED)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py b/lldb/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py
index cb80124..c77b99f 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py
@@ -145,7 +145,7 @@
 
     def inline_stepping(self):
         """Use Python APIs to test stepping over and hitting breakpoints."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -257,7 +257,7 @@
 
     def inline_stepping_step_over(self):
         """Use Python APIs to test stepping over and hitting breakpoints."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -288,7 +288,7 @@
 
     def step_in_template(self):
         """Use Python APIs to test stepping in to templated functions."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py b/lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
index 7ccfaa6..07f04b1 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
@@ -22,7 +22,7 @@
     def test_bogus_values(self):
         """Test that we handle inferior misusing the GDB JIT interface"""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py b/lldb/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py
index 43fa5f9..498384b 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py
@@ -25,7 +25,7 @@
     @skipIfDarwinEmbedded # iOS etc don't launch the binary via a shell, so arg expansion won't happen
     def test(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         self.runCmd("target create %s" % exe)
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py b/lldb/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
index 69df35b..413ac23 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
@@ -105,7 +105,7 @@
         old_dylib = os.path.join(os.getcwd(), dylibName)
         new_dylib = os.path.join(new_dir, dylibName)
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.expect("target modules list",
@@ -156,7 +156,7 @@
         self.build()
         self.copy_shlibs_to_remote(hidden_dir=True)
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Shut off ANSI color usage so we don't get ANSI escape sequences
@@ -222,7 +222,7 @@
         self.build()
         self.copy_shlibs_to_remote()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break at main.cpp before the call to dlopen().
@@ -300,7 +300,7 @@
         self.build()
         self.copy_shlibs_to_remote()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break by function name a_function (not yet loaded).
@@ -343,7 +343,7 @@
         self.build()
         self.copy_shlibs_to_remote()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break by function name a_function (not yet loaded).
@@ -374,7 +374,7 @@
         self.build()
         self.copy_shlibs_to_remote()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         a_init_bp_num = lldbutil.run_break_set_by_symbol(
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py b/lldb/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
index dd4ab4c..db855f6 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
@@ -47,7 +47,7 @@
         self.step_back_out()
 
     def start_test(self, symbol):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/memory/cache/TestMemoryCache.py b/lldb/packages/Python/lldbsuite/test/functionalities/memory/cache/TestMemoryCache.py
index f2126e9..f45479b 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/memory/cache/TestMemoryCache.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/memory/cache/TestMemoryCache.py
@@ -28,7 +28,7 @@
     def test_memory_cache(self):
         """Test the MemoryCache class with a sequence of 'memory read' and 'memory write' operations."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break in main() after the variables are assigned values.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py b/lldb/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
index f8f10a8..af12291 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
@@ -28,7 +28,7 @@
     def test_memory_find(self):
         """Test the 'memory find' command."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break in main() aftre the variables are assigned values.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/memory/read/TestMemoryRead.py b/lldb/packages/Python/lldbsuite/test/functionalities/memory/read/TestMemoryRead.py
index 91342fd..58130df 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/memory/read/TestMemoryRead.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/memory/read/TestMemoryRead.py
@@ -26,7 +26,7 @@
     def test_memory_read(self):
         """Test the 'memory read' command with plain and vector formats."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break in main() aftre the variables are assigned values.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py b/lldb/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py
index eb6981d..b871b90 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py
@@ -33,7 +33,7 @@
     @skipIf(archs=['i386'])
     def mtc_tests(self):
         # Load the test
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.expect("file " + exe, patterns=["Current executable set to .*a.out"])
 
         self.runCmd("env DYLD_INSERT_LIBRARIES=%s" % self.mtc_dylib_path)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/nested_alias/TestNestedAlias.py b/lldb/packages/Python/lldbsuite/test/functionalities/nested_alias/TestNestedAlias.py
index 86c5e41..84181ad 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/nested_alias/TestNestedAlias.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/nested_alias/TestNestedAlias.py
@@ -26,7 +26,7 @@
     def test_nested_alias(self):
         """Test that an alias can reference other aliases without crashing."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break in main() aftre the variables are assigned values.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py b/lldb/packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py
index bbaba95..59e889e 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py
@@ -23,9 +23,8 @@
     def test_eval_index_variable(self):
         """Test expressions of variable 'i' which appears in two for loops."""
         self.build()
-        self.exe_name = 'a.out'
-        exe = os.path.join(os.getcwd(), self.exe_name)
-        self.runCmd("file %s" % exe, CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"),
+                    CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self,
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/nosucharch/TestNoSuchArch.py b/lldb/packages/Python/lldbsuite/test/functionalities/nosucharch/TestNoSuchArch.py
index be89e36..fd98123 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/nosucharch/TestNoSuchArch.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/nosucharch/TestNoSuchArch.py
@@ -15,7 +15,7 @@
 
     def test(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Check that passing an invalid arch via the command-line fails but
         # doesn't crash
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py b/lldb/packages/Python/lldbsuite/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py
index 9a5d320..1a6f4c12 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py
@@ -45,7 +45,7 @@
 
         # Create a target by the debugger.
         cwd = os.getcwd()
-        exe = os.path.join(cwd, "a.out")
+        exe = self.getBuildArtifact("a.out")
         python_os_plugin_path = os.path.join(cwd, "operating_system.py")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -129,7 +129,7 @@
 
         # Create a target by the debugger.
         cwd = os.getcwd()
-        exe = os.path.join(cwd, "a.out")
+        exe = self.getBuildArtifact("a.out")
         python_os_plugin_path = os.path.join(cwd, "operating_system2.py")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
index c7b64d7..3459da6 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
@@ -63,7 +63,7 @@
     def test_deeper_stack_in_mini_dump(self):
         """Test that we can examine a more interesting stack in a mini dump."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         core = os.path.join(os.getcwd(), "core.dmp")
         try:
             # Set a breakpoint and capture a mini dump.
@@ -99,7 +99,7 @@
     def test_local_variables_in_mini_dump(self):
         """Test that we can examine local variables in a mini dump."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         core = os.path.join(os.getcwd(), "core.dmp")
         try:
             # Set a breakpoint and capture a mini dump.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/TestPreRunDylibs.py b/lldb/packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/TestPreRunDylibs.py
index 258c3d3..befb421 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/TestPreRunDylibs.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/TestPreRunDylibs.py
@@ -20,7 +20,7 @@
         """Test that we find directly linked dylib pre-run."""
 
         self.build()
-        target = self.dbg.CreateTarget("a.out")
+        target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
         self.assertTrue(target, VALID_TARGET)
 
         # I don't know what the name of a shared library
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py b/lldb/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py
index 9143644..ad63bf2 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py
@@ -26,7 +26,7 @@
     @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails
     def test_setpgid(self):
         self.build()
-        exe = os.path.join(os.getcwd(), 'a.out')
+        exe = self.getBuildArtifact("a.out")
 
         # Use a file as a synchronization point between test and inferior.
         pid_file_path = lldbutil.append_to_process_working_directory(
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py b/lldb/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
index 5929a35..18fe9d7 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
@@ -33,7 +33,7 @@
     def test_io(self):
         """Test that process launch I/O redirection flags work properly."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.expect("file " + exe,
                     patterns=["Current executable set to .*a.out"])
 
@@ -125,7 +125,7 @@
         d = {'CXX_SOURCES': 'print_cwd.cpp'}
         self.build(dictionary=d)
         self.setTearDownCleanup(d)
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe)
 
         mywd = 'my_working_dir'
@@ -195,7 +195,7 @@
         d = {'CXX_SOURCES': source}
         self.build(dictionary=d)
         self.setTearDownCleanup(d)
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         evil_var = 'INIT*MIDDLE}TAIL'
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/process_save_core/TestProcessSaveCore.py b/lldb/packages/Python/lldbsuite/test/functionalities/process_save_core/TestProcessSaveCore.py
index ee1f82b..e25d710 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/process_save_core/TestProcessSaveCore.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/process_save_core/TestProcessSaveCore.py
@@ -21,7 +21,7 @@
     def test_cannot_save_core_unless_process_stopped(self):
         """Test that SaveCore fails if the process isn't stopped."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         core = os.path.join(os.getcwd(), "core.dmp")
         target = self.dbg.CreateTarget(exe)
         process = target.LaunchSimple(
@@ -35,7 +35,7 @@
     def test_save_windows_mini_dump(self):
         """Test that we can save a Windows mini dump."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         core = os.path.join(os.getcwd(), "core.dmp")
         try:
             target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/ptr_refs/TestPtrRefs.py b/lldb/packages/Python/lldbsuite/test/functionalities/ptr_refs/TestPtrRefs.py
index 5085b8c..80ace21 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/ptr_refs/TestPtrRefs.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/ptr_refs/TestPtrRefs.py
@@ -19,8 +19,7 @@
     def test_ptr_refs(self):
         """Test format string functionality."""
         self.build()
-        exe_name = 'a.out'
-        exe = os.path.join(os.getcwd(), exe_name)
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/recursion/TestValueObjectRecursion.py b/lldb/packages/Python/lldbsuite/test/functionalities/recursion/TestValueObjectRecursion.py
index 5b72d38..569ecd2 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/recursion/TestValueObjectRecursion.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/recursion/TestValueObjectRecursion.py
@@ -25,7 +25,7 @@
     def test_with_run_command(self):
         """Test that deeply nested ValueObjects still work."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestYMMRegister.py b/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestYMMRegister.py
index 6dccaa5..d424969 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestYMMRegister.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestYMMRegister.py
@@ -25,7 +25,7 @@
         self.build()
         self.setTearDownCleanup()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
 
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py b/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
index 96f3655..00802ff 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
@@ -35,7 +35,7 @@
         """Test Intel(R) MPX registers after running example code."""
         self.line = line_number('main.cpp', '// Set a break point here.')
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(self, "main.cpp", self.line, num_expected_locations=1)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py b/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
index 45721dd..2fd2dab 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
@@ -29,7 +29,7 @@
         self.mpx_boundary_violation()
 
     def mpx_boundary_violation(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.runCmd("run", RUN_SUCCEEDED)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py b/lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
index 83cc488..cb3baf4 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
@@ -124,7 +124,7 @@
         self.convenience_registers_with_process_attach(test_16bit_regs=True)
 
     def common_setup(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
@@ -185,7 +185,7 @@
                 new_value])
 
     def fp_special_purpose_register_read(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
@@ -266,7 +266,7 @@
                 1 << fstat_top_pointer_initial)
 
     def fp_register_write(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
@@ -441,7 +441,7 @@
 
     def convenience_registers_with_process_attach(self, test_16bit_regs):
         """Test convenience registers after a 'process attach'."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Spawn a new process
         pid = self.spawnSubprocess(exe, ['wait_for_attach']).pid
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py b/lldb/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py
index 20d64b3..044d3d2 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py
@@ -18,7 +18,7 @@
 
     def test(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         self.runCmd("target create %s" % exe)
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py b/lldb/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
index 606a71f..69c15f4 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
@@ -40,7 +40,7 @@
     def test_with_python(self):
         """Test getting return values from stepping out."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         error = lldb.SBError()
 
         self.target = self.dbg.CreateTarget(exe)
@@ -189,7 +189,7 @@
     @skipIfDarwinEmbedded # <rdar://problem/33976032> ABIMacOSX_arm64 doesn't get structs this big correctly
     def test_vector_values(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         error = lldb.SBError()
 
         self.target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/set-data/TestSetData.py b/lldb/packages/Python/lldbsuite/test/functionalities/set-data/TestSetData.py
index 2fc31a4..6e4dbf4 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/set-data/TestSetData.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/set-data/TestSetData.py
@@ -21,7 +21,7 @@
     def test_set_data(self):
         """Test setting the contents of variables and registers using raw data."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.runCmd("br s -p First")
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py b/lldb/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
index 0a2756d..316233b 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
@@ -29,7 +29,7 @@
     def test_with_run_command(self):
         """Test that lldb command 'process signal SIGUSR1' sends a signal to the inferior process."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py b/lldb/packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py
index 97de996..1ebab88 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py
@@ -20,7 +20,7 @@
     @skipIfDarwin
     def test_inferior_handle_sigsegv(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py b/lldb/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py
index 7917556..5164ac5 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py
@@ -58,7 +58,7 @@
 
     def signal_test(self, signal, test_passing):
         """Test that we handle inferior raising signals"""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
@@ -197,7 +197,7 @@
         """Test that we catch a signal in the edge case where the process receives it while we are
         about to interrupt it"""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py b/lldb/packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py
index ad08c6a..9957c91 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py
@@ -35,7 +35,9 @@
         """Test that 'lldb my_file_name' works where my_file_name is a string with a single quote char in it."""
         import pexpect
         self.buildDefault()
-        system([["cp", "a.out", "\"%s\"" % self.myexe]])
+        system([["cp",
+                 self.getBuildArtifact("a.out"),
+                 "\"%s\"" % self.getBuildArtifact(self.myexe)]])
 
         # The default lldb prompt.
         prompt = "(lldb) "
@@ -43,7 +45,8 @@
         # So that the child gets torn down after the test.
         self.child = pexpect.spawn(
             '%s %s "%s"' %
-            (lldbtest_config.lldbExec, self.lldbOption, self.myexe))
+            (lldbtest_config.lldbExec, self.lldbOption,
+             self.getBuildArtifact(self.myexe)))
         child = self.child
         child.setecho(True)
         # Turn on logging for input/output to/from the child.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py b/lldb/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py
index 7ec934f..6480e03 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py
@@ -92,7 +92,7 @@
             (name, pattern))
 
     def get_to_starting_point(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         error = lldb.SBError()
 
         self.target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookCmd.py b/lldb/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookCmd.py
index 3d23f64..767b368 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookCmd.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookCmd.py
@@ -38,7 +38,7 @@
     def test(self):
         """Test a sequence of target stop-hook commands."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookMechanism.py b/lldb/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookMechanism.py
index 7408858..b76d98a 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookMechanism.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookMechanism.py
@@ -45,7 +45,7 @@
         self.build()
 
         import pexpect
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         prompt = "(lldb) "
         add_prompt = "Enter your stop hook command(s).  Type 'DONE' to end."
         add_prompt1 = "> "
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py b/lldb/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py
index 7d2900d..4d5ac02 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py
@@ -25,15 +25,15 @@
 
     def test_target_command(self):
         """Test some target commands: create, list, select."""
-        da = {'C_SOURCES': 'a.c', 'EXE': 'a.out'}
+        da = {'C_SOURCES': 'a.c', 'EXE': self.getBuildArtifact('a.out')}
         self.build(dictionary=da)
         self.addTearDownCleanup(dictionary=da)
 
-        db = {'C_SOURCES': 'b.c', 'EXE': 'b.out'}
+        db = {'C_SOURCES': 'b.c', 'EXE': self.getBuildArtifact('b.out')}
         self.build(dictionary=db)
         self.addTearDownCleanup(dictionary=db)
 
-        dc = {'C_SOURCES': 'c.c', 'EXE': 'c.out'}
+        dc = {'C_SOURCES': 'c.c', 'EXE': self.getBuildArtifact('c.out')}
         self.build(dictionary=dc)
         self.addTearDownCleanup(dictionary=dc)
 
@@ -44,7 +44,7 @@
     @expectedFailureAndroid(archs=['aarch64'])
     def test_target_variable_command(self):
         """Test 'target variable' command before and after starting the inferior."""
-        d = {'C_SOURCES': 'globals.c', 'EXE': 'globals'}
+        d = {'C_SOURCES': 'globals.c', 'EXE': self.getBuildArtifact('globals')}
         self.build(dictionary=d)
         self.addTearDownCleanup(dictionary=d)
 
@@ -53,7 +53,7 @@
     @expectedFailureAndroid(archs=['aarch64'])
     def test_target_variable_command_no_fail(self):
         """Test 'target variable' command before and after starting the inferior."""
-        d = {'C_SOURCES': 'globals.c', 'EXE': 'globals'}
+        d = {'C_SOURCES': 'globals.c', 'EXE': self.getBuildArtifact('globals')}
         self.build(dictionary=d)
         self.addTearDownCleanup(dictionary=d)
 
@@ -61,7 +61,7 @@
 
     def do_target_command(self):
         """Exercise 'target create', 'target list', 'target select' commands."""
-        exe_a = os.path.join(os.getcwd(), "a.out")
+        exe_a = self.getBuildArtifact("a.out")
         exe_b = os.path.join(os.getcwd(), "b.out")
         exe_c = os.path.join(os.getcwd(), "c.out")
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py
index ba5094f..e202626 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py
@@ -30,7 +30,7 @@
         """Test breakpoint handling after a thread join."""
         self.build(dictionary=self.getBuildFlags())
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # This should create a breakpoint
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py
index d1d70c5..cef24d6 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py
@@ -36,7 +36,7 @@
         """Test breakpoint handling after a thread join."""
         self.build(dictionary=self.getBuildFlags())
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # This should create a breakpoint in the main thread.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
index 5343e19..b2a3e43 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
@@ -26,7 +26,7 @@
     def test_step_inst_with(self):
         """Test thread creation during step-inst handling."""
         self.build(dictionary=self.getBuildFlags())
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target and target.IsValid(), "Target is valid")
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
index 442887e..3f26d8c 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
@@ -51,7 +51,7 @@
     def create_after_attach(self, use_fork):
         """Test thread creation after process attach."""
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Spawn a new process
         if use_fork:
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py
index f6d6197..3998db6 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py
@@ -83,7 +83,7 @@
 
     def create_during_step_base(self, step_cmd, step_stop_reason):
         """Test thread creation while using step-in."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Get the target process
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
index 456c890..c62990c 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
@@ -29,7 +29,7 @@
     def test(self):
         """Test thread exit during breakpoint handling."""
         self.build(dictionary=self.getBuildFlags())
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # This should create a breakpoint in the main thread.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
index 4ba0495..0343a88 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
@@ -53,7 +53,7 @@
 
     def exit_during_step_base(self, step_cmd, step_stop_reason, by_instruction):
         """Test thread exit during step handling."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # This should create a breakpoint in the main thread.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
index 26ee5d4..2a66c6c 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
@@ -20,7 +20,7 @@
     def test(self):
         """Test thread jump handling."""
         self.build(dictionary=self.getBuildFlags())
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Find the line numbers for our breakpoints.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py
index 18d88cb..cff9b5a 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py
@@ -38,7 +38,7 @@
     def test(self):
         """Test simultaneous breakpoints in multiple threads."""
         self.build(dictionary=self.getBuildFlags())
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # This should create a breakpoint in the main thread.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py
index 75a9b88..eff59ee 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py
@@ -27,7 +27,7 @@
     def test_number_of_threads(self):
         """Test number of threads."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # This should create a breakpoint with 1 location.
@@ -66,7 +66,7 @@
     def test_unique_stacks(self):
         """Test backtrace unique with multiple threads executing the same stack."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Set a break point on the thread3 notify all (should get hit on threads 4-13).
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
index 1fb5215..4d010df 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
@@ -82,7 +82,7 @@
 
     def thread_state_after_breakpoint_test(self):
         """Test thread state after breakpoint."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # This should create a breakpoint in the main thread.
@@ -122,7 +122,7 @@
 
     def thread_state_after_continue_test(self):
         """Test thread state after continue."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # This should create a breakpoint in the main thread.
@@ -164,7 +164,7 @@
 
     def thread_state_after_expression_test(self):
         """Test thread state after expression."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # This should create a breakpoint in the main thread.
@@ -200,7 +200,7 @@
 
     def process_interrupt_test(self):
         """Test process interrupt and continue."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # This should create a breakpoint in the main thread.
@@ -240,7 +240,7 @@
 
     def thread_states_test(self):
         """Test thread states (comprehensive)."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # This should create a breakpoint in the main thread.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py
index 9c8bbf1..238b188 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py
@@ -125,7 +125,7 @@
 
     def step_out_test(self, step_out_func):
         """Test single thread step out of a function."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # This should create a breakpoint in the main thread.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_until/TestStepUntil.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_until/TestStepUntil.py
index d63d5c5..a246b915 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_until/TestStepUntil.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/step_until/TestStepUntil.py
@@ -26,7 +26,7 @@
 
     def do_until (self, args, until_lines, expected_linenum):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py
index deedc4b..07ceb3f 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py
@@ -28,7 +28,7 @@
     def test(self):
         """Test thread exit handling."""
         self.build(dictionary=self.getBuildFlags())
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # This should create a breakpoint with 1 location.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py
index 8f004e6..4ebe699 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py
@@ -24,7 +24,7 @@
     def test_python(self):
         """Test that we obey thread conditioned breakpoints."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py
index 3eddaca..981813b 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py
@@ -28,7 +28,7 @@
     def test_python(self):
         """Test that we obey thread conditioned breakpoints."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py
index f1689a8..c91ed41 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py
@@ -33,7 +33,7 @@
         self.line_thread2 = line_number('main.c', '// thread2 line')
 
     def tsan_tests(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.expect(
             "file " + exe,
             patterns=["Current executable set to .*a.out"])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py
index 8baba9b..7451dde 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py
@@ -30,7 +30,7 @@
         TestBase.setUp(self)
 
     def tsan_tests(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.expect(
             "file " + exe,
             patterns=["Current executable set to .*a.out"])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py
index 3f0cae6..c68c2ef 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py
@@ -30,7 +30,7 @@
         TestBase.setUp(self)
 
     def tsan_tests(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.expect(
             "file " + exe,
             patterns=["Current executable set to .*a.out"])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py
index 436fcf6..93b06f6 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py
@@ -30,7 +30,7 @@
         TestBase.setUp(self)
 
     def tsan_tests(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.expect(
             "file " + exe,
             patterns=["Current executable set to .*a.out"])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py
index f4380cf..6e65873 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py
@@ -26,7 +26,7 @@
         self.tsan_tests()
 
     def tsan_tests(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.expect(
             "file " + exe,
             patterns=["Current executable set to .*a.out"])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py
index 684e6f7..6565a23 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py
@@ -30,7 +30,7 @@
         TestBase.setUp(self)
 
     def tsan_tests(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.expect(
             "file " + exe,
             patterns=["Current executable set to .*a.out"])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/tty/TestTerminal.py b/lldb/packages/Python/lldbsuite/test/functionalities/tty/TestTerminal.py
index f0ecd46..c4d31df 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/tty/TestTerminal.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/tty/TestTerminal.py
@@ -35,7 +35,7 @@
     @no_debug_info_test
     def test_launch_in_terminal(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         launch_info = lldb.SBLaunchInfo(["-lAF", "/tmp/"])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/type_completion/TestTypeCompletion.py b/lldb/packages/Python/lldbsuite/test/functionalities/type_completion/TestTypeCompletion.py
index 8d6311e..2c7fb01 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/type_completion/TestTypeCompletion.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/type_completion/TestTypeCompletion.py
@@ -25,7 +25,7 @@
     def test_with_run_command(self):
         """Check that types only get completed when necessary."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_source_regexp(
             self, "// Set break point at this line.")
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py b/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py
index b0f5292..272634f 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py
@@ -29,7 +29,7 @@
     def test_type_lookup(self):
         """Test type lookup command."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/ubsan/basic/TestUbsanBasic.py b/lldb/packages/Python/lldbsuite/test/functionalities/ubsan/basic/TestUbsanBasic.py
index 8dcee97..cec9fdd 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/ubsan/basic/TestUbsanBasic.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/ubsan/basic/TestUbsanBasic.py
@@ -27,7 +27,7 @@
 
     def ubsan_tests(self):
         # Load the test
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.expect(
             "file " + exe,
             patterns=["Current executable set to .*a.out"])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/TestUbsanUserExpression.py b/lldb/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/TestUbsanUserExpression.py
index a5e5f572..d0502cc 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/TestUbsanUserExpression.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/TestUbsanUserExpression.py
@@ -27,7 +27,7 @@
 
     def ubsan_tests(self):
         # Load the test
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.expect(
             "file " + exe,
             patterns=["Current executable set to .*a.out"])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/TestEhFrameUnwind.py b/lldb/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/TestEhFrameUnwind.py
index a855be7..9c87d17 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/TestEhFrameUnwind.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/TestEhFrameUnwind.py
@@ -23,7 +23,7 @@
         self.build()
         self.setTearDownCleanup()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
 
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py b/lldb/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
index c416004..a2558c7 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
@@ -25,7 +25,7 @@
         self.build()
         self.setTearDownCleanup()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py b/lldb/packages/Python/lldbsuite/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py
index 598efbc..f971942 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py
@@ -25,7 +25,7 @@
         self.build()
         self.setTearDownCleanup()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py b/lldb/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py
index 2416128..4bacb0b 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py
@@ -84,7 +84,7 @@
         else:
             self.skipTest("No expectations for the current architecture")
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/value_md5_crash/TestValueMD5Crash.py b/lldb/packages/Python/lldbsuite/test/functionalities/value_md5_crash/TestValueMD5Crash.py
index 8e3ab85..1a8fbdf 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/value_md5_crash/TestValueMD5Crash.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/value_md5_crash/TestValueMD5Crash.py
@@ -27,7 +27,7 @@
     def test_with_run_command(self):
         """Verify that the hash computing logic for ValueObject's values can't crash us."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
index 2cfba39..17c5afa 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
@@ -28,7 +28,7 @@
         # And the watchpoint variable declaration line number.
         self.decl = line_number(self.source,
                                 '// Watchpoint variable declaration.')
-        self.exe_name = 'a.out'
+        self.exe_name = self.getBuildArtifact('a.out')
         self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
 
     @expectedFailureAll(
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/multi_watchpoint_slots/TestWatchpointMultipleSlots.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/multi_watchpoint_slots/TestWatchpointMultipleSlots.py
index ac2c2fb..e3e96bf 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/multi_watchpoint_slots/TestWatchpointMultipleSlots.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/multi_watchpoint_slots/TestWatchpointMultipleSlots.py
@@ -27,7 +27,7 @@
         self.source = 'main.c'
 
         # Output filename.
-        self.exe_name = 'a.out'
+        self.exe_name = self.getBuildArtifact("a.out")
         self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
 
     # This is a arm and aarch64 specific test case. No other architectures tested.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_hits/TestMultipleHits.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_hits/TestMultipleHits.py
index c21355a..962ba34 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_hits/TestMultipleHits.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_hits/TestMultipleHits.py
@@ -24,7 +24,7 @@
     @skipIf(bugnumber="llvm.org/pr30758", oslist=["linux"], archs=["arm", "aarch64"])
     def test(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target and target.IsValid(), VALID_TARGET)
 
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
index 0c5798f..c0be20d 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
@@ -47,12 +47,8 @@
 
     def hello_multiple_threads(self):
         """Test that lldb watchpoint works for multiple threads."""
-        self.runCmd(
-            "file %s" %
-            os.path.join(
-                os.getcwd(),
-                'a.out'),
-            CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"),
+                    CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
         lldbutil.run_break_set_by_file_and_line(
@@ -99,12 +95,8 @@
 
     def hello_multiple_threads_wp_set_and_then_delete(self):
         """Test that lldb watchpoint works for multiple threads, and after the watchpoint is deleted, the watchpoint event should no longer fires."""
-        self.runCmd(
-            "file %s" %
-            os.path.join(
-                os.getcwd(),
-                'a.out'),
-            CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"),
+                    CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
         lldbutil.run_break_set_by_file_and_line(
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
index 71686a5..5532fd8 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
@@ -29,7 +29,7 @@
     def test(self):
         """Test stepping over watchpoints."""
         self.build()
-        exe = os.path.join(os.getcwd(), 'a.out')
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(self.target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py
index dad633f..104bc61 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py
@@ -35,9 +35,7 @@
     def do_test(self, test_enable):
         """Set a watchpoint, disable it and make sure it doesn't get hit."""
 
-        exe = 'a.out'
-
-        exe = os.path.join(os.getcwd(), exe)
+        exe = self.getBuildArtifact("a.out")
         main_file_spec = lldb.SBFileSpec("main.c")
 
         # Create a target by the debugger.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
index ea25803..cedfad9 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
@@ -33,7 +33,7 @@
         """Test that adding, deleting and modifying watchpoints sends the appropriate events."""
         self.build()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py
index ee4b05c..7e0aa92 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py
@@ -31,12 +31,12 @@
         TestBase.setUp(self)
         # Our simple source filename.
         self.source = 'main.c'
-        self.exe_name = 'a.out'
+        self.exe_name = self.getBuildArtifact("a.out")
         self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
 
     def value_of_vector_variable_with_watchpoint_set(self):
         """Test verify displayed value of vector variable"""
-        exe = os.path.join(os.getcwd(), 'a.out')
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Set break to get a frame
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
index b53e323..c7f7d02 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
@@ -44,7 +44,7 @@
         self.build()
         self.setTearDownCleanup()
 
-        exe = os.path.join(os.getcwd(), 'a.out')
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
index 7460a1c..e6718f0 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
@@ -33,7 +33,7 @@
         self.build()
         self.setTearDownCleanup()
 
-        exe = os.path.join(os.getcwd(), 'a.out')
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/TestWatchpointSizes.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/TestWatchpointSizes.py
index ee64024..542473d 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/TestWatchpointSizes.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/TestWatchpointSizes.py
@@ -28,7 +28,7 @@
         self.source = 'main.c'
 
         # Output filename.
-        self.exe_name = 'a.out'
+        self.exe_name = self.getBuildArtifact("a.out")
         self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
 
     @expectedFailureAll(
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py b/lldb/packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py
index 6d5f61e..930a094 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py
@@ -88,7 +88,7 @@
         self.dbg.SetAsync(False)
 
         # Create a target
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
 
@@ -150,7 +150,7 @@
         self.dbg.SetAsync(False)
 
         # Create a target
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
 
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/array_types/TestArrayTypes.py b/lldb/packages/Python/lldbsuite/test/lang/c/array_types/TestArrayTypes.py
index d4716de..d14534d 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/array_types/TestArrayTypes.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/array_types/TestArrayTypes.py
@@ -24,7 +24,7 @@
     def test_and_run_command(self):
         """Test 'frame variable var_name' on some variables with array types."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
@@ -85,7 +85,7 @@
     def test_and_python_api(self):
         """Use Python APIs to inspect variables with array types."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py b/lldb/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py
index 4d0eb48..22b8a29 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py
@@ -27,7 +27,7 @@
     def test_and_run_command(self):
         """Test 'frame variable ...' on a variable with bitfields."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the main.
@@ -123,7 +123,7 @@
     def test_and_python_api(self):
         """Use Python APIs to inspect a bitfields variable."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/blocks/TestBlocks.py b/lldb/packages/Python/lldbsuite/test/lang/c/blocks/TestBlocks.py
index 4025635..c7693c9 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/blocks/TestBlocks.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/blocks/TestBlocks.py
@@ -26,7 +26,7 @@
 
     def launch_common(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.is_started = False
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py b/lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py
index baa3c91..3ba4628 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py
@@ -18,8 +18,8 @@
 
     def test_conflicting_symbols(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
-        target = self.dbg.CreateTarget("a.out")
+        exe = self.getBuildArtifact("a.out")
+        target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
 
         # Register our shared libraries for remote targets so they get
@@ -89,8 +89,8 @@
     @expectedFailureAll(bugnumber="llvm.org/pr35043")
     def test_shadowed(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
-        target = self.dbg.CreateTarget("a.out")
+        exe = self.getBuildArtifact("a.out")
+        target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
 
         # Register our shared libraries for remote targets so they get
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py b/lldb/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
index d54435a..bf86e03 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
@@ -38,7 +38,7 @@
     def test_and_run_command(self):
         """Test interpreted and JITted expressions on constant values."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the main.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/enum_types/TestEnumTypes.py b/lldb/packages/Python/lldbsuite/test/lang/c/enum_types/TestEnumTypes.py
index b4ea9fa..53ee219 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/enum_types/TestEnumTypes.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/enum_types/TestEnumTypes.py
@@ -24,7 +24,7 @@
     def test(self):
         """Test 'image lookup -t days' and check for correct display and enum value printing."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the main.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/find_struct_type/TestFindStructTypes.py b/lldb/packages/Python/lldbsuite/test/lang/c/find_struct_type/TestFindStructTypes.py
index bbe5be6..75aef29 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/find_struct_type/TestFindStructTypes.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/find_struct_type/TestFindStructTypes.py
@@ -33,7 +33,7 @@
 
     def do_test(self):
         """Make sure FindTypes actually finds 'struct typename' not just 'typename'."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py b/lldb/packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py
index 60e7073..c118ca9 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py
@@ -17,7 +17,7 @@
     def test_and_run_command(self):
         """Display *bar_ptr when stopped on a function with forward declaration of struct bar."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the foo function which takes a bar_ptr argument.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/function_types/TestFunctionTypes.py b/lldb/packages/Python/lldbsuite/test/lang/c/function_types/TestFunctionTypes.py
index 35e902e..7ed8a28 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/function_types/TestFunctionTypes.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/function_types/TestFunctionTypes.py
@@ -66,7 +66,7 @@
                     startstr='(int) $2 = 12')
 
     def runToBreakpoint(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the main.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py b/lldb/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
index dd4da06..0d95bce 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
@@ -27,7 +27,7 @@
         self.build()
 
         # Create a target by the debugger.
-        target = self.dbg.CreateTarget("a.out")
+        target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
         self.assertTrue(target, VALID_TARGET)
 
         # Break inside the main.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/modules/TestCModules.py b/lldb/packages/Python/lldbsuite/test/lang/c/modules/TestCModules.py
index af6c3a7..8d8d57b 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/modules/TestCModules.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/modules/TestCModules.py
@@ -28,7 +28,7 @@
     @skipIf(macos_version=["<", "10.12"])
     def test_expr(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the foo function which takes a bar_ptr argument.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py b/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
index 1f3ae3f..8221148 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
@@ -114,7 +114,7 @@
         register_variables_count = 0
 
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the main.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/set_values/TestSetValues.py b/lldb/packages/Python/lldbsuite/test/lang/c/set_values/TestSetValues.py
index bb94f1c..14677fc 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/set_values/TestSetValues.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/set_values/TestSetValues.py
@@ -28,7 +28,7 @@
     def test(self):
         """Test settings and readings of program variables."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Set breakpoints on several places to set program variables.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py b/lldb/packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py
index 5505d15..95993fe 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py
@@ -73,7 +73,7 @@
         self.dbg.SetAsync(False)
 
         # Create a target by the debugger.
-        target = self.dbg.CreateTarget("a.out")
+        target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
         self.assertTrue(target, VALID_TARGET)
 
         self.runCmd("settings set target.preload-symbols " + str(preload_symbols).lower())
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py b/lldb/packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py
index 7b371a2..c7bc753 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py
@@ -62,7 +62,7 @@
         self.dbg.SetAsync(False)
 
         # Create a target by the debugger.
-        target = self.dbg.CreateTarget("a.out")
+        target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
         self.assertTrue(target, VALID_TARGET)
 
         # Break inside the foo function which takes a bar_ptr argument.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/step-target/TestStepTarget.py b/lldb/packages/Python/lldbsuite/test/lang/c/step-target/TestStepTarget.py
index 90f0786..a767997 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/step-target/TestStepTarget.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/step-target/TestStepTarget.py
@@ -24,7 +24,7 @@
     @add_test_categories(['pyapi'])
     def get_to_start(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/stepping/TestStepAndBreakpoints.py b/lldb/packages/Python/lldbsuite/test/lang/c/stepping/TestStepAndBreakpoints.py
index e1916a5..4a4052c 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/stepping/TestStepAndBreakpoints.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/stepping/TestStepAndBreakpoints.py
@@ -28,7 +28,7 @@
     def test_and_python_api(self):
         """Test stepping over vrs. hitting breakpoints & subsequent stepping in various forms."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/stepping/TestThreadStepping.py b/lldb/packages/Python/lldbsuite/test/lang/c/stepping/TestThreadStepping.py
index c436000..62a0bf8 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/stepping/TestThreadStepping.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/stepping/TestThreadStepping.py
@@ -34,7 +34,7 @@
     def test_step_out_with_run_command(self):
         """Exercise thread step-out and frame select followed by thread step-out."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Create a breakpoint inside function 'c'.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/strings/TestCStrings.py b/lldb/packages/Python/lldbsuite/test/lang/c/strings/TestCStrings.py
index 2782184..b1c8a5e 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/strings/TestCStrings.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/strings/TestCStrings.py
@@ -15,7 +15,7 @@
     def test_with_run_command(self):
         """Tests that C strings work as expected in expressions"""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         line = line_number('main.c', '// breakpoint 1')
         lldbutil.run_break_set_by_file_and_line(
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py b/lldb/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py
index 4388d95..0223858 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py
@@ -48,7 +48,7 @@
     def test(self):
         """Test thread-local storage."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         if self.platformIsDarwin():
             self.registerSharedLibrariesWithTarget(target, ['liba.dylib'])
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py b/lldb/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py
index 71d00c5..bbae76b 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py
@@ -26,7 +26,7 @@
 
     def image_lookup_for_multiple_typedefs(self):
         """Test 'image lookup -t a' at different scopes and check for correct display."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
         typearray = (
             "float",
diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/unions/TestUnionMembers.py b/lldb/packages/Python/lldbsuite/test/lang/c/unions/TestUnionMembers.py
index 496398b..8764f52 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/c/unions/TestUnionMembers.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/c/unions/TestUnionMembers.py
@@ -47,7 +47,7 @@
         self.assertTrue(self.src_file_spec.IsValid(), "breakpoint file")
 
         # Get the path of the executable
-        exe_path = os.path.join(cwd, 'a.out')
+        exe_path = self.getBuildArtifact("a.out")
 
         # Load the executable
         self.target = self.dbg.CreateTarget(exe_path)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/auto/TestCPPAuto.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/auto/TestCPPAuto.py
index 1fb7a52..b10b498 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/auto/TestCPPAuto.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/auto/TestCPPAuto.py
@@ -18,7 +18,7 @@
     def test_with_run_command(self):
         """Test that auto types work in the expression parser"""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         line = line_number('main.cpp', '// break here')
         lldbutil.run_break_set_by_file_and_line(
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/bool/TestCPPBool.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/bool/TestCPPBool.py
index 01f8cba..27ea773 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/bool/TestCPPBool.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/bool/TestCPPBool.py
@@ -13,7 +13,7 @@
     def test_with_run_command(self):
         """Test that bool types work in the expression parser"""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         line = line_number('main.cpp', '// breakpoint 1')
         lldbutil.run_break_set_by_file_and_line(
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py
index 81787e1..a120510 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py
@@ -35,7 +35,7 @@
         """Test a sequence of breakpoint command add, list, and delete."""
         self.build()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target from the debugger.
 
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/call-function/TestCallCPPFunction.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/call-function/TestCallCPPFunction.py
index b86cd2a..9b227bc 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/call-function/TestCallCPPFunction.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/call-function/TestCallCPPFunction.py
@@ -22,7 +22,7 @@
     def test_with_run_command(self):
         """Test calling a function by basename"""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/chained-calls/TestCppChainedCalls.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/chained-calls/TestCppChainedCalls.py
index 0145bee..5cbcfdf 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/chained-calls/TestCppChainedCalls.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/chained-calls/TestCppChainedCalls.py
@@ -19,7 +19,7 @@
 
         # Get the path of the executable
         cwd = os.getcwd()
-        exe_file = "a.out"
+        exe_file = self.getBuildArtifact("a.out")
         exe_path = os.path.join(cwd, exe_file)
 
         # Load the executable
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py
index bf86051..e37e76a 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py
@@ -32,7 +32,7 @@
     def test(self):
         """Test that the C++11 support for char16_t and char32_t works correctly."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
index d167f0a..e48538e 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
@@ -27,7 +27,7 @@
     def test_with_run_command(self):
         """Test that file and class static variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
@@ -67,7 +67,7 @@
     def test_with_python_api(self):
         """Test Python APIs on file and class static variables."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypes.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypes.py
index c915e4b..759da71 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypes.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypes.py
@@ -24,7 +24,7 @@
     def test_with_run_command(self):
         """Test 'frame variable this' when stopped on a class constructor."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break on the ctor function of class C.
@@ -61,7 +61,7 @@
     def test_with_python_api(self):
         """Use Python APIs to create a breakpoint by (filespec, line)."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -72,7 +72,8 @@
         fsDir = os.path.normpath(filespec.GetDirectory())
         fsFile = filespec.GetFilename()
 
-        self.assertTrue(fsDir == os.getcwd() and fsFile == "a.out",
+        self.assertTrue(fsDir == os.path.dirname(self.getBuildArtifact())
+                        and fsFile == "a.out",
                         "FileSpec matches the executable")
 
         bpfilespec = lldb.SBFileSpec("main.cpp", False)
@@ -119,7 +120,7 @@
     def test_with_expr_parser(self):
         """Test 'frame variable this' and 'expr this' when stopped inside a constructor."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # rdar://problem/8516141
@@ -176,7 +177,7 @@
     def test_with_constructor_name(self):
         """Test 'frame variable this' and 'expr this' when stopped inside a constructor."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -187,7 +188,8 @@
         fsDir = os.path.normpath(filespec.GetDirectory())
         fsFile = filespec.GetFilename()
 
-        self.assertTrue(fsDir == os.getcwd() and fsFile == "a.out",
+        self.assertTrue(fsDir == os.path.dirname(self.getBuildArtifact())
+                        and fsFile == "a.out",
                         "FileSpec matches the executable")
 
         bpfilespec = lldb.SBFileSpec("main.cpp", False)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypesDisassembly.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypesDisassembly.py
index bc85ba5..c838178 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypesDisassembly.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypesDisassembly.py
@@ -78,7 +78,7 @@
 
     def breakOnCtor(self):
         """Setup/run the program so it stops on C's constructor."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break on the ctor function of class C.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/diamond/TestDiamond.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/diamond/TestDiamond.py
index c6f9d85..c1d0d23 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/diamond/TestDiamond.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/diamond/TestDiamond.py
@@ -13,7 +13,7 @@
     def test_with_run_command(self):
         """Test that virtual base classes work in when SBValue objects are used to explore the variable value"""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestDynamicValue.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestDynamicValue.py
index 42db14f..acda426 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestDynamicValue.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestDynamicValue.py
@@ -37,7 +37,7 @@
     def test_get_dynamic_vals(self):
         """Test fetching C++ dynamic values from pointers & references."""
         self.build(dictionary=self.getBuildFlags())
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target from the debugger.
 
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
index 82e44fb..7f7b825 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
@@ -78,7 +78,7 @@
 
     def image_lookup_for_enum_type(self):
         """Test C++11 enumeration class types."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the main.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py
index 4bc3320..d1aea00 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py
@@ -30,7 +30,7 @@
     def test(self):
         """Test lldb exception breakpoint command for CPP."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target from the debugger.
 
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
index c37107e..6352b68 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
@@ -13,7 +13,7 @@
     def test_with_run_command(self):
         """Tests that frame variable looks into anonymous unions"""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         line = line_number('main.cpp', '// break here')
         lldbutil.run_break_set_by_file_and_line(
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/global_operators/TestCppGlobalOperators.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/global_operators/TestCppGlobalOperators.py
index 21d86f9..866bae7 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/global_operators/TestCppGlobalOperators.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/global_operators/TestCppGlobalOperators.py
@@ -21,8 +21,7 @@
 
         # Get the path of the executable
         cwd = os.getcwd()
-        exe_file = "a.out"
-        exe_path = os.path.join(cwd, exe_file)
+        exe_path = self.getBuildArtifact("a.out")
 
         # Load the executable
         target = self.dbg.CreateTarget(exe_path)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
index dcc9206..a4bfd73 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
@@ -19,7 +19,7 @@
         self.assertTrue(src_file_spec.IsValid(), "breakpoint file")
 
         # Get the path of the executable
-        exe_path = os.path.join(cwd, 'a.out')
+        exe_path = self.getBuildArtifact("a.out")
 
         # Load the executable
         target = self.dbg.CreateTarget(exe_path)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/inlines/TestInlines.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/inlines/TestInlines.py
index 2dc7298..f7b92e8 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/inlines/TestInlines.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/inlines/TestInlines.py
@@ -39,7 +39,7 @@
                     startstr='(int) $0 =')
 
     def runToBreakpoint(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the main.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
index 89086e7..f7a3f91e 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
@@ -19,7 +19,7 @@
         self.assertTrue(src_file_spec.IsValid(), "breakpoint file")
 
         # Get the path of the executable
-        exe_path = os.path.join(cwd, 'a.out')
+        exe_path = self.getBuildArtifact("a.out")
 
         # Load the executable
         target = self.dbg.CreateTarget(exe_path)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/TestMembersAndLocalsWithSameName.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/TestMembersAndLocalsWithSameName.py
index 977ad7d..011cf49 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/TestMembersAndLocalsWithSameName.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/TestMembersAndLocalsWithSameName.py
@@ -221,7 +221,7 @@
         self.assertTrue(self.src_file_spec.IsValid(), "breakpoint file")
 
         # Get the path of the executable
-        exe_path = os.path.join(cwd, 'a.out')
+        exe_path = self.getBuildArtifact("a.out")
 
         # Load the executable
         self.target = self.dbg.CreateTarget(exe_path)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespace.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespace.py
index f0bc12c..a3c31e63 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespace.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespace.py
@@ -31,7 +31,7 @@
             "A::func(int)"]
 
         # Create a target by the debugger.
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
         module_list = lldb.SBFileSpecList()
@@ -56,7 +56,7 @@
         names = ["func()", "func(int)"]
 
         # Create a target by the debugger.
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
         module_list = lldb.SBFileSpecList()
@@ -81,7 +81,7 @@
         names = ["A::func()", "A::func(int)"]
 
         # Create a target by the debugger.
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
         module_list = lldb.SBFileSpecList()
@@ -132,7 +132,7 @@
     def test_with_run_command(self):
         """Test that anonymous and named namespace variables display correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self,
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py
index 18e45d9..2837cfd 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py
@@ -50,7 +50,7 @@
     def test_scope_lookup_with_run_command(self):
         """Test scope lookup of functions in lldb."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self,
@@ -151,7 +151,7 @@
     def test_function_scope_lookup_with_run_command(self):
         """Test scope lookup of functions in lldb."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self,
@@ -188,7 +188,7 @@
     def test_file_scope_lookup_with_run_command(self):
         """Test file scope lookup in lldb."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self,
@@ -208,7 +208,7 @@
     def test_scope_lookup_before_using_with_run_command(self):
         """Test scope lookup before using in lldb."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self,
@@ -238,7 +238,7 @@
     def test_scope_after_using_directive_lookup_with_run_command(self):
         """Test scope lookup after using directive in lldb."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self,
@@ -260,7 +260,7 @@
     def test_scope_after_using_declaration_lookup_with_run_command(self):
         """Test scope lookup after using declaration in lldb."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self,
@@ -279,7 +279,7 @@
     def test_scope_ambiguity_after_using_lookup_with_run_command(self):
         """Test scope lookup ambiguity after using in lldb."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self,
@@ -305,7 +305,7 @@
     def test_scope_lookup_shadowed_by_using_with_run_command(self):
         """Test scope lookup shadowed by using in lldb."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self,
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/TestNamespaceDefinitions.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/TestNamespaceDefinitions.py
index 7160ddd..1f3fbd8 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/TestNamespaceDefinitions.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/TestNamespaceDefinitions.py
@@ -46,7 +46,7 @@
         self.dbg.SetAsync(False)
 
         # Create a target by the debugger.
-        target = self.dbg.CreateTarget("a.out")
+        target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
         self.assertTrue(target, VALID_TARGET)
 
         # Break inside the foo function which takes a bar_ptr argument.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py
index fd19de7..b1e6e08 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py
@@ -22,8 +22,7 @@
 
         # Get the path of the executable
         cwd = os.getcwd()
-        exe_file = "a.out"
-        exe_path = os.path.join(cwd, exe_file)
+        exe_path = self.getBuildArtifact("a.out")
 
         # Load the executable
         target = self.dbg.CreateTarget(exe_path)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py
index 3d8788f..996396d 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py
@@ -22,7 +22,7 @@
     def test_with_run_command(self):
         """Test that functions with the same name are resolved correctly"""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/rvalue-references/TestRvalueReferences.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/rvalue-references/TestRvalueReferences.py
index 11d221e..cc79366 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/rvalue-references/TestRvalueReferences.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/rvalue-references/TestRvalueReferences.py
@@ -22,7 +22,7 @@
     def test_with_run_command(self):
         """Test that rvalues are supported in the C++ expression parser"""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         self.set_breakpoint(line_number('main.cpp', '// breakpoint 1'))
         self.set_breakpoint(line_number('main.cpp', '// breakpoint 2'))
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/scope/TestCppScope.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/scope/TestCppScope.py
index d5ff93f..ba1e6bd 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/scope/TestCppScope.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/scope/TestCppScope.py
@@ -29,8 +29,7 @@
 
         # Get the path of the executable
         cwd = os.getcwd()
-        exe_file = "a.out"
-        exe_path = os.path.join(cwd, exe_file)
+        exe_path = self.getBuildArtifact("a.out")
 
         # Load the executable
         target = self.dbg.CreateTarget(exe_path)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/signed_types/TestSignedTypes.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/signed_types/TestSignedTypes.py
index 5925b10..36546a5 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/signed_types/TestSignedTypes.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/signed_types/TestSignedTypes.py
@@ -33,7 +33,7 @@
         self.dbg.SetAsync(False)
 
         # Create a target by the debugger.
-        target = self.dbg.CreateTarget("a.out")
+        target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
         self.assertTrue(target, VALID_TARGET)
 
         lldbutil.run_break_set_by_file_and_line(
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/static_members/TestCPPStaticMembers.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/static_members/TestCPPStaticMembers.py
index 16b5675..b8c777f 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/static_members/TestCPPStaticMembers.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/static_members/TestCPPStaticMembers.py
@@ -21,7 +21,7 @@
     def test_with_run_command(self):
         """Test that member variables have the correct layout, scope and qualifiers when stopped inside and outside C++ methods"""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         self.set_breakpoint(line_number('main.cpp', '// breakpoint 1'))
         self.set_breakpoint(line_number('main.cpp', '// breakpoint 2'))
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/static_methods/TestCPPStaticMethods.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/static_methods/TestCPPStaticMethods.py
index 9c26305..404ef22 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/static_methods/TestCPPStaticMethods.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/static_methods/TestCPPStaticMethods.py
@@ -20,7 +20,7 @@
     def test_with_run_command(self):
         """Test that static methods are properly distinguished from regular methods"""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/stl/TestSTL.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/stl/TestSTL.py
index ce58697..afaf9d1 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/stl/TestSTL.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/stl/TestSTL.py
@@ -30,7 +30,7 @@
     def test(self):
         """Test some expressions involving STL data types."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # The following two lines, if uncommented, will enable loggings.
         #self.ci.HandleCommand("log enable -f /tmp/lldb.log lldb default", res)
@@ -78,7 +78,7 @@
     def test_SBType_template_aspects(self):
         """Test APIs for getting template arguments from an SBType."""
         self.build()
-        exe = os.path.join(os.getcwd(), 'a.out')
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py
index 47fdf59..23e94e9 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py
@@ -31,7 +31,7 @@
     def test_stdcxx_disasm(self):
         """Do 'disassemble' on each and every 'Code' symbol entry from the std c++ lib."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # rdar://problem/8543077
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
index b59f966..5e90b8b 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
@@ -19,7 +19,7 @@
         self.build()
 
         # Create a target by the debugger.
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
 
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/this/TestCPPThis.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/this/TestCPPThis.py
index ed2e257..43b00f9 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/this/TestCPPThis.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/this/TestCPPThis.py
@@ -24,7 +24,7 @@
     def test_with_run_command(self):
         """Test that the appropriate member variables are available when stopped in C++ static, inline, and const methods"""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         self.set_breakpoint(line_number('main.cpp', '// breakpoint 1'))
         self.set_breakpoint(line_number('main.cpp', '// breakpoint 2'))
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/unicode-literals/TestUnicodeLiterals.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/unicode-literals/TestUnicodeLiterals.py
index 842d03a..216f860 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/unicode-literals/TestUnicodeLiterals.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/unicode-literals/TestUnicodeLiterals.py
@@ -69,7 +69,7 @@
             self.skipTest(
                 "Skipping because this test is known to crash on i386")
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/unique-types/TestUniqueTypes.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/unique-types/TestUniqueTypes.py
index 3afac33..1f9e17f 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/unique-types/TestUniqueTypes.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/unique-types/TestUniqueTypes.py
@@ -33,7 +33,7 @@
             self.skipTest(
                 "rdar://problem/9173060 lldb hangs while running unique-types for clang version < 3")
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=-1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/unsigned_types/TestUnsignedTypes.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
index 0189a65..3e93160 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
@@ -27,7 +27,7 @@
     def test(self):
         """Test that variables with unsigned types display correctly."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # GCC puts a breakpoint on the last line of a multi-line expression, so
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual/TestVirtual.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual/TestVirtual.py
index 7356484..b3fe9c4 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual/TestVirtual.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual/TestVirtual.py
@@ -45,7 +45,7 @@
         self.dbg.SetAsync(False)
 
         # Create a target by the debugger.
-        target = self.dbg.CreateTarget("a.out")
+        target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
         self.assertTrue(target, VALID_TARGET)
 
         # Create the breakpoint inside function 'main'.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/wchar_t/TestCxxWCharT.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/wchar_t/TestCxxWCharT.py
index f17ba6f..f31ba9b 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/wchar_t/TestCxxWCharT.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/wchar_t/TestCxxWCharT.py
@@ -28,7 +28,7 @@
     def test(self):
         """Test that C++ supports wchar_t correctly."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py b/lldb/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py
index 306b008..f067d1c 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py
@@ -40,7 +40,7 @@
             self.assertEqual(size, t.size)
 
     def launchProcess(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/go/formatters/TestGoFormatters.py b/lldb/packages/Python/lldbsuite/test/lang/go/formatters/TestGoFormatters.py
index c48cd1f..b31ac35 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/go/formatters/TestGoFormatters.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/go/formatters/TestGoFormatters.py
@@ -31,7 +31,7 @@
         self.break_line = line_number(self.main_source, '// stop here')
 
     def launchProcess(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/go/goroutines/TestGoroutines.py b/lldb/packages/Python/lldbsuite/test/lang/go/goroutines/TestGoroutines.py
index e0cf9e8..027fb3a 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/go/goroutines/TestGoroutines.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/go/goroutines/TestGoroutines.py
@@ -36,7 +36,7 @@
         self.break_line3 = line_number(self.main_source, '// stop3')
 
     def launchProcess(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime b/lldb/packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime
index 30381cc..b06aa65 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime
+++ b/lldb/packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime
@@ -30,7 +30,7 @@
 
 
     def launchProcess(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py b/lldb/packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py
index 9571e25..8fb56b9 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py
@@ -46,7 +46,7 @@
             self.assertEqual(size, t.size)
 
     def launchProcess(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/mixed/TestMixedLanguages.py b/lldb/packages/Python/lldbsuite/test/lang/mixed/TestMixedLanguages.py
index e7615c8..2ba57e6 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/mixed/TestMixedLanguages.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/mixed/TestMixedLanguages.py
@@ -17,7 +17,7 @@
     def test_language_of_frame(self):
         """Test that the language defaults to the language of the current frame."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Execute the cleanup function during test case tear down
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/blocks/TestObjCIvarsInBlocks.py b/lldb/packages/Python/lldbsuite/test/lang/objc/blocks/TestObjCIvarsInBlocks.py
index 74e4f3b..d69a171 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/blocks/TestObjCIvarsInBlocks.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/blocks/TestObjCIvarsInBlocks.py
@@ -31,7 +31,7 @@
     def test_with_python_api(self):
         """Test printing the ivars of the self when captured in blocks"""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestConflictingDefinition.py b/lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestConflictingDefinition.py
index df3a41f..264a17c 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestConflictingDefinition.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestConflictingDefinition.py
@@ -46,7 +46,7 @@
                 "42"])
 
     def common_setup(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.registerSharedLibrariesWithTarget(target, self.shlib_names)
 
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/forward-decl/TestForwardDecl.py b/lldb/packages/Python/lldbsuite/test/lang/objc/forward-decl/TestForwardDecl.py
index aa2b659..c89a36a 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/forward-decl/TestForwardDecl.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/forward-decl/TestForwardDecl.py
@@ -28,7 +28,7 @@
         self.build()
 
         # Create a target by the debugger.
-        target = self.dbg.CreateTarget("a.out")
+        target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
         self.assertTrue(target, VALID_TARGET)
 
         # Create the breakpoint inside function 'main'.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestConstStrings.py b/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestConstStrings.py
index 2a81c42..95c5575 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestConstStrings.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestConstStrings.py
@@ -32,7 +32,7 @@
         self.build(dictionary=self.d)
         self.setTearDownCleanup(self.d)
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestFoundationDisassembly.py b/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestFoundationDisassembly.py
index 51d9d22..345e41b 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestFoundationDisassembly.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestFoundationDisassembly.py
@@ -32,7 +32,7 @@
         self.dbg.SetAsync(False)
 
         # Create a target by the debugger.
-        target = self.dbg.CreateTarget("a.out")
+        target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
         self.assertTrue(target, VALID_TARGET)
 
         # Now launch the process, and do not stop at entry point.
@@ -76,7 +76,7 @@
         self.build()
 
         # Create a target by the debugger.
-        target = self.dbg.CreateTarget("a.out")
+        target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
         self.assertTrue(target, VALID_TARGET)
 
         print(target)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods.py b/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods.py
index d636458..b432d47 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods.py
@@ -35,7 +35,7 @@
     def test_break(self):
         """Test setting objc breakpoints using '_regexp-break' and 'breakpoint set'."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Stop at +[NSString stringWithFormat:].
@@ -117,7 +117,7 @@
     def test_data_type_and_expr(self):
         """Lookup objective-c data types and evaluate expressions."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Stop at -[MyString description].
@@ -230,7 +230,7 @@
         self.build()
         # See: <rdar://problem/8717050> lldb needs to use the ObjC runtime symbols for ivar offsets
         # Only fails for the ObjC 2.0 runtime.
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -280,7 +280,7 @@
     def test_expression_lookups_objc(self):
         """Test running an expression detect spurious debug info lookups (DWARF)."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Stop at -[MyString initWithNSString:].
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py b/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py
index ce7e774..2b967e9 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py
@@ -47,7 +47,7 @@
     def test_more_expr_commands(self):
         """More expression commands for objective-c."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Create a bunch of breakpoints.
@@ -84,7 +84,7 @@
     def test_NSArray_expr_commands(self):
         """Test expression commands for NSArray."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside Test_NSArray:
@@ -111,7 +111,7 @@
     def test_NSString_expr_commands(self):
         """Test expression commands for NSString."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside Test_NSString:
@@ -141,7 +141,7 @@
     def test_MyString_dump_with_runtime(self):
         """Test dump of a known Objective-C object by dereferencing it."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         line = self.lines[4]
@@ -162,7 +162,7 @@
     def test_runtime_types(self):
         """Test commands that require runtime types"""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside Test_NSString:
@@ -190,7 +190,7 @@
     def test_NSError_p(self):
         """Test that p of the result of an unknown method does require a cast."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         line = self.lines[4]
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestRuntimeTypes.py b/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestRuntimeTypes.py
index 334ebba..c52ac8c 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestRuntimeTypes.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestRuntimeTypes.py
@@ -28,7 +28,7 @@
             self.skipTest("This only applies to the v2 runtime")
 
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Stop at -[MyString description].
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestSymbolTable.py b/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestSymbolTable.py
index 6e5bc4d..bfb9e0b 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestSymbolTable.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/foundation/TestSymbolTable.py
@@ -36,7 +36,7 @@
     def test_with_python_api(self):
         """Test symbol table access with Python APIs."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/global_ptrs/TestGlobalObjects.py b/lldb/packages/Python/lldbsuite/test/lang/objc/global_ptrs/TestGlobalObjects.py
index bcd4a41..dcabd72 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/global_ptrs/TestGlobalObjects.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/global_ptrs/TestGlobalObjects.py
@@ -25,7 +25,7 @@
     def test_with_python_api(self):
         """Test that a global ObjC object found before the process is started updates correctly."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/hidden-ivars/TestHiddenIvars.py b/lldb/packages/Python/lldbsuite/test/lang/objc/hidden-ivars/TestHiddenIvars.py
index ee21189a..96ac6d7 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/hidden-ivars/TestHiddenIvars.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/hidden-ivars/TestHiddenIvars.py
@@ -89,10 +89,12 @@
                                              '-rf',
                                              'libInternalDefiner.dylib.dSYM']) == 0,
                             'remove dylib dSYM file succeeded')
-            self.assertTrue(subprocess.call(
-                ['/usr/bin/strip', '-Sx', 'a.out']) == 0, 'stripping a.out succeeded')
+            self.assertTrue(subprocess.call(['/usr/bin/strip', '-Sx',
+                                             self.getBuildArtifact("a.out")
+                                            ]) == 0,
+                            'stripping a.out succeeded')
         # Create a target by the debugger.
-        target = self.dbg.CreateTarget("a.out")
+        target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
         self.assertTrue(target, VALID_TARGET)
 
         # Create the breakpoint inside function 'main'.
@@ -109,7 +111,7 @@
             None, environment, self.get_process_working_directory())
         self.assertTrue(process, PROCESS_IS_VALID)
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the foo function which takes a bar_ptr argument.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py b/lldb/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
index d294767..ad7f96c 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
@@ -35,7 +35,7 @@
     def test_imp_ivar_type(self):
         """Test that dynamically discovered ivars of type IMP do not crash LLDB"""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target from the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py b/lldb/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py
index f01cc12..2646318 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py
@@ -29,7 +29,7 @@
     @skipIf(macos_version=["<", "10.12"])
     def test_expr(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the foo function which takes a bar_ptr argument.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py b/lldb/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py
index 367eeb2..8cfd7d2 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py
@@ -27,7 +27,7 @@
     @skipIf(macos_version=["<", "10.12"])
     def test_expr(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the foo function which takes a bar_ptr argument.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py b/lldb/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py
index 328335d..9e7f757 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py
@@ -30,7 +30,7 @@
     @skipIf(macos_version=["<", "10.12"])
     def test_expr(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the foo function which takes a bar_ptr argument.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/modules/TestObjCModules.py b/lldb/packages/Python/lldbsuite/test/lang/objc/modules/TestObjCModules.py
index 526b4a7..9308132 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/modules/TestObjCModules.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/modules/TestObjCModules.py
@@ -33,7 +33,7 @@
             return
 
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the foo function which takes a bar_ptr argument.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc++/TestObjCXX.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc++/TestObjCXX.py
index 5b91f98..996ec6c 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc++/TestObjCXX.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc++/TestObjCXX.py
@@ -24,7 +24,7 @@
             self.skipTest("requires Objective-C 2.0 runtime")
 
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_source_regexp(
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
index 0f82cc6..7bba071 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
@@ -33,7 +33,7 @@
             self.skipTest("Dynamic types for ObjC V1 runtime not implemented")
 
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target from the debugger.
 
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py
index d92daab..0aa8318 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py
@@ -29,7 +29,7 @@
     def test_with_python_api(self):
         """Test expression parser respect for ObjC built-in types."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-checker/TestObjCCheckers.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-checker/TestObjCCheckers.py
index 1bd8f1a..644cd87 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-checker/TestObjCCheckers.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-checker/TestObjCCheckers.py
@@ -33,7 +33,7 @@
             self.skipTest("requires Objective-C 2.0 runtime")
 
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target from the debugger.
 
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-class-method/TestObjCClassMethod.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-class-method/TestObjCClassMethod.py
index 562c0cf..8470d77 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-class-method/TestObjCClassMethod.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-class-method/TestObjCClassMethod.py
@@ -28,7 +28,7 @@
     def test_with_python_api(self):
         """Test calling functions in class methods."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
index a115d4f..e9df6be 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
@@ -43,7 +43,7 @@
             self.skipTest("Dynamic types for ObjC V1 runtime not implemented")
 
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target from the debugger.
 
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py
index 03121e6..6b92845 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py
@@ -28,7 +28,7 @@
     def test_with_python_api(self):
         """Test printing ObjC objects that use unbacked properties"""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py
index dde9eba..f5997eb 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py
@@ -31,12 +31,12 @@
     def test_with_python_api(self):
         """Test that we can find stripped Objective-C ivars in the runtime"""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out.stripped")
+        exe = self.getBuildArtifact("a.out.stripped")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
 
-        self.dbg.HandleCommand("add-dsym a.out.dSYM")
+        self.dbg.HandleCommand("add-dsym "+self.getBuildArtifact("a.out.dSYM"))
 
         breakpoint = target.BreakpointCreateByLocation(
             self.main_source, self.stop_line)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
index 84b1257..7425634 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
@@ -28,7 +28,7 @@
 
     def runToBreakpoint(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the foo function which takes a bar_ptr argument.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-optimized/TestObjcOptimized.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-optimized/TestObjcOptimized.py
index 08e9594..340d884 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-optimized/TestObjcOptimized.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-optimized/TestObjcOptimized.py
@@ -34,7 +34,7 @@
     def test_break(self):
         """Test 'expr member' continues to work for optimized build."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_symbol(
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py
index 790bc9c..2a9a5af 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py
@@ -33,7 +33,7 @@
             self.skipTest("requires modern objc runtime")
 
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target from the debugger.
 
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py
index 65dc5ac..ed96941 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py
@@ -34,7 +34,7 @@
         if self.getArchitecture() == 'i386':
             self.skipTest("requires modern objc runtime")
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-static-method/TestObjCStaticMethod.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-static-method/TestObjCStaticMethod.py
index 9f74d86..37b41cd 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-static-method/TestObjCStaticMethod.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-static-method/TestObjCStaticMethod.py
@@ -29,7 +29,7 @@
     def test_with_python_api(self):
         """Test calling functions in static methods."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-stepping/TestObjCStepping.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-stepping/TestObjCStepping.py
index 95eb6e5..9e949dc 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-stepping/TestObjCStepping.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-stepping/TestObjCStepping.py
@@ -36,7 +36,7 @@
     def test_with_python_api(self):
         """Test stepping through ObjC method dispatch in various forms."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py
index 650923a..4195f60 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py
@@ -29,7 +29,7 @@
     def test_with_python_api(self):
         """Test passing structs to Objective-C methods."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-return/TestObjCStructReturn.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-return/TestObjCStructReturn.py
index 6e56c06..6f6fd92 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-return/TestObjCStructReturn.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-return/TestObjCStructReturn.py
@@ -28,7 +28,7 @@
     def test_with_python_api(self):
         """Test calling functions in class methods."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-super/TestObjCSuper.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-super/TestObjCSuper.py
index d1d755e..5b10bc5 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-super/TestObjCSuper.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-super/TestObjCSuper.py
@@ -28,7 +28,7 @@
     def test_with_python_api(self):
         """Test calling methods on super."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/ptr_refs/TestPtrRefsObjC.py b/lldb/packages/Python/lldbsuite/test/lang/objc/ptr_refs/TestPtrRefsObjC.py
index e563315..74d08f7 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/ptr_refs/TestPtrRefsObjC.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/ptr_refs/TestPtrRefsObjC.py
@@ -19,8 +19,7 @@
     def test_ptr_refs(self):
         """Test the ptr_refs tool on Darwin with Objective-C"""
         self.build()
-        exe_name = 'a.out'
-        exe = os.path.join(os.getcwd(), exe_name)
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/real-definition/TestRealDefinition.py b/lldb/packages/Python/lldbsuite/test/lang/objc/real-definition/TestRealDefinition.py
index 820ddcd..d476007 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/real-definition/TestRealDefinition.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/real-definition/TestRealDefinition.py
@@ -92,7 +92,7 @@
                 "foo->_bar->_hidden_ivar = 0x"])
 
     def common_setup(self):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the foo function which takes a bar_ptr argument.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/self/TestObjCSelf.py b/lldb/packages/Python/lldbsuite/test/lang/objc/self/TestObjCSelf.py
index 48c4313..81d6b79 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/self/TestObjCSelf.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/self/TestObjCSelf.py
@@ -15,7 +15,7 @@
     def test_with_run_command(self):
         """Test that the appropriate member variables are available when stopped in Objective-C class and instance methods"""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         self.set_breakpoint(line_number('main.m', '// breakpoint 1'))
         self.set_breakpoint(line_number('main.m', '// breakpoint 2'))
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/single-entry-dictionary/TestObjCSingleEntryDictionary.py b/lldb/packages/Python/lldbsuite/test/lang/objc/single-entry-dictionary/TestObjCSingleEntryDictionary.py
index 54011db..21f0892 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/single-entry-dictionary/TestObjCSingleEntryDictionary.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/single-entry-dictionary/TestObjCSingleEntryDictionary.py
@@ -30,7 +30,7 @@
     @expectedFailureAll(oslist=['watchos'], bugnumber="rdar://problem/34642736") # bug in NSDictionary formatting on watchos
     def test_single_entry_dict(self):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the foo function which takes a bar_ptr argument.
diff --git a/lldb/packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py b/lldb/packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py
index 477ddf9..52167d0 100644
--- a/lldb/packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py
+++ b/lldb/packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py
@@ -23,7 +23,7 @@
         even if gnu.build-id and gnu_debuglink are not present in the module.
         Similar to test_add_dsym_mid_execution test for macos."""
         self.build(clean=True)
-        exe = os.path.join(os.getcwd(), "stripped.out")
+        exe = self.getBuildArtifact("stripped.out")
 
         self.target = self.dbg.CreateTarget(exe)
         self.assertTrue(self.target, VALID_TARGET)
@@ -46,7 +46,8 @@
         self.expect("frame select", substrs=['main.c'], matching=False)
 
         # Tell LLDB that a.out has symbols for stripped.out
-        self.runCmd("target symbols add -s stripped.out a.out")
+        self.runCmd("target symbols add -s %s %s" %
+                    exe, self.getBuildArtifact("a.out"))
 
         # Check that symbols are now loaded and main.c is in the output.
         self.expect("frame select", substrs=['main.c'])
diff --git a/lldb/packages/Python/lldbsuite/test/linux/builtin_trap/TestBuiltinTrap.py b/lldb/packages/Python/lldbsuite/test/linux/builtin_trap/TestBuiltinTrap.py
index f24cae9..7ffc29f 100644
--- a/lldb/packages/Python/lldbsuite/test/linux/builtin_trap/TestBuiltinTrap.py
+++ b/lldb/packages/Python/lldbsuite/test/linux/builtin_trap/TestBuiltinTrap.py
@@ -30,7 +30,7 @@
     def test_with_run_command(self):
         """Test that LLDB handles a function with __builtin_trap correctly."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(self, "main.cpp", self.line,
                                                 num_expected_locations=1,
diff --git a/lldb/packages/Python/lldbsuite/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py b/lldb/packages/Python/lldbsuite/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
index 0685947..702d124 100644
--- a/lldb/packages/Python/lldbsuite/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
+++ b/lldb/packages/Python/lldbsuite/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
@@ -26,7 +26,7 @@
         bugnumber="llvm.org/pr24737")
     def test_step_inst(self):
         self.build(dictionary=self.getBuildFlags())
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target and target.IsValid(), "Target is valid")
 
diff --git a/lldb/packages/Python/lldbsuite/test/lldbinline.py b/lldb/packages/Python/lldbsuite/test/lldbinline.py
index 70a0dda..3f10b2a 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbinline.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbinline.py
@@ -166,8 +166,7 @@
         exec(__command, globals(), locals())
 
     def do_test(self):
-        exe_name = "a.out"
-        exe = os.path.join(os.getcwd(), exe_name)
+        exe = self.getBuildArtifact("a.out")
         source_files = [f for f in os.listdir(os.getcwd()) if source_type(f)]
         target = self.dbg.CreateTarget(exe)
 
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index ecc38f3..b16c0c8 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -1573,7 +1573,8 @@
     def buildGo(self):
         """Build the default go binary.
         """
-        system([[which('go'), 'build -gcflags "-N -l" -o a.out main.go']])
+        exe = self.getBuildArtifact("a.out")
+        system([[which('go'), 'build -gcflags "-N -l" -o %s main.go' % exe]])
 
     def signBinary(self, binary_path):
         if sys.platform.startswith("darwin"):
@@ -2268,6 +2269,10 @@
         else:
             self.fail("Can't build for debug info: %s" % self.debug_info)
 
+    def getBuildArtifact(self, name="a.out"):
+        """Return absolute path to an artifact in the test's build directory."""
+        return os.path.join(os.getcwd(), name)
+            
     def run_platform_command(self, cmd):
         platform = self.dbg.GetSelectedPlatform()
         shell_command = lldb.SBPlatformShellCommand(cmd)
diff --git a/lldb/packages/Python/lldbsuite/test/lldbutil.py b/lldb/packages/Python/lldbsuite/test/lldbutil.py
index 58a1ead..62a69a3 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -725,19 +725,29 @@
             threads.append(thread)
     return threads
 
-def run_to_source_breakpoint(test, bkpt_pattern, source_spec, launch_info = None, exe_name = "a.out", in_cwd = True):
-    """Start up a target, using exe_name as the executable, and run it to 
+def run_to_source_breakpoint(test, bkpt_pattern, source_spec,
+                             launch_info = None, exe_name = "a.out",
+                             in_cwd = True):
+    """Start up a target, using exe_name as the executable, and run it to
        a breakpoint set by source regex bkpt_pattern.
-       If you want to pass in launch arguments or environment variables, you can optionally pass in 
-       an SBLaunchInfo.  If you do that, remember to set the working directory as well.
-       If your executable isn't called a.out, you can pass that in.  And if your executable isn't
-       in the CWD, pass in the absolute path to the executable in exe_name, and set in_cwd to False.
+
+       If you want to pass in launch arguments or environment
+       variables, you can optionally pass in an SBLaunchInfo.  If you
+       do that, remember to set the working directory as well.
+
+       If your executable isn't called a.out, you can pass that in.
+       And if your executable isn't in the CWD, pass in the absolute
+       path to the executable in exe_name, and set in_cwd to False.
+
        If the target isn't valid, the breakpoint isn't found, or hit, the
        function will cause a testsuite failure.
-       If successful it returns a tuple with the target process and thread that hit the breakpoint."""
+
+       If successful it returns a tuple with the target process and
+       thread that hit the breakpoint.
+    """
 
     if in_cwd:
-        exe = os.path.join(os.getcwd(), exe_name)
+        exe = test.getBuildArtifact(exe_name)
     
     # Create the target
     target = test.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/logging/TestLogging.py b/lldb/packages/Python/lldbsuite/test/logging/TestLogging.py
index 690c4f6..e8edae1 100644
--- a/lldb/packages/Python/lldbsuite/test/logging/TestLogging.py
+++ b/lldb/packages/Python/lldbsuite/test/logging/TestLogging.py
@@ -34,7 +34,7 @@
             self.command_log_tests("dwarf")
 
     def command_log_tests(self, type):
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.expect("file " + exe,
                     patterns=["Current executable set to .*a.out"])
 
diff --git a/lldb/packages/Python/lldbsuite/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py b/lldb/packages/Python/lldbsuite/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
index ec20ee2..ff22287 100644
--- a/lldb/packages/Python/lldbsuite/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
+++ b/lldb/packages/Python/lldbsuite/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
@@ -26,7 +26,7 @@
     def test_add_dsym_mid_execution(self):
         """Test that add-dsym mid-execution loads the symbols at the right place for a slid binary."""
         self.buildDsym(clean=True)
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         self.target = self.dbg.CreateTarget(exe)
         self.assertTrue(self.target, VALID_TARGET)
@@ -43,7 +43,8 @@
         self.assertTrue(self.process.GetState() == lldb.eStateStopped,
                         STOPPED_DUE_TO_BREAKPOINT)
 
-        self.runCmd("add-dsym hide.app/Contents/a.out.dSYM")
+        self.runCmd("add-dsym " +
+                    self.getBuildArtifact("hide.app/Contents/a.out.dSYM"))
 
         self.expect("frame select",
                     substrs=['a.out`main at main.c'])
diff --git a/lldb/packages/Python/lldbsuite/test/macosx/debug-info/apple_types/TestAppleTypesIsProduced.py b/lldb/packages/Python/lldbsuite/test/macosx/debug-info/apple_types/TestAppleTypesIsProduced.py
index ff1ca2a..54ad705 100644
--- a/lldb/packages/Python/lldbsuite/test/macosx/debug-info/apple_types/TestAppleTypesIsProduced.py
+++ b/lldb/packages/Python/lldbsuite/test/macosx/debug-info/apple_types/TestAppleTypesIsProduced.py
@@ -28,10 +28,10 @@
 
         self.build()
         if self.debug_info == "dsym":
-            exe = os.path.join(os.getcwd(),
+            exe = self.getBuildArtifact(
                                "a.out.dSYM/Contents/Resources/DWARF/a.out")
         else:
-            exe = os.path.join(os.getcwd(), "main.o")
+            exe = self.getBuildArtifact("main.o")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py b/lldb/packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py
index afca8bc..ee3d48d 100644
--- a/lldb/packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py
+++ b/lldb/packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py
@@ -26,7 +26,7 @@
     def test_with_python_api(self):
         """Test stepping and setting breakpoints in indirect and re-exported symbols."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py b/lldb/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py
index c2a27c5..999ab5e 100644
--- a/lldb/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py
+++ b/lldb/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py
@@ -38,7 +38,7 @@
         self.source = 'main.m'
 
         # Output filename.
-        self.exe_name = 'a.out'
+        self.exe_name = self.getBuildArtifact("a.out")
         self.d = {'OBJC_SOURCES': self.source, 'EXE': self.exe_name}
 
         # Locate breakpoint.
diff --git a/lldb/packages/Python/lldbsuite/test/macosx/order/TestOrderFile.py b/lldb/packages/Python/lldbsuite/test/macosx/order/TestOrderFile.py
index a70878f..e7a4b20 100644
--- a/lldb/packages/Python/lldbsuite/test/macosx/order/TestOrderFile.py
+++ b/lldb/packages/Python/lldbsuite/test/macosx/order/TestOrderFile.py
@@ -22,12 +22,12 @@
     def test(self):
         """Test debug symbols follow the correct order by the order file."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Test that the debug symbols have Function f3 before Function f1.
         # Use "-s address" option to sort by address.
-        self.runCmd("image dump symtab -s address a.out")
+        self.runCmd("image dump symtab -s address %s" % exe)
         output = self.res.GetOutput()
         mo_f3 = re.search("Code +.+f3", output)
         mo_f1 = re.search("Code +.+f1", output)
diff --git a/lldb/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py b/lldb/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
index 8eabe9a..ba58372 100644
--- a/lldb/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
+++ b/lldb/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
@@ -105,7 +105,7 @@
 
     def queues(self):
         """Test queues inspection SB APIs without libBacktraceRecording."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -246,7 +246,7 @@
 
     def queues_with_libBacktraceRecording(self):
         """Test queues inspection SB APIs with libBacktraceRecording present."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         if not os.path.isfile(
                 '/Applications/Xcode.app/Contents/Developer/usr/lib/libBacktraceRecording.dylib'):
diff --git a/lldb/packages/Python/lldbsuite/test/macosx/safe-to-func-call/TestSafeFuncCalls.py b/lldb/packages/Python/lldbsuite/test/macosx/safe-to-func-call/TestSafeFuncCalls.py
index 0960648..314084d 100644
--- a/lldb/packages/Python/lldbsuite/test/macosx/safe-to-func-call/TestSafeFuncCalls.py
+++ b/lldb/packages/Python/lldbsuite/test/macosx/safe-to-func-call/TestSafeFuncCalls.py
@@ -26,7 +26,7 @@
     def test_with_python_api(self):
         """Test function call thread safety."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/macosx/thread-names/TestInterruptThreadNames.py b/lldb/packages/Python/lldbsuite/test/macosx/thread-names/TestInterruptThreadNames.py
index ae2916c..925dc92 100644
--- a/lldb/packages/Python/lldbsuite/test/macosx/thread-names/TestInterruptThreadNames.py
+++ b/lldb/packages/Python/lldbsuite/test/macosx/thread-names/TestInterruptThreadNames.py
@@ -23,7 +23,7 @@
     def test_with_python_api(self):
         """Test that we get thread names when interrupting a process."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/breakpoint/TestBreakpointAPI.py b/lldb/packages/Python/lldbsuite/test/python_api/breakpoint/TestBreakpointAPI.py
index 4bd4781..5e21471 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/breakpoint/TestBreakpointAPI.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/breakpoint/TestBreakpointAPI.py
@@ -23,7 +23,7 @@
     def test_breakpoint_is_valid(self):
         """Make sure that if an SBBreakpoint gets deleted its IsValid returns false."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
@@ -57,7 +57,7 @@
         Breakpoint's IsValid returns false."""
 
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/event/TestEvents.py b/lldb/packages/Python/lldbsuite/test/python_api/event/TestEvents.py
index e9ea0bd..00f00be 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/event/TestEvents.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/event/TestEvents.py
@@ -33,7 +33,7 @@
     def test_listen_for_and_print_event(self):
         """Exercise SBEvent API."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         self.dbg.SetAsync(True)
 
@@ -122,7 +122,7 @@
     def test_wait_for_event(self):
         """Exercise SBListener.WaitForEvent() API."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         self.dbg.SetAsync(True)
 
@@ -201,7 +201,7 @@
     def test_add_listener_to_broadcaster(self):
         """Exercise some SBBroadcaster APIs."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         self.dbg.SetAsync(True)
 
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/findvalue_duplist/TestSBFrameFindValue.py b/lldb/packages/Python/lldbsuite/test/python_api/findvalue_duplist/TestSBFrameFindValue.py
index 0a0ac2d..c066dc5 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/findvalue_duplist/TestSBFrameFindValue.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/findvalue_duplist/TestSBFrameFindValue.py
@@ -22,8 +22,7 @@
         self.build()
         self.setTearDownCleanup()
 
-        exe_name = "a.out"
-        exe = os.path.join(os.getcwd(), exe_name)
+        exe = self.getBuildArtifact("a.out")
 
         # Create the target
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py b/lldb/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py
index 667bd58..9f64d36 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py
@@ -28,7 +28,7 @@
         self.setTearDownCleanup()
 
         """Test Python APIs for working with formatters"""
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py b/lldb/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
index a2d2cf1..85e915a 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
@@ -24,7 +24,7 @@
     def test_get_arg_vals_for_call_stack(self):
         """Exercise SBFrame.GetVariables() API to get argument vals."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
@@ -127,7 +127,7 @@
     def test_frame_api_boundary_condition(self):
         """Exercise SBFrame APIs with boundary condition inputs."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
@@ -169,7 +169,7 @@
     def test_frame_api_IsEqual(self):
         """Exercise SBFrame API IsEqual."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/frame/get-variables/TestGetVariables.py b/lldb/packages/Python/lldbsuite/test/python_api/frame/get-variables/TestGetVariables.py
index 86585d8..1bd54c3 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/frame/get-variables/TestGetVariables.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/frame/get-variables/TestGetVariables.py
@@ -51,7 +51,7 @@
         self.dbg.SetAsync(False)
 
         # Create a target by the debugger.
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
 
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/frame/inlines/TestInlinedFrame.py b/lldb/packages/Python/lldbsuite/test/python_api/frame/inlines/TestInlinedFrame.py
index caa2696..8b8f81f 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/frame/inlines/TestInlinedFrame.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/frame/inlines/TestInlinedFrame.py
@@ -32,7 +32,7 @@
     def test_stop_at_outer_inline(self):
         """Exercise SBFrame.IsInlined() and SBFrame.GetFunctionName()."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/function_symbol/TestDisasmAPI.py b/lldb/packages/Python/lldbsuite/test/python_api/function_symbol/TestDisasmAPI.py
index 4511da9..cd05c9d 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/function_symbol/TestDisasmAPI.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/function_symbol/TestDisasmAPI.py
@@ -31,7 +31,7 @@
     def test(self):
         """Exercise getting SBAddress objects, disassembly, and SBAddress APIs."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py b/lldb/packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py
index 9919375..930d483 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py
@@ -31,7 +31,7 @@
     def test(self):
         """Exercise some SBSymbol and SBAddress APIs."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py b/lldb/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
index 7f5781f..2f31b0a 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
@@ -24,7 +24,7 @@
     def test_with_process_launch_api(self):
         """Test the SBCommandInterpreter APIs."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/frame/TestFrameUtils.py b/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/frame/TestFrameUtils.py
index bcbaa68..4db6322 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/frame/TestFrameUtils.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/frame/TestFrameUtils.py
@@ -27,7 +27,7 @@
     def test_frame_utils(self):
         """Test utility functions for the frame object."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py b/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py
index ae7ec3d..6816b0d 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py
@@ -30,7 +30,7 @@
     def test_lldb_iter_module(self):
         """Test module_iter works correctly for SBTarget -> SBModule."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -66,7 +66,7 @@
     def test_lldb_iter_breakpoint(self):
         """Test breakpoint_iter works correctly for SBTarget -> SBBreakpoint."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -98,7 +98,7 @@
     def test_lldb_iter_frame(self):
         """Test iterator works correctly for SBProcess->SBThread->SBFrame."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py b/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py
index a19cc5c..bd46749 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py
@@ -30,7 +30,7 @@
     def test_iter_registers(self):
         """Test iterator works correctly for lldbutil.iter_registers()."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py b/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py
index b447bb7..dcdade2 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py
@@ -37,7 +37,7 @@
     def test_stack_traces(self):
         """Test SBprocess and SBThread APIs with printing of the stack traces."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/module_section/TestModuleAndSection.py b/lldb/packages/Python/lldbsuite/test/python_api/module_section/TestModuleAndSection.py
index 79b9884..654387f 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/module_section/TestModuleAndSection.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/module_section/TestModuleAndSection.py
@@ -26,7 +26,7 @@
     def test_module_and_section(self):
         """Test module and section APIs."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -77,7 +77,7 @@
     def test_module_and_section_boundary_condition(self):
         """Test module and section APIs by passing None when it expects a Python string."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -118,7 +118,7 @@
     def test_module_compile_unit_iter(self):
         """Test module's compile unit iterator APIs."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/name_lookup/TestNameLookup.py b/lldb/packages/Python/lldbsuite/test/python_api/name_lookup/TestNameLookup.py
index b7a683f..694869a 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/name_lookup/TestNameLookup.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/name_lookup/TestNameLookup.py
@@ -28,7 +28,7 @@
         and that using a function basename with eFunctionNameTypeFull works for all
         C++ functions that are at the global namespace level."""
         self.build();
-        exe = os.path.join(os.getcwd(), 'a.out')
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/objc_type/TestObjCType.py b/lldb/packages/Python/lldbsuite/test/python_api/objc_type/TestObjCType.py
index 89dfebd..fd3bfa8 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/objc_type/TestObjCType.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/objc_type/TestObjCType.py
@@ -28,7 +28,7 @@
     def test(self):
         """Test SBType for ObjC classes."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py b/lldb/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py
index 065c707..fc17e4a 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py
@@ -29,7 +29,7 @@
     def test_read_memory(self):
         """Test Python SBProcess.ReadMemory() API."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -127,7 +127,7 @@
     def test_write_memory(self):
         """Test Python SBProcess.WriteMemory() API."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -186,7 +186,7 @@
     def test_access_my_int(self):
         """Test access 'my_int' using Python SBProcess.GetByteOrder() and other APIs."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -284,7 +284,7 @@
     def test_remote_launch(self):
         """Test SBProcess.RemoteLaunch() API with a process not in eStateConnected, and it should fail."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -308,7 +308,7 @@
     def test_get_num_supported_hardware_watchpoints(self):
         """Test SBProcess.GetNumSupportedHardwareWatchpoints() API with a process."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         target = self.dbg.CreateTarget(exe)
@@ -331,7 +331,7 @@
     def test_get_process_info(self):
         """Test SBProcess::GetProcessInfo() API with a locally launched process."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py b/lldb/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py
index a84d000..1d042b6 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py
@@ -26,7 +26,7 @@
     def test_with_run_command(self):
         """Check that SBValue.GetValueAsSigned() does the right thing for a 32-bit -1."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py b/lldb/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py
index 0560ac5..f8ac27f 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py
@@ -45,7 +45,7 @@
     def test_with_run_command(self):
         """Test the SBData APIs."""
         self.build()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/sbvalue_persist/TestSBValuePersist.py b/lldb/packages/Python/lldbsuite/test/python_api/sbvalue_persist/TestSBValuePersist.py
index eab3cbb..3d0c721 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/sbvalue_persist/TestSBValuePersist.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/sbvalue_persist/TestSBValuePersist.py
@@ -22,7 +22,7 @@
         """Test SBValue::Persist"""
         self.build()
         self.setTearDownCleanup()
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_source_regexp(self, "break here")
 
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/signals/TestSignalsAPI.py b/lldb/packages/Python/lldbsuite/test/python_api/signals/TestSignalsAPI.py
index 76b1d60..482f4a8 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/signals/TestSignalsAPI.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/signals/TestSignalsAPI.py
@@ -22,7 +22,7 @@
     def test_ignore_signal(self):
         """Test Python SBUnixSignals.Suppress/Stop/Notify() API."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py b/lldb/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py
index 85ecb69..c546cf8 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py
@@ -31,7 +31,7 @@
     def test(self):
         """Exercise SBSymbolContext API extensively."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
@@ -66,7 +66,7 @@
         module = context.GetModule()
         desc = lldbutil.get_description(module)
         self.expect(desc, "The module should match", exe=False,
-                    substrs=[os.path.join(self.mydir, 'a.out')])
+                    substrs=[self.getBuildArtifact("a.out")])
 
         compileUnit = context.GetCompileUnit()
         self.expect(
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py b/lldb/packages/Python/lldbsuite/test/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py
index 429e9c4..41e44ee 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py
@@ -21,7 +21,7 @@
     def test_lookup_by_address(self):
         """Test lookup by address in a module with multiple compilation units"""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -44,7 +44,7 @@
         """This test verifies that we correctly handle the case when multiple
         compile unit contains DW_AT_ranges and DW_AT_ranges_base attributes."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/target/TestTargetAPI.py b/lldb/packages/Python/lldbsuite/test/python_api/target/TestTargetAPI.py
index adbdc52..7154e17 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/target/TestTargetAPI.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/target/TestTargetAPI.py
@@ -243,7 +243,7 @@
 
     def get_description(self):
         """Exercise SBTaget.GetDescription() API."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
@@ -271,7 +271,7 @@
     @not_remote_testsuite_ready
     def launch_new_process_and_redirect_stdout(self):
         """Exercise SBTaget.Launch() API with redirected stdout."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
@@ -333,7 +333,7 @@
 
     def resolve_symbol_context_with_address(self):
         """Exercise SBTaget.ResolveSymbolContextForAddress() API."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py b/lldb/packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
index a1272cb..6b18419 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
@@ -78,7 +78,7 @@
 
     def get_process(self):
         """Test Python SBThread.GetProcess() API."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
@@ -105,7 +105,7 @@
 
     def get_stop_description(self):
         """Test Python SBThread.GetStopDescription() API."""
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         target = self.dbg.CreateTarget(exe)
         self.assertTrue(target, VALID_TARGET)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py b/lldb/packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py
index c4b1e28..6fa7283 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py
@@ -15,7 +15,7 @@
     @add_test_categories(['pyapi'])
     def test(self):
         self.build()
-        exe = os.path.join(os.getcwd(), 'a.out')
+        exe = self.getBuildArtifact("a.out")
         line = line_number('main.cpp', '// Break at this line')
 
         # Create a target by the debugger.
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestSetWatchpoint.py b/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestSetWatchpoint.py
index cef8a0c..0236d4b 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestSetWatchpoint.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestSetWatchpoint.py
@@ -36,7 +36,7 @@
     def test_watch_val(self):
         """Exercise SBValue.Watch() API to set a watchpoint."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py b/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
index 0d1ef80..603b7a8 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
@@ -36,7 +36,7 @@
     def test_set_watch_ignore_count(self):
         """Test SBWatchpoint.SetIgnoreCount() API."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py b/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py
index ca5fca3..b9fc7ce 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py
@@ -39,7 +39,7 @@
     def test_watch_iter(self):
         """Exercise SBTarget.watchpoint_iter() API to iterate on the available watchpoints."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py b/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
index e6bc9c0..fdc8ac0 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
@@ -37,7 +37,7 @@
     def test_watch_location(self):
         """Exercise SBValue.WatchPointee() API to set a watchpoint."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py b/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
index 8059506..d5862d2 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
@@ -36,7 +36,7 @@
     def test_watch_address(self):
         """Exercise SBTarget.WatchAddress() API to set a watchpoint."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
@@ -112,7 +112,7 @@
     def test_watch_address_with_invalid_watch_size(self):
         """Exercise SBTarget.WatchAddress() API but pass an invalid watch_size."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
 
         # Create a target by the debugger.
         target = self.dbg.CreateTarget(exe)
diff --git a/lldb/packages/Python/lldbsuite/test/settings/TestSettings.py b/lldb/packages/Python/lldbsuite/test/settings/TestSettings.py
index 5e1cd44..717c074 100644
--- a/lldb/packages/Python/lldbsuite/test/settings/TestSettings.py
+++ b/lldb/packages/Python/lldbsuite/test/settings/TestSettings.py
@@ -125,7 +125,7 @@
         """Test that 'set frame-format' with a backtick char in the format string works as well as fullpath."""
         self.build()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         def cleanup():
@@ -161,7 +161,7 @@
         """Test that after 'set auto-confirm true', manual confirmation should not kick in."""
         self.build()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.runCmd("settings set auto-confirm true")
@@ -186,7 +186,7 @@
         """Test that user options for the disassembler take effect."""
         self.build()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # AT&T syntax
@@ -219,7 +219,7 @@
     def test_run_args_and_env_vars(self):
         """Test that run-args and env-vars are passed to the launched process."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Set the run-args and the env-vars.
@@ -253,7 +253,7 @@
         """Test that the host env vars are passed to the launched process."""
         self.build()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # By default, inherit-env is 'true'.
@@ -292,7 +292,7 @@
         """Test that setting target.error/output-path for the launched process works."""
         self.build()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Set the error-path and output-path and verify both are set.
diff --git a/lldb/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py b/lldb/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py
index 02110d1..54a9671 100644
--- a/lldb/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py
+++ b/lldb/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py
@@ -79,7 +79,7 @@
         to stdout. Compare the stdout with args_out."""
         self.buildDefault()
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         self.runCmd("process launch -- " + args_in)
diff --git a/lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py b/lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
index 31fe543..44bac1d 100644
--- a/lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
+++ b/lldb/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
@@ -50,7 +50,7 @@
 
     def do_display_source_python_api(self, use_color, column_marker_regex):
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         target = self.dbg.CreateTarget(exe)
@@ -116,7 +116,7 @@
     def test_move_and_then_display_source(self):
         """Test that target.source-map settings work by moving main.c to hidden/main.c."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Move main.c to hidden/main.c.
@@ -152,7 +152,7 @@
     def test_modify_source_file_while_debugging(self):
         """Modify a source file while debugging the executable."""
         self.build()
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
@@ -237,7 +237,7 @@
         self.runCmd("settings set target.source-map %s %s" %
                     (os.getcwd(), os.path.join(os.getcwd(), "hidden")))
 
-        exe = os.path.join(os.getcwd(), "a.out")
+        exe = self.getBuildArtifact("a.out")
         main = os.path.join(os.getcwd(), "hidden", "main.c")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py
index 1eea89f..dfe639c 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py
@@ -41,9 +41,7 @@
         self.spawnLldbMi(args=None)
 
         # Test that -file-exec-and-symbols works for absolute path
-        import os
-        path = os.path.join(os.getcwd(), self.myexe)
-        self.runCmd("-file-exec-and-symbols \"%s\"" % path)
+        self.runCmd("-file-exec-and-symbols \"%s\"" % self.myexe)
         self.expect("\^done")
 
         # Run
@@ -60,7 +58,8 @@
         self.spawnLldbMi(args=None)
 
         # Test that -file-exec-and-symbols works for relative path
-        path = "./%s" % self.myexe
+        import os
+        path = os.path.relpath(self.myexe)
         self.runCmd("-file-exec-and-symbols %s" % path)
         self.expect("\^done")
 
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiLibraryLoaded.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiLibraryLoaded.py
index a597ae1..d4d7a48 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiLibraryLoaded.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiLibraryLoaded.py
@@ -35,7 +35,7 @@
             "Contents",
             "Resources",
             "DWARF",
-            self.myexe)
+            "a.out")
 
         def add_slashes(x): return x.replace(
             "\\",
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
index 2226395..e986204 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
@@ -8,21 +8,24 @@
 from lldbsuite.test.lldbtest import *
 
 
-class MiTestCaseBase(Base):
+class MiTestCaseBase(TestBase):
 
     mydir = None
-    myexe = "a.out"
-    mylog = "child.log"
+    myexe = None
+    mylog = None
 
     @classmethod
     def classCleanup(cls):
-        TestBase.RemoveTempFile(cls.myexe)
-        TestBase.RemoveTempFile(cls.mylog)
+        if cls.myexe:
+            TestBase.RemoveTempFile(cls.myexe)
+        if cls.mylog:
+            TestBase.RemoveTempFile(cls.mylog)
 
     def setUp(self):
         Base.setUp(self)
         self.buildDefault()
         self.child_prompt = "(gdb)"
+        self.myexe = self.getBuildArtifact("a.out")
 
     def tearDown(self):
         if self.TraceOn():
@@ -38,6 +41,7 @@
         self.child = pexpect.spawn("%s --interpreter %s" % (
             self.lldbMiExec, args if args else ""))
         self.child.setecho(True)
+        self.mylog = self.getBuildArtifact("child.log")
         self.child.logfile_read = open(self.mylog, "w")
         # wait until lldb-mi has started up and is ready to go
         self.expect(self.child_prompt, exactly=True)
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
index 80b9259..2bb71e4 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
@@ -9,6 +9,7 @@
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 
+import os
 
 class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):
 
@@ -67,14 +68,11 @@
         """Test that 'lldb-mi --interpreter %s' loads executable which is specified via absolute path."""
 
         # Prepare path to executable
-        import os
-        path = os.path.join(os.getcwd(), self.myexe)
-
-        self.spawnLldbMi(args="%s" % path)
+        self.spawnLldbMi(args="%s" % self.myexe)
 
         # Test that the executable is loaded when file was specified using
         # absolute path
-        self.expect("-file-exec-and-symbols \"%s\"" % path)
+        self.expect("-file-exec-and-symbols \"%s\"" % self.myexe)
         self.expect("\^done")
 
         # Test that lldb-mi is ready when executable was loaded
@@ -92,8 +90,7 @@
         """Test that 'lldb-mi --interpreter %s' loads executable which is specified via relative path."""
 
         # Prepare path to executable
-        path = "./%s" % self.myexe
-
+        path = os.path.relpath(self.myexe)
         self.spawnLldbMi(args="%s" % path)
 
         # Test that the executable is loaded when file was specified using
@@ -129,6 +126,15 @@
         # Test that lldb-mi is ready when executable was loaded
         self.expect(self.child_prompt, exactly=True)
 
+    def copyScript(self, sourceFile):
+        """copy the script to builddir and replace a.out with the full path"""
+        destFile = os.path.join(os.path.dirname(self.myexe),
+                                sourceFile+'.script')
+        with open(sourceFile, 'r') as src:
+            with open(destFile, 'w+') as dest:
+                dest.write(src.read().replace("a.out", self.myexe))
+        return destFile
+        
     @skipIfRemote   # We do not currently support remote debugging via the MI.
     @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
     @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread races
@@ -137,8 +143,7 @@
         """Test that 'lldb-mi --interpreter' can execute user's commands after initial commands were executed."""
 
         # Prepared source file
-        sourceFile = "start_script"
-
+        sourceFile = self.copyScript("start_script")
         self.spawnLldbMi(args="--source %s" % sourceFile)
 
         # After '-file-exec-and-symbols a.out'
@@ -171,6 +176,7 @@
         self.runCmd("-data-evaluate-expression a")
         self.expect("\^done,value=\"10\"")
         self.expect(self.child_prompt, exactly=True)
+        os.unlink(sourceFile)
 
     @skipIfRemote   # We do not currently support remote debugging via the MI.
     @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
@@ -180,8 +186,7 @@
         """Test that 'lldb-mi --interpreter' can execute a prepared file which passed via --source option."""
 
         # Prepared source file
-        sourceFile = "start_script_exit"
-
+        sourceFile = self.copyScript("start_script_exit")
         self.spawnLldbMi(args="--source %s" % sourceFile)
 
         # After '-file-exec-and-symbols a.out'
@@ -215,6 +220,7 @@
         self.expect("-gdb-exit")
         self.expect("\^exit")
         self.expect("\*stopped,reason=\"exited-normally\"")
+        os.unlink(sourceFile)
 
     @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
     @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread races
@@ -222,8 +228,7 @@
         """Test that 'lldb-mi --interpreter' stops execution of initial commands in case of error."""
 
         # Prepared source file
-        sourceFile = "start_script_error"
-
+        sourceFile = self.copyScript("start_script_error")
         self.spawnLldbMi(args="--source %s" % sourceFile)
 
         # After '-file-exec-and-symbols a.out'
@@ -236,6 +241,7 @@
 
         # Test that lldb-mi is ready after execution of --source start_script
         self.expect(self.child_prompt, exactly=True)
+        os.unlink(sourceFile)
 
     @skipIfRemote   # We do not currently support remote debugging via the MI.
     @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
index a4f306e..2817f68 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
@@ -558,7 +558,7 @@
         self.assertIsNotNone(reg_infos)
         self.assertTrue(len(reg_infos) > 0)
 
-        inferior_exe_path = os.path.abspath("a.out")
+        inferior_exe_path = self.getBuildArtifact("a.out")
         Target = self.dbg.CreateTarget(inferior_exe_path)
         byte_order = Target.GetByteOrder()
 
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
index 6788725..c20dbe3 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -483,7 +483,7 @@
         # This process needs to be started so that it just hangs around for a while.  We'll
         # have it sleep.
         if not exe_path:
-            exe_path = os.path.abspath("a.out")
+            exe_path = self.getBuildArtifact("a.out")
 
         args = []
         if inferior_args:
@@ -546,7 +546,7 @@
         if self._inferior_startup == self._STARTUP_LAUNCH:
             # Build launch args
             if not inferior_exe_path:
-                inferior_exe_path = os.path.abspath("a.out")
+                inferior_exe_path = self.getBuildArtifact("a.out")
 
             if lldb.remote_platform:
                 remote_path = lldbutil.append_to_process_working_directory(
@@ -1607,7 +1607,7 @@
             '.*' if lldbplatformutil.hasChattyStderr(self) else '^' + regex + '$'
 
     def install_and_create_launch_args(self):
-        exe_path = os.path.abspath('a.out')
+        exe_path = self.getBuildArtifact("a.out")
         if not lldb.remote_platform:
             return [exe_path]
         remote_path = lldbutil.append_to_process_working_directory(
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
index 7e4190b..2a2ffa6 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
@@ -20,12 +20,9 @@
         self.init_llgs_test(False)
 
         working_dir = lldb.remote_platform.GetWorkingDirectory()
-        err = lldb.remote_platform.Put(
-            lldb.SBFileSpec(
-                os.path.join(
-                    os.getcwd(), "a.out")), lldb.SBFileSpec(
-                os.path.join(
-                    working_dir, "a.out")))
+        src = lldb.SBFileSpec(self.getBuildArtifact("a.out"))
+        dest = lldb.SBFileSpec(os.path.join(working_dir, "a.out"))
+        err = lldb.remote_platform.Put(src, dest)
         if err.Fail():
             raise RuntimeError(
                 "Unable copy '%s' to '%s'.\n>>> %s" %
diff --git a/lldb/packages/Python/lldbsuite/test/types/TestRecursiveTypes.py b/lldb/packages/Python/lldbsuite/test/types/TestRecursiveTypes.py
index 4735bce..40c028f 100644
--- a/lldb/packages/Python/lldbsuite/test/types/TestRecursiveTypes.py
+++ b/lldb/packages/Python/lldbsuite/test/types/TestRecursiveTypes.py
@@ -44,7 +44,7 @@
         self.print_struct()
 
     def print_struct(self):
-        self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
 
         lldbutil.run_break_set_by_file_and_line(
             self,
diff --git a/lldb/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py b/lldb/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
index 5df4c70..11a7d6f 100644
--- a/lldb/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
+++ b/lldb/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
@@ -83,7 +83,8 @@
 
     def do_add_dsym_with_error(self, exe_name):
         """Test that the 'add-dsym' command informs the user about failures."""
-        self.runCmd("file " + exe_name, CURRENT_EXECUTABLE_SET)
+        exe_path = self.getBuildArtifact(exe_name)
+        self.runCmd("file " + exe_path, CURRENT_EXECUTABLE_SET)
 
         wrong_path = os.path.join("%s.dSYM" % exe_name, "Contents")
         self.expect("add-dsym " + wrong_path, error=True,
@@ -91,7 +92,7 @@
 
         right_path = os.path.join(
             "%s.dSYM" %
-            exe_name,
+            exe_path,
             "Contents",
             "Resources",
             "DWARF",
@@ -101,13 +102,14 @@
 
     def do_add_dsym_with_success(self, exe_name):
         """Test that the 'add-dsym' command informs the user about success."""
-        self.runCmd("file " + exe_name, CURRENT_EXECUTABLE_SET)
+        exe_path = self.getBuildArtifact(exe_name)
+        self.runCmd("file " + exe_path, CURRENT_EXECUTABLE_SET)
 
         # This time, the UUID should match and we expect some feedback from
         # lldb.
         right_path = os.path.join(
             "%s.dSYM" %
-            exe_name,
+            exe_path,
             "Contents",
             "Resources",
             "DWARF",
@@ -117,9 +119,10 @@
 
     def do_add_dsym_with_dSYM_bundle(self, exe_name):
         """Test that the 'add-dsym' command informs the user about success when loading files in bundles."""
-        self.runCmd("file " + exe_name, CURRENT_EXECUTABLE_SET)
+        exe_path = self.getBuildArtifact(exe_name)
+        self.runCmd("file " + exe_path, CURRENT_EXECUTABLE_SET)
 
         # This time, the UUID should be found inside the bundle
-        right_path = "%s.dSYM" % exe_name
+        right_path = "%s.dSYM" % exe_path
         self.expect("add-dsym " + right_path,
                     substrs=['symbol file', 'has been added to'])