Update three tests to realpath paths that we compare to dyld paths
authorJason Molenda <jason@molenda.com>
Thu, 26 May 2022 07:19:57 +0000 (00:19 -0700)
committerJason Molenda <jason@molenda.com>
Thu, 26 May 2022 07:21:44 +0000 (00:21 -0700)
I get to my work directory through a symlink, so the pathnames the
tests get for their build artifacts etc are via that symlink.  There
are three tests which compare those symlink paths to a directory
received from dyld on macOS, which is the actual real pathname.

These tests have always failed for me on my dekstop but I finally
sat down to figure out why. Easy quick fix.

lldb/test/API/commands/platform/sdk/TestPlatformSDK.py
lldb/test/API/macosx/function-starts/TestFunctionStarts.py
lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py

index 91ad5a4..9178e3c 100644 (file)
@@ -58,6 +58,7 @@ class PlatformSDKTestCase(TestBase):
 
         # Create a fake 'SDK' directory.
         test_home = os.path.join(self.getBuildDir(), 'fake_home.noindex')
+        test_home = os.path.realpath(test_home)
         macos_version = platform.mac_ver()[0]
         sdk_dir = os.path.join(test_home, 'Library', 'Developer', 'Xcode',
                                'macOS DeviceSupport', macos_version)
index 72688d8..21b494f 100644 (file)
@@ -35,7 +35,7 @@ class FunctionStartsTestCase(TestBase):
         """Run the binary, stop at our unstripped function,
            make sure the caller has synthetic symbols"""
 
-        exe = self.getBuildArtifact(exe_name)
+        exe = os.path.realpath(self.getBuildArtifact(exe_name))
         # Now strip the binary, but leave externals so we can break on dont_strip_me.
         self.runBuildCommand(["strip", "-u", "-x", "-S", exe])
 
index 840e970..beb62f1 100644 (file)
@@ -72,7 +72,7 @@ class TestAppleSimulatorOSType(gdbremote_testcase.GdbRemoteTestCaseBase):
                 'ARCH': arch,
                 'ARCH_CFLAGS': '-target {} {}'.format(triple, version_min),
             })
-        exe_path = self.getBuildArtifact(exe_name)
+        exe_path = os.path.realpath(self.getBuildArtifact(exe_name))
         cmd = [
             'xcrun', 'simctl', 'spawn', '-s', deviceUDID, exe_path,
             'print-pid', 'sleep:10'