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
This commit is contained in:
Martin Stjernholm 2020-07-15 14:38:15 +01:00
parent 75b1005f77
commit 3ff2e661bd
4 changed files with 9 additions and 61 deletions

View file

@ -481,9 +481,6 @@ module_exports_snapshot {
}
func TestMultipleHostOsTypesSnapshotWithCcBinary(t *testing.T) {
// b/145598135 - Generating host snapshots for anything other than linux is not supported.
SkipIfNotLinux(t)
result := testSdkWithCc(t, `
module_exports {
name: "myexports",
@ -592,9 +589,6 @@ module_exports_snapshot {
// Test that we support the necessary flags for the linker binary, which is
// special in several ways.
func TestSnapshotWithCcStaticNocrtBinary(t *testing.T) {
// b/145598135 - Generating host snapshots for anything other than linux is not supported.
SkipIfNotLinux(t)
result := testSdkWithCc(t, `
module_exports {
name: "mymodule_exports",
@ -943,9 +937,6 @@ sdk_snapshot {
}
func TestHostSnapshotWithCcSharedLibrary(t *testing.T) {
// b/145598135 - Generating host snapshots for anything other than linux is not supported.
SkipIfNotLinux(t)
result := testSdkWithCc(t, `
sdk {
name: "mysdk",
@ -1038,9 +1029,6 @@ include/Test.h -> include/include/Test.h
}
func TestMultipleHostOsTypesSnapshotWithCcSharedLibrary(t *testing.T) {
// b/145598135 - Generating host snapshots for anything other than linux is not supported.
SkipIfNotLinux(t)
result := testSdkWithCc(t, `
sdk {
name: "mysdk",
@ -1213,9 +1201,6 @@ include/Test.h -> include/include/Test.h
}
func TestHostSnapshotWithCcStaticLibrary(t *testing.T) {
// b/145598135 - Generating host snapshots for anything other than linux is not supported.
SkipIfNotLinux(t)
result := testSdkWithCc(t, `
module_exports {
name: "myexports",
@ -1391,9 +1376,6 @@ include/Test.h -> include/include/Test.h
}
func TestHostSnapshotWithMultiLib64(t *testing.T) {
// b/145598135 - Generating host snapshots for anything other than linux is not supported.
SkipIfNotLinux(t)
result := testSdkWithCc(t, `
module_exports {
name: "myexports",
@ -1523,9 +1505,6 @@ include/Test.h -> include/include/Test.h
}
func TestHostSnapshotWithCcHeadersLibrary(t *testing.T) {
// b/145598135 - Generating host snapshots for anything other than linux is not supported.
SkipIfNotLinux(t)
result := testSdkWithCc(t, `
sdk {
name: "mysdk",
@ -1579,9 +1558,6 @@ include/Test.h -> include/include/Test.h
}
func TestDeviceAndHostSnapshotWithCcHeadersLibrary(t *testing.T) {
// b/145598135 - Generating host snapshots for anything other than linux is not supported.
SkipIfNotLinux(t)
result := testSdkWithCc(t, `
sdk {
name: "mysdk",
@ -1656,9 +1632,6 @@ include-host/HostTest.h -> linux_glibc/include/include-host/HostTest.h
}
func TestSystemSharedLibPropagation(t *testing.T) {
// b/145598135 - Generating host snapshots for anything other than linux is not supported.
SkipIfNotLinux(t)
result := testSdkWithCc(t, `
sdk {
name: "mysdk",
@ -1923,9 +1896,6 @@ sdk_snapshot {
}
func TestDeviceAndHostSnapshotWithStubsLibrary(t *testing.T) {
// b/145598135 - Generating host snapshots for anything other than linux is not supported.
SkipIfNotLinux(t)
result := testSdkWithCc(t, `
sdk {
name: "mysdk",
@ -2009,9 +1979,6 @@ sdk_snapshot {
}
func TestUniqueHostSoname(t *testing.T) {
// b/145598135 - Generating host snapshots for anything other than linux is not supported.
SkipIfNotLinux(t)
result := testSdkWithCc(t, `
sdk {
name: "mysdk",

View file

@ -265,9 +265,6 @@ aidl/foo/bar/Test.aidl -> aidl/aidl/foo/bar/Test.aidl
}
func TestHostSnapshotWithJavaHeaderLibrary(t *testing.T) {
// b/145598135 - Generating host snapshots for anything other than linux is not supported.
SkipIfNotLinux(t)
result := testSdkWithJava(t, `
sdk {
name: "mysdk",
@ -325,9 +322,6 @@ aidl/foo/bar/Test.aidl -> aidl/aidl/foo/bar/Test.aidl
}
func TestDeviceAndHostSnapshotWithJavaHeaderLibrary(t *testing.T) {
// b/145598135 - Generating host snapshots for anything other than linux is not supported.
SkipIfNotLinux(t)
result := testSdkWithJava(t, `
sdk {
name: "mysdk",
@ -441,9 +435,6 @@ aidl/foo/bar/Test.aidl -> aidl/aidl/foo/bar/Test.aidl
}
func TestHostSnapshotWithJavaImplLibrary(t *testing.T) {
// b/145598135 - Generating host snapshots for anything other than linux is not supported.
SkipIfNotLinux(t)
result := testSdkWithJava(t, `
module_exports {
name: "myexports",
@ -548,9 +539,6 @@ module_exports_snapshot {
}
func TestHostSnapshotWithJavaTest(t *testing.T) {
// b/145598135 - Generating host snapshots for anything other than linux is not supported.
SkipIfNotLinux(t)
result := testSdkWithJava(t, `
module_exports {
name: "myexports",
@ -692,9 +680,6 @@ module_exports_snapshot {
}
func TestHostSnapshotWithDroidstubs(t *testing.T) {
// b/145598135 - Generating host snapshots for anything other than linux is not supported.
SkipIfNotLinux(t)
result := testSdkWithDroidstubs(t, `
module_exports {
name: "myexports",
@ -835,9 +820,6 @@ sdk_snapshot {
}
func TestHostSnapshotWithJavaSystemModules(t *testing.T) {
// b/145598135 - Generating host snapshots for anything other than linux is not supported.
SkipIfNotLinux(t)
result := testSdkWithJava(t, `
sdk {
name: "mysdk",
@ -913,9 +895,6 @@ sdk_snapshot {
}
func TestDeviceAndHostSnapshotWithOsSpecificMembers(t *testing.T) {
// b/145598135 - Generating host snapshots for anything other than linux is not supported.
SkipIfNotLinux(t)
result := testSdkWithJava(t, `
module_exports {
name: "myexports",

View file

@ -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)
}

View file

@ -422,10 +422,3 @@ func runTestWithBuildDir(m *testing.M) {
os.Exit(run())
}
func SkipIfNotLinux(t *testing.T) {
t.Helper()
if android.BuildOs != android.Linux {
t.Skipf("Skipping as sdk snapshot generation is only supported on %s not %s", android.Linux, android.BuildOs)
}
}