OSDN Git Service

ART: Fix run-test in case of relative TMPDIR
authorAndreas Gampe <agampe@google.com>
Wed, 13 Aug 2014 22:40:22 +0000 (15:40 -0700)
committerAndreas Gampe <agampe@google.com>
Wed, 13 Aug 2014 22:40:22 +0000 (15:40 -0700)
Relative paths should be resolved to absolute paths, as we are
chdir-ing in the test.

Bug: 16499668
Change-Id: Ic7db35e21f519ced77c4ac468d8e909bcb40b24d

test/run-test

index ca7e68c..02b62b0 100755 (executable)
@@ -195,6 +195,14 @@ while true; do
         break
     fi
 done
+
+# tmp_dir may be relative, resolve.
+#
+# Cannot use realpath, as it does not exist on Mac.
+# Cannot us a simple "cd", as the path might not be created yet.
+# Use -m option of readlink: canonicalizes, but allows non-existing components.
+tmp_dir="`cd $oldwd ; readlink -m $tmp_dir`"
+
 mkdir -p $tmp_dir
 
 if [ "$trace" = "true" ]; then