diff options
| author | 2021-03-25 18:09:06 +0000 | |
|---|---|---|
| committer | 2021-03-25 18:09:06 +0000 | |
| commit | 863ecfb7ba93e8033c85271589ce442448084288 (patch) | |
| tree | fd3d87c1f91e83cffebeec4ad5b058647bfb31de /sdk/java_sdk_test.go | |
| parent | cf0bc53bc34247fca1f4e8cdc00c1e38d08e3d6f (diff) | |
| parent | db462dd9878e6d412139e853e2c1224caf7452a3 (diff) | |
Merge "Disallow non-existent paths in sdk package"
Diffstat (limited to 'sdk/java_sdk_test.go')
| -rw-r--r-- | sdk/java_sdk_test.go | 22 | 
1 files changed, 20 insertions, 2 deletions
| diff --git a/sdk/java_sdk_test.go b/sdk/java_sdk_test.go index 6f78ded35..2bc248d22 100644 --- a/sdk/java_sdk_test.go +++ b/sdk/java_sdk_test.go @@ -24,6 +24,16 @@ import (  var prepareForSdkTestWithJava = android.GroupFixturePreparers(  	java.PrepareForTestWithJavaBuildComponents,  	PrepareForTestWithSdkBuildComponents, + +	// Ensure that all source paths are provided. This helps ensure that the snapshot generation is +	// consistent and all files referenced from the snapshot's Android.bp file have actually been +	// copied into the snapshot. +	android.PrepareForTestDisallowNonExistentPaths, + +	// Files needs by most of the tests. +	android.MockFS{ +		"Test.java": nil, +	}.AddToFixture(),  )  var prepareForSdkTestWithJavaSdkLibrary = android.GroupFixturePreparers( @@ -339,6 +349,7 @@ func TestSnapshotWithJavaImplLibrary(t *testing.T) {  	result := android.GroupFixturePreparers(  		prepareForSdkTestWithJava,  		android.FixtureAddFile("aidl/foo/bar/Test.aidl", nil), +		android.FixtureAddFile("resource.txt", nil),  	).RunTestWithBp(t, `  		module_exports {  			name: "myexports", @@ -394,7 +405,11 @@ aidl/foo/bar/Test.aidl -> aidl/aidl/foo/bar/Test.aidl  }  func TestSnapshotWithJavaBootLibrary(t *testing.T) { -	result := android.GroupFixturePreparers(prepareForSdkTestWithJava).RunTestWithBp(t, ` +	result := android.GroupFixturePreparers( +		prepareForSdkTestWithJava, +		android.FixtureAddFile("aidl", nil), +		android.FixtureAddFile("resource.txt", nil), +	).RunTestWithBp(t, `  		module_exports {  			name: "myexports",  			java_boot_libs: ["myjavalib"], @@ -1539,7 +1554,10 @@ sdk_snapshot {  }  func TestSnapshotWithJavaSdkLibrary_DoctagFiles(t *testing.T) { -	result := android.GroupFixturePreparers(prepareForSdkTestWithJavaSdkLibrary).RunTestWithBp(t, ` +	result := android.GroupFixturePreparers( +		prepareForSdkTestWithJavaSdkLibrary, +		android.FixtureAddFile("docs/known_doctags", nil), +	).RunTestWithBp(t, `  		sdk {  			name: "mysdk",  			java_sdk_libs: ["myjavalib"], |