summaryrefslogtreecommitdiff
path: root/sdk/sdk_test.go
diff options
context:
space:
mode:
author Martin Stjernholm <mast@google.com> 2020-07-15 14:38:15 +0100
committer Martin Stjernholm <mast@google.com> 2020-07-15 16:58:05 +0100
commit3ff2e661bdbb2f59c1888e1dbd550c9a3ee3cf46 (patch)
treed72a8e4391004013ef5fd209a67e51285228e965 /sdk/sdk_test.go
parent75b1005f77dce21ad2c0baa3803a1dba75a364d5 (diff)
Disable all SDK snapshot generation tests on mac.
We frequently miss putting in the per-test skip condition, and since mac isn't tested in presubmit this leads to build breakages and time consuming reverts. To avoid that this blanket disables all the SDK tests on mac. It's not used there and we got test coverage in many linux-based builds. Bug: 145598135 Bug: 161315642 Test: `go test -v ./sdk` in build/soong on mac and linux Change-Id: I2aea92fef2c0f8c2742396fe36610501dc5a6f0f
Diffstat (limited to 'sdk/sdk_test.go')
-rw-r--r--sdk/sdk_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/sdk/sdk_test.go b/sdk/sdk_test.go
index 56be7417b..ef62b79ba 100644
--- a/sdk/sdk_test.go
+++ b/sdk/sdk_test.go
@@ -15,6 +15,9 @@
package sdk
import (
+ "android/soong/android"
+ "log"
+ "os"
"testing"
"github.com/google/blueprint/proptools"
@@ -22,6 +25,12 @@ import (
// Needed in an _test.go file in this package to ensure tests run correctly, particularly in IDE.
func TestMain(m *testing.M) {
+ if android.BuildOs != android.Linux {
+ // b/145598135 - Generating host snapshots for anything other than linux is not supported.
+ log.Printf("Skipping as sdk snapshot generation is only supported on %s not %s", android.Linux, android.BuildOs)
+ os.Exit(0)
+ }
+
runTestWithBuildDir(m)
}