Add unit_test test option in sh_test_host
This change allows sh_test_host to be included
in host-unit-tests suite when test option `unit_test` is set to true.
Bug: 183209767
Test: m host-unit-tests
Change-Id: I5b441d5f49468cb681eb414dade8a1309c6e810a
diff --git a/sh/sh_binary_test.go b/sh/sh_binary_test.go
index 9e7e594..20317d8 100644
--- a/sh/sh_binary_test.go
+++ b/sh/sh_binary_test.go
@@ -3,6 +3,7 @@
import (
"os"
"path/filepath"
+ "strconv"
"testing"
"android/soong/android"
@@ -148,6 +149,9 @@
"testdata/data1",
"testdata/sub/data2",
],
+ test_options: {
+ unit_test: true,
+ },
}
`)
@@ -156,6 +160,9 @@
if !mod.Host() {
t.Errorf("host bit is not set for a sh_test_host module.")
}
+ entries := android.AndroidMkEntriesForTest(t, ctx, mod)[0]
+ actualData, _ := strconv.ParseBool(entries.EntryMap["LOCAL_IS_UNIT_TEST"][0])
+ android.AssertBoolEquals(t, "LOCAL_IS_UNIT_TEST", true, actualData)
}
func TestShTestHost_dataDeviceModules(t *testing.T) {