aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorLukacs T. Berki <lberki@google.com>2021-02-26 14:27:36 +0100
committerLukacs T. Berki <lberki@google.com>2021-03-03 09:14:22 +0100
commit7690c099539884c8c4a94429eed54573586321be (patch)
tree6c947227785120140c4bc8fc1b7083833ae58a21 /sh
parent3bed960399dad2f97f75ef33e1ab407b84d3e6c7 (diff)
downloadsoong-7690c099539884c8c4a94429eed54573586321be.tar.gz
cd to / before running soong_build .
This lets one avoid any decisions as to when to chdir there during its execution and leads to better sandboxing because the pwd doesn't leak to init() functions anymore. Test: Manual. Change-Id: I1560da8ed3a621249426f9e8908aa890c21e13ba
Diffstat (limited to 'sh')
-rw-r--r--sh/sh_binary_test.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/sh/sh_binary_test.go b/sh/sh_binary_test.go
index fb7ab1358..f48f7fb29 100644
--- a/sh/sh_binary_test.go
+++ b/sh/sh_binary_test.go
@@ -3,6 +3,7 @@ package sh
import (
"io/ioutil"
"os"
+ "path"
"path/filepath"
"reflect"
"testing"
@@ -73,7 +74,8 @@ func TestShTestSubDir(t *testing.T) {
entries := android.AndroidMkEntriesForTest(t, ctx, mod)[0]
- expectedPath := "/tmp/target/product/test_device/data/nativetest64/foo_test"
+ expectedPath := path.Join(buildDir,
+ "../target/product/test_device/data/nativetest64/foo_test")
actualPath := entries.EntryMap["LOCAL_MODULE_PATH"][0]
if expectedPath != actualPath {
t.Errorf("Unexpected LOCAL_MODULE_PATH expected: %q, actual: %q", expectedPath, actualPath)
@@ -97,7 +99,8 @@ func TestShTest(t *testing.T) {
entries := android.AndroidMkEntriesForTest(t, ctx, mod)[0]
- expectedPath := "/tmp/target/product/test_device/data/nativetest64/foo"
+ expectedPath := path.Join(buildDir,
+ "../target/product/test_device/data/nativetest64/foo")
actualPath := entries.EntryMap["LOCAL_MODULE_PATH"][0]
if expectedPath != actualPath {
t.Errorf("Unexpected LOCAL_MODULE_PATH expected: %q, actual: %q", expectedPath, actualPath)