From ee0b81a4fe6dc2f9c80427b0f0511185c33f2e51 Mon Sep 17 00:00:00 2001 From: Dan Shi Date: Tue, 6 Oct 2020 15:46:58 -0700 Subject: [PATCH] Revert "Implement vts_config module" This reverts commit ff36da04e8dc8e368df0c3df571f3ca07c195ca1. Reason for revert: remove vts10 harness and build configs Bug: 169581727 Bug: 166662663 Test: build Change-Id: I090b41c99c2279d24f08e4343289cbdcc7934f5d --- android/Android.bp | 2 - android/vts_config.go | 74 --------------------------- android/vts_config_test.go | 50 ------------------ androidmk/androidmk/android.go | 3 +- androidmk/androidmk/androidmk_test.go | 13 ----- 5 files changed, 1 insertion(+), 141 deletions(-) delete mode 100644 android/vts_config.go delete mode 100644 android/vts_config_test.go diff --git a/android/Android.bp b/android/Android.bp index 4ba524141..b4bac3afa 100644 --- a/android/Android.bp +++ b/android/Android.bp @@ -54,7 +54,6 @@ bootstrap_go_package { "util.go", "variable.go", "visibility.go", - "vts_config.go", "writedocs.go", // Lock down environment access last @@ -83,6 +82,5 @@ bootstrap_go_package { "util_test.go", "variable_test.go", "visibility_test.go", - "vts_config_test.go", ], } diff --git a/android/vts_config.go b/android/vts_config.go deleted file mode 100644 index 77fb9fed9..000000000 --- a/android/vts_config.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2016 Google Inc. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package android - -import ( - "fmt" - "io" - "strings" -) - -func init() { - RegisterModuleType("vts_config", VtsConfigFactory) -} - -type vtsConfigProperties struct { - // Override the default (AndroidTest.xml) test manifest file name. - Test_config *string - // Additional test suites to add the test to. - Test_suites []string `android:"arch_variant"` -} - -type VtsConfig struct { - ModuleBase - properties vtsConfigProperties - OutputFilePath OutputPath -} - -func (me *VtsConfig) GenerateAndroidBuildActions(ctx ModuleContext) { - me.OutputFilePath = PathForModuleOut(ctx, me.BaseModuleName()).OutputPath -} - -func (me *VtsConfig) AndroidMk() AndroidMkData { - androidMkData := AndroidMkData{ - Class: "FAKE", - Include: "$(BUILD_SYSTEM)/suite_host_config.mk", - OutputFile: OptionalPathForPath(me.OutputFilePath), - } - androidMkData.Extra = []AndroidMkExtraFunc{ - func(w io.Writer, outputFile Path) { - if me.properties.Test_config != nil { - fmt.Fprintf(w, "LOCAL_TEST_CONFIG := %s\n", - *me.properties.Test_config) - } - fmt.Fprintf(w, "LOCAL_COMPATIBILITY_SUITE := vts10 %s\n", - strings.Join(me.properties.Test_suites, " ")) - }, - } - return androidMkData -} - -func InitVtsConfigModule(me *VtsConfig) { - me.AddProperties(&me.properties) -} - -// vts_config generates a Vendor Test Suite (VTS10) configuration file from the -// xml file and stores it in a subdirectory of $(HOST_OUT). -func VtsConfigFactory() Module { - module := &VtsConfig{} - InitVtsConfigModule(module) - InitAndroidArchModule(module /*TODO: or HostAndDeviceSupported? */, HostSupported, MultilibFirst) - return module -} diff --git a/android/vts_config_test.go b/android/vts_config_test.go deleted file mode 100644 index a95e5899b..000000000 --- a/android/vts_config_test.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2018 Google Inc. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package android - -import ( - "testing" -) - -func testVtsConfig(test *testing.T, bpFileContents string) *TestContext { - config := TestArchConfig(buildDir, nil, bpFileContents, nil) - - ctx := NewTestArchContext() - ctx.RegisterModuleType("vts_config", VtsConfigFactory) - ctx.Register(config) - _, errs := ctx.ParseFileList(".", []string{"Android.bp"}) - FailIfErrored(test, errs) - _, errs = ctx.PrepareBuildActions(config) - FailIfErrored(test, errs) - return ctx -} - -func TestVtsConfig(t *testing.T) { - t.Parallel() - ctx := testVtsConfig(t, ` -vts_config { name: "plain"} -vts_config { name: "with_manifest", test_config: "manifest.xml" } -`) - - variants := ctx.ModuleVariantsForTests("plain") - if len(variants) > 1 { - t.Errorf("expected 1, got %d", len(variants)) - } - expectedOutputFilename := ctx.ModuleForTests( - "plain", variants[0]).Module().(*VtsConfig).OutputFilePath.Base() - if expectedOutputFilename != "plain" { - t.Errorf("expected plain, got %q", expectedOutputFilename) - } -} diff --git a/androidmk/androidmk/android.go b/androidmk/androidmk/android.go index eaf06c59f..739a9658f 100644 --- a/androidmk/androidmk/android.go +++ b/androidmk/androidmk/android.go @@ -953,8 +953,7 @@ var prebuiltTypes = map[string]string{ var soongModuleTypes = map[string]bool{} var includePathToModule = map[string]string{ - "test/vts/tools/build/Android.host_config.mk": "vts_config", - // The rest will be populated dynamically in androidScope below + // The content will be populated dynamically in androidScope below } func mapIncludePath(path string) (string, bool) { diff --git a/androidmk/androidmk/androidmk_test.go b/androidmk/androidmk/androidmk_test.go index 560ea13b9..6e70129f8 100644 --- a/androidmk/androidmk/androidmk_test.go +++ b/androidmk/androidmk/androidmk_test.go @@ -1254,19 +1254,6 @@ prebuilt_firmware { relative_install_path: "bar", proprietary: true, } -`, - }, - { - desc: "vts_config", - in: ` -include $(CLEAR_VARS) -LOCAL_MODULE := vtsconf -include test/vts/tools/build/Android.host_config.mk -`, - expected: ` -vts_config { - name: "vtsconf", -} `, }, {