diff options
author | 2021-03-09 22:27:13 +0000 | |
---|---|---|
committer | 2021-03-11 17:25:29 +0000 | |
commit | 4a2a29ce6a6cf558292874ec9e8714df3918b25b (patch) | |
tree | c27b2e28c06268185d1100958ca0857b601af9c2 /sdk/cc_sdk_test.go | |
parent | 37aad605075130a6c682a8a60eee31bd9c3d428d (diff) |
Support test fixtures in sdk package
Bug: 181070625
Test: m nothing
Change-Id: Ifc96992e54c1b1d89a82b88ab27e555ae267a51e
Diffstat (limited to 'sdk/cc_sdk_test.go')
-rw-r--r-- | sdk/cc_sdk_test.go | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sdk/cc_sdk_test.go b/sdk/cc_sdk_test.go index 6da135a32..28c9e9e28 100644 --- a/sdk/cc_sdk_test.go +++ b/sdk/cc_sdk_test.go @@ -21,7 +21,7 @@ import ( "android/soong/cc" ) -var ccTestFs = map[string][]byte{ +var ccTestFs = android.MockFS{ "Test.cpp": nil, "myinclude/Test.h": nil, "myinclude-android/AndroidTest.h": nil, @@ -32,7 +32,7 @@ var ccTestFs = map[string][]byte{ "some/where/stubslib.map.txt": nil, } -func testSdkWithCc(t *testing.T, bp string) *testSdkResult { +func testSdkWithCc(t *testing.T, bp string) *android.TestResult { t.Helper() return testSdkWithFs(t, bp, ccTestFs) } @@ -808,7 +808,15 @@ module_exports_snapshot { } func TestSnapshotWithSingleHostOsType(t *testing.T) { - ctx, config := testSdkContext(` + result := sdkFixtureFactory.Extend( + ccTestFs.AddToFixture(), + cc.PrepareForTestOnLinuxBionic, + android.FixtureModifyConfig(func(config android.Config) { + config.Targets[android.LinuxBionic] = []android.Target{ + {android.LinuxBionic, android.Arch{ArchType: android.X86_64}, android.NativeBridgeDisabled, "", "", false}, + } + }), + ).RunTestWithBp(t, ` cc_defaults { name: "mydefaults", device_supported: false, @@ -849,9 +857,7 @@ func TestSnapshotWithSingleHostOsType(t *testing.T) { ], stl: "none", } - `, ccTestFs, []android.OsType{android.LinuxBionic}) - - result := runTests(t, ctx, config) + `) CheckSnapshot(result, "myexports", "", checkUnversionedAndroidBpContents(` |