summaryrefslogtreecommitdiff
path: root/sh/sh_binary_test.go
diff options
context:
space:
mode:
authorJaewoong Jung <jungjw@google.com>2020-06-10 17:23:46 -0700
committerJaewoong Jung <jungjw@google.com>2020-06-10 17:23:46 -0700
commit2d4f1a2f7e96e760216e39f36503fee2a8a97d95 (patch)
treefe94ab7c6ce903653c2e96113139b1f2cb6b854f /sh/sh_binary_test.go
parentd7db79cc8b7cc2dbde919d95297b8dd917e7e831 (diff)
Add module name to sh_test install path.
Bug: 156980228 Test: m ziptool-tests Test: sh_binary_test.go Change-Id: Ibb1d774709ea421e18d5350009c203f83c5b2d60
Diffstat (limited to 'sh/sh_binary_test.go')
-rw-r--r--sh/sh_binary_test.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/sh/sh_binary_test.go b/sh/sh_binary_test.go
index 6c0d96abe..6ab22c5bf 100644
--- a/sh/sh_binary_test.go
+++ b/sh/sh_binary_test.go
@@ -55,7 +55,7 @@ func testShBinary(t *testing.T, bp string) (*android.TestContext, android.Config
return ctx, config
}
-func TestShTestTestData(t *testing.T) {
+func TestShTest(t *testing.T) {
ctx, config := testShBinary(t, `
sh_test {
name: "foo",
@@ -71,10 +71,17 @@ func TestShTestTestData(t *testing.T) {
mod := ctx.ModuleForTests("foo", "android_arm64_armv8-a").Module().(*ShTest)
entries := android.AndroidMkEntriesForTest(t, config, "", mod)[0]
- expected := []string{":testdata/data1", ":testdata/sub/data2"}
- actual := entries.EntryMap["LOCAL_TEST_DATA"]
- if !reflect.DeepEqual(expected, actual) {
- t.Errorf("Unexpected test data expected: %q, actual: %q", expected, actual)
+
+ expectedPath := "/tmp/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)
+ }
+
+ expectedData := []string{":testdata/data1", ":testdata/sub/data2"}
+ actualData := entries.EntryMap["LOCAL_TEST_DATA"]
+ if !reflect.DeepEqual(expectedData, actualData) {
+ t.Errorf("Unexpected test data expected: %q, actual: %q", expectedData, actualData)
}
}