diff options
| author | 2019-07-01 02:06:57 +0000 | |
|---|---|---|
| committer | 2019-07-01 02:06:57 +0000 | |
| commit | e65d84c84cca3d7193bce3d410840b72100b9fca (patch) | |
| tree | 9d856eb95c9e1bf64502a2c636bc5b1472bb0914 /java/java_test.go | |
| parent | a3ded95424e9a71d827518e42dbc4c2450cc1a6b (diff) | |
| parent | 6bd33c13bb552d3eee52bcc553b35d55dd91fe98 (diff) | |
Merge "Enforce hidden api usage in vendor (soong)"
Diffstat (limited to 'java/java_test.go')
| -rw-r--r-- | java/java_test.go | 26 | 
1 files changed, 26 insertions, 0 deletions
| diff --git a/java/java_test.go b/java/java_test.go index a98ea8443..677174d39 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -286,6 +286,32 @@ func TestSimple(t *testing.T) {  	}  } +func TestSdkVersion(t *testing.T) { +	ctx := testJava(t, ` +		java_library { +			name: "foo", +			srcs: ["a.java"], +			vendor: true, +		} + +		java_library { +			name: "bar", +			srcs: ["b.java"], +		} +	`) + +	foo := ctx.ModuleForTests("foo", "android_common").Module().(*Library) +	bar := ctx.ModuleForTests("bar", "android_common").Module().(*Library) + +	if foo.sdkVersion() != "system_current" { +		t.Errorf("If sdk version of vendor module is empty, it must change to system_current.") +	} + +	if bar.sdkVersion() != "" { +		t.Errorf("If sdk version of non-vendor module is empty, it keeps empty.") +	} +} +  func TestArchSpecific(t *testing.T) {  	ctx := testJava(t, `  		java_library { |