From e8a791ee6e8b578d868f2ca0f427fb7d1748f5af Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Thu, 20 Apr 2017 20:47:58 -0400 Subject: [PATCH] [tests] Run the Java.Interop unit tests Bump to Java.Interop/master/8d7060d1 Bump to cecil/master/5f93431f We'd like to run the Java.Interop unit tests as part of the xamarin-android `make run-all-tests` target, for two rasons: 1. An extra layer of sanity checking, and 2. Some of the Java.Interop tests require an Android SDK. In particular, the `ParameterFixupTests.XmlDeclaration_FixedUpFromDocumentation()` test from `Xamarin.Android.Tools.Bytecode-Tests.dll` attempts to read Android documentation from `$ANDROID_SDK_PATH` to test parameter name fixups. However, Java.Interop doesn't install -- and thus can't readily require -- an Android SDK, meaning this test is never executed as part of the Java.Interop Jenkins process. That test *can* be readily executed in xamarin-android, as it *does* install an Android SDK, and thus its presence can be assumed. Add a new `make run-ji-tests` target which runs the Java.Interop unit tests, copying their test output into the same directory that the other `TestResult-*.xml` files are placed, so that Jenkins can pick them up for display. Within the `make run-ji-tests` target, export the `ANDROID_SDK_PATH` environment variable so that *all* the `Xamarin.Android.Tools.Bytecode-Tests.dll` tests can execute. Which introduces two problems: 1. The `Xamarin.Android.Tools.Bytecode-Tests.dll` tests require that `$ANDROID_SDK_PATH` contain documentation...which we're not currently installing. 2. The Java.Interop tests still fail, due to parameter name changes, as those tests were originally using API-18 docs. Result: the `ParameterFixupTest` tests fail. :-( Fix this conundrum by instaslling `docs-24_r01.zip` within `$(AndroidSdkDirectory)`, allowing the tests to execute as intended, and by updating to Java.Interop/master/8d7060d1, which updates the expected parameter name output. --- Makefile | 7 ++++++- build-tools/android-toolchain/android-toolchain.projitems | 4 ++++ external/Java.Interop | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index de40861ad16..4e1d4bdf477 100644 --- a/Makefile +++ b/Makefile @@ -136,7 +136,7 @@ linux-prepare-$(LINUX_DISTRO):: linux-prepare-$(LINUX_DISTRO)-$(LINUX_DISTRO_RELEASE):: endif -run-all-tests: run-nunit-tests run-apk-tests +run-all-tests: run-nunit-tests run-ji-tests run-apk-tests clean: $(MSBUILD) $(MSBUILD_FLAGS) /t:Clean Xamarin.Android.sln @@ -165,6 +165,11 @@ endef run-nunit-tests: $(NUNIT_TESTS) $(foreach t,$(NUNIT_TESTS), $(call RUN_NUNIT_TEST,$(t),1)) +run-ji-tests: + $(MAKE) -C "$(call GetPath,JavaInterop)" CONFIGURATION=$(CONFIGURATION) all + ANDROID_SDK_PATH="$(call GetPath,AndroidSdk)" $(MAKE) -C "$(call GetPath,JavaInterop)" CONFIGURATION=$(CONFIGURATION) run-all-tests || true + cp "$(call GetPath,JavaInterop)"/TestResult-*.xml . + # .apk files to test on-device need to: # (1) Have their .csproj files listed here # (2) Add a `@(UnitTestApk)` entry to `tests/RunApkTests.targets` diff --git a/build-tools/android-toolchain/android-toolchain.projitems b/build-tools/android-toolchain/android-toolchain.projitems index 0ec3febdd4e..725030eb600 100644 --- a/build-tools/android-toolchain/android-toolchain.projitems +++ b/build-tools/android-toolchain/android-toolchain.projitems @@ -90,6 +90,10 @@ extras\android\m2repository + + + docs + sys-img/android/ diff --git a/external/Java.Interop b/external/Java.Interop index 5eeb287b890..8d7060d1372 160000 --- a/external/Java.Interop +++ b/external/Java.Interop @@ -1 +1 @@ -Subproject commit 5eeb287b890805488949658d2df07bbd2a492687 +Subproject commit 8d7060d1372104ed75dc3550ab904a702298f0a6