Fixed intermittent failures in TestGdbRemote*/TestLldbGdbServer

test/tools/lldb-server/commandline/Test* were actually executing in
their parent directory. This looks fine at first because they aren't
compiling an inferior executable.

Unfortunately, they still call "make clean" during their cleanup,
which is likely causing all kinds of havok in tests running in the
parent directory

Differential Revision: http://reviews.llvm.org/D9869

llvm-svn: 237932
diff --git a/lldb/test/tools/lldb-server/TestGdbRemoteAttach.py b/lldb/test/tools/lldb-server/TestGdbRemoteAttach.py
index 866e9d3..ee18a42 100644
--- a/lldb/test/tools/lldb-server/TestGdbRemoteAttach.py
+++ b/lldb/test/tools/lldb-server/TestGdbRemoteAttach.py
@@ -6,6 +6,8 @@
 
 class TestGdbRemoteAttach(gdbremote_testcase.GdbRemoteTestCaseBase):
 
+    mydir = TestBase.compute_mydir(__file__)
+
     def attach_with_vAttach(self):
         # Start the inferior, start the debug monitor, nothing is attached yet.
         procs = self.prep_debug_monitor_and_inferior(inferior_args=["sleep:60"])
diff --git a/lldb/test/tools/lldb-server/TestGdbRemoteAuxvSupport.py b/lldb/test/tools/lldb-server/TestGdbRemoteAuxvSupport.py
index 1899824..8575b6a 100644
--- a/lldb/test/tools/lldb-server/TestGdbRemoteAuxvSupport.py
+++ b/lldb/test/tools/lldb-server/TestGdbRemoteAuxvSupport.py
@@ -5,6 +5,8 @@
 
 class TestGdbRemoteAuxvSupport(gdbremote_testcase.GdbRemoteTestCaseBase):
 
+    mydir = TestBase.compute_mydir(__file__)
+
     AUXV_SUPPORT_FEATURE_NAME = "qXfer:auxv:read"
 
     def has_auxv_support(self):
diff --git a/lldb/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py b/lldb/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py
index bf4d045..57189a9 100644
--- a/lldb/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py
+++ b/lldb/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py
@@ -5,6 +5,8 @@
 
 class TestGdbRemoteExpeditedRegisters(gdbremote_testcase.GdbRemoteTestCaseBase):
 
+    mydir = TestBase.compute_mydir(__file__)
+
     def gather_expedited_registers(self):
         # Setup the stub and set the gdb remote command stream.
         procs = self.prep_debug_monitor_and_inferior(inferior_args=["sleep:2"])
diff --git a/lldb/test/tools/lldb-server/TestGdbRemoteKill.py b/lldb/test/tools/lldb-server/TestGdbRemoteKill.py
index e54ee2b..273ab35 100644
--- a/lldb/test/tools/lldb-server/TestGdbRemoteKill.py
+++ b/lldb/test/tools/lldb-server/TestGdbRemoteKill.py
@@ -6,6 +6,9 @@
 from lldbtest import *
 
 class TestGdbRemoteKill(gdbremote_testcase.GdbRemoteTestCaseBase):
+
+    mydir = TestBase.compute_mydir(__file__)
+
     def attach_commandline_kill_after_initial_stop(self):
         procs = self.prep_debug_monitor_and_inferior()
         self.test_sequence.add_log_lines([
diff --git a/lldb/test/tools/lldb-server/TestGdbRemoteProcessInfo.py b/lldb/test/tools/lldb-server/TestGdbRemoteProcessInfo.py
index 8c481a4..b7db698 100644
--- a/lldb/test/tools/lldb-server/TestGdbRemoteProcessInfo.py
+++ b/lldb/test/tools/lldb-server/TestGdbRemoteProcessInfo.py
@@ -7,6 +7,8 @@
 
 class TestGdbRemoteProcessInfo(gdbremote_testcase.GdbRemoteTestCaseBase):
 
+    mydir = TestBase.compute_mydir(__file__)
+
     def qProcessInfo_returns_running_process(self):
         procs = self.prep_debug_monitor_and_inferior()
         self.add_process_info_collection_packets()
diff --git a/lldb/test/tools/lldb-server/TestGdbRemoteRegisterState.py b/lldb/test/tools/lldb-server/TestGdbRemoteRegisterState.py
index 3d80420..45ca5cf 100644
--- a/lldb/test/tools/lldb-server/TestGdbRemoteRegisterState.py
+++ b/lldb/test/tools/lldb-server/TestGdbRemoteRegisterState.py
@@ -6,6 +6,8 @@
 class TestGdbRemoteRegisterState(gdbremote_testcase.GdbRemoteTestCaseBase):
     """Test QSaveRegisterState/QRestoreRegisterState support."""
 
+    mydir = TestBase.compute_mydir(__file__)
+
     def grp_register_save_restore_works(self, with_suffix):
         # Start up the process, use thread suffix, grab main thread id.
         inferior_args = ["message:main entered", "sleep:5"]
diff --git a/lldb/test/tools/lldb-server/TestGdbRemoteSingleStep.py b/lldb/test/tools/lldb-server/TestGdbRemoteSingleStep.py
index ceb562b..1daa2b5 100644
--- a/lldb/test/tools/lldb-server/TestGdbRemoteSingleStep.py
+++ b/lldb/test/tools/lldb-server/TestGdbRemoteSingleStep.py
@@ -5,6 +5,8 @@
 
 class TestGdbRemoteSingleStep(gdbremote_testcase.GdbRemoteTestCaseBase):
 
+    mydir = TestBase.compute_mydir(__file__)
+
     @debugserver_test
     @dsym_test
     def test_single_step_only_steps_one_instruction_with_s_debugserver_dsym(self):
diff --git a/lldb/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py b/lldb/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py
index ac0a392..55cff08 100644
--- a/lldb/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py
+++ b/lldb/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py
@@ -5,6 +5,8 @@
 
 class TestGdbRemoteThreadsInStopReply(gdbremote_testcase.GdbRemoteTestCaseBase):
 
+    mydir = TestBase.compute_mydir(__file__)
+
     ENABLE_THREADS_IN_STOP_REPLY_ENTRIES = [
         "read packet: $QListThreadsInStopReply#21",
         "send packet: $OK#00",
diff --git a/lldb/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py b/lldb/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py
index 8a8bae7..bea4ccb 100644
--- a/lldb/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py
+++ b/lldb/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py
@@ -6,6 +6,7 @@
 
 class TestGdbRemote_qThreadStopInfo(gdbremote_testcase.GdbRemoteTestCaseBase):
 
+    mydir = TestBase.compute_mydir(__file__)
     THREAD_COUNT = 5
 
     def gather_stop_replies_via_qThreadStopInfo(self, thread_count):
diff --git a/lldb/test/tools/lldb-server/TestGdbRemote_vCont.py b/lldb/test/tools/lldb-server/TestGdbRemote_vCont.py
index aa5b424..4b7a409 100644
--- a/lldb/test/tools/lldb-server/TestGdbRemote_vCont.py
+++ b/lldb/test/tools/lldb-server/TestGdbRemote_vCont.py
@@ -5,6 +5,8 @@
 
 class TestGdbRemote_vCont(gdbremote_testcase.GdbRemoteTestCaseBase):
 
+    mydir = TestBase.compute_mydir(__file__)
+
     def vCont_supports_mode(self, mode, inferior_args=None):
         # Setup the stub and set the gdb remote command stream.
         procs = self.prep_debug_monitor_and_inferior(inferior_args=inferior_args)
diff --git a/lldb/test/tools/lldb-server/TestLldbGdbServer.py b/lldb/test/tools/lldb-server/TestLldbGdbServer.py
index 91610a4..17be4b4 100644
--- a/lldb/test/tools/lldb-server/TestLldbGdbServer.py
+++ b/lldb/test/tools/lldb-server/TestLldbGdbServer.py
@@ -19,6 +19,8 @@
 
 class LldbGdbServerTestCase(gdbremote_testcase.GdbRemoteTestCaseBase):
 
+    mydir = TestBase.compute_mydir(__file__)
+
     @debugserver_test
     def test_exe_starts_debugserver(self):
         self.init_debugserver_test()
diff --git a/lldb/test/tools/lldb-server/commandline/TestStubReverseConnect.py b/lldb/test/tools/lldb-server/commandline/TestStubReverseConnect.py
index e213380..6e793b9 100644
--- a/lldb/test/tools/lldb-server/commandline/TestStubReverseConnect.py
+++ b/lldb/test/tools/lldb-server/commandline/TestStubReverseConnect.py
@@ -7,6 +7,9 @@
 from lldbtest import *
 
 class TestStubReverseConnect(gdbremote_testcase.GdbRemoteTestCaseBase):
+
+    mydir = TestBase.compute_mydir(__file__)
+
     _DEFAULT_TIMEOUT = 20
 
     def setUp(self):
diff --git a/lldb/test/tools/lldb-server/commandline/TestStubSetSID.py b/lldb/test/tools/lldb-server/commandline/TestStubSetSID.py
index 783ea27..3cea264 100644
--- a/lldb/test/tools/lldb-server/commandline/TestStubSetSID.py
+++ b/lldb/test/tools/lldb-server/commandline/TestStubSetSID.py
@@ -9,6 +9,9 @@
 from lldbtest import *
 
 class TestStubSetSIDTestCase(gdbremote_testcase.GdbRemoteTestCaseBase):
+
+    mydir = TestBase.compute_mydir(__file__)
+
     def get_stub_sid(self, extra_stub_args=None):
         # Launch debugserver
         if extra_stub_args:
diff --git a/lldb/test/tools/lldb-server/gdbremote_testcase.py b/lldb/test/tools/lldb-server/gdbremote_testcase.py
index cf5b16d..bed8cba 100644
--- a/lldb/test/tools/lldb-server/gdbremote_testcase.py
+++ b/lldb/test/tools/lldb-server/gdbremote_testcase.py
@@ -23,8 +23,6 @@
 
 class GdbRemoteTestCaseBase(TestBase):
 
-    mydir = TestBase.compute_mydir(__file__)
-
     _TIMEOUT_SECONDS = 5
 
     _GDBREMOTE_KILL_PACKET = "$k#6b"