From db462dd9878e6d412139e853e2c1224caf7452a3 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Sun, 21 Mar 2021 22:01:55 +0000 Subject: Disallow non-existent paths in sdk package Test behavior was changed a while ago so that tests by default ignore non-existent source paths (unless they explicitly check for/rely on them). Prior to that CheckSnapshot() could detect when files were missing from the snapshot but it no longer can. This change disallows non-existent source files in all the sdk tests which means that they are disallowed when processing the snapshots as they use the same preparers as were used to process the sources. This caused a test failure which has been temporarily ignored and has a TODO and bug associated with it. Bug: 183184375 Test: m nothing Change-Id: I969d8515d20ef5ae515f2b5f93d8ed4e4f8ede75 --- sdk/cc_sdk_test.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sdk/cc_sdk_test.go') diff --git a/sdk/cc_sdk_test.go b/sdk/cc_sdk_test.go index 6c02bf755..a886a18ce 100644 --- a/sdk/cc_sdk_test.go +++ b/sdk/cc_sdk_test.go @@ -486,6 +486,9 @@ func TestSnapshotWithCcExportGeneratedHeaders(t *testing.T) { } `) + // TODO(b/183322862): Remove this and fix the issue. + errorHandler := android.FixtureExpectsAtLeastOneErrorMatchingPattern(`module source path "snapshot/include_gen/generated_foo/gen/protos" does not exist`) + CheckSnapshot(t, result, "mysdk", "", checkUnversionedAndroidBpContents(` // This is auto-generated. DO NOT EDIT. @@ -518,6 +521,9 @@ myinclude/Test.h -> include/myinclude/Test.h .intermediates/mynativelib/android_arm64_armv8-a_shared/mynativelib.so -> arm64/lib/mynativelib.so .intermediates/mynativelib/android_arm_armv7-a-neon_shared/mynativelib.so -> arm/lib/mynativelib.so `), + snapshotTestErrorHandler(checkSnapshotWithoutSource, errorHandler), + snapshotTestErrorHandler(checkSnapshotWithSourcePreferred, errorHandler), + snapshotTestErrorHandler(checkSnapshotPreferredWithSource, errorHandler), ) } -- cgit v1.2.3-59-g8ed1b