From d38e63d474f74c8555344d852548b417f776fd53 Mon Sep 17 00:00:00 2001 From: mrziwang Date: Mon, 15 Jul 2024 13:43:37 -0700 Subject: Remove OutputFileProducer All the module types that were using OutputFileProducer are using OutputFilesProvider now. This CL removes the remaining OutputFileProducer code. Test: CI Bug: 339477385 Change-Id: I3c29785a59b907117b16ca2d0e56ef846adfb228 --- android/testing.go | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'android/testing.go') diff --git a/android/testing.go b/android/testing.go index 18fd3b31c..e39a1a749 100644 --- a/android/testing.go +++ b/android/testing.go @@ -1018,31 +1018,21 @@ func (m TestingModule) VariablesForTestsRelativeToTop() map[string]string { return normalizeStringMapRelativeToTop(m.config, m.module.VariablesForTests()) } -// OutputFiles first checks if module base outputFiles property has any output +// OutputFiles checks if module base outputFiles property has any output // files can be used to return. -// If not, it calls OutputFileProducer.OutputFiles on the -// encapsulated module, exits the test immediately if there is an error and +// Exits the test immediately if there is an error and // otherwise returns the result of calling Paths.RelativeToTop // on the returned Paths. func (m TestingModule) OutputFiles(t *testing.T, tag string) Paths { - // TODO: remove OutputFileProducer part outputFiles := m.Module().base().outputFiles if tag == "" && outputFiles.DefaultOutputFiles != nil { return outputFiles.DefaultOutputFiles.RelativeToTop() } else if taggedOutputFiles, hasTag := outputFiles.TaggedOutputFiles[tag]; hasTag { - return taggedOutputFiles + return taggedOutputFiles.RelativeToTop() } - producer, ok := m.module.(OutputFileProducer) - if !ok { - t.Fatalf("%q must implement OutputFileProducer\n", m.module.Name()) - } - paths, err := producer.OutputFiles(tag) - if err != nil { - t.Fatal(err) - } - - return paths.RelativeToTop() + t.Fatal(fmt.Errorf("No test output file has been set for tag %q", tag)) + return nil } // TestingSingleton is wrapper around an android.Singleton that provides methods to find information about individual -- cgit v1.2.3-59-g8ed1b