--- a/components/junit/Makefile Thu May 28 13:37:21 2015 -0700
+++ b/components/junit/Makefile Mon Jul 27 16:33:17 2015 -0700
@@ -43,7 +43,24 @@
COMPONENT_BUILD_ARGS += -Djavadocdir=${PROTO_DIR}
COMPONENT_BUILD_ARGS += -Dversion-status=""
COMPONENT_BUILD_ARGS += -Dadditionalparam="-Xdoclint:none"
-COMPONENT_BUILD_TARGETS += dist
+COMPONENT_BUILD_TARGETS = populate-dist
+
+# We patched in test-build into build.xml which is a copy of
+# dist but without the depends=populate-dist
+# because userland infrasture will handle the build and we
+# need to build tests which are also part of the overall softare build.
+COMPONENT_TEST_ARGS += $(COMPONENT_BUILD_ARGS)
+COMPONENT_TEST_TARGETS = test-build
+
+COMPONENT_SYSTEM_TEST_ARGS += -Dsystem-binjar=/usr/share/lib/java/$(COMPONENT_NAME).jar
+COMPONENT_SYSTEM_TEST_TARGETS = test
+
+# Test transforms
+# remove everything upto "test" which is build noise
+# remove time
+COMPONENT_TEST_TRANSFORMS += \
+ '-e "1,/^test/d"' \
+ '-e "s/.*[Tt]ime.*$$//"'
ASLR_MODE = $(ASLR_NOT_APPLICABLE)
@@ -51,16 +68,17 @@
install: build
-# Testing is run as part of the build.
-# To really test AFTER you have installed the resulting package do:
+# Another test is:
+# To test after you have installed the resulting package do:
# $ java -cp /usr/share/lib/java/junit.jar:/usr/share/doc/junit/samples/org \
# junit/samples/money/MoneyTest
# ......................
# Time: 0.003
#
# OK (22 tests)
-test: $(NO_TESTS)
-system-test: $(NO_TESTS)
+test: $(TEST_32)
+
+system-test: build $(SYSTEM_TEST_32)
REQUIRED_PACKAGES += runtime/java/jre-8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/junit/patches/test-build.xml.patch Mon Jul 27 16:33:17 2015 -0700
@@ -0,0 +1,20 @@
+Internal patch to get Userland test working.
+Will not offer upstream.
+
+
+--- junit-r4.11/build.xml_orig 2015-07-16 13:17:09.182838009 -0700
++++ junit-r4.11/build.xml 2015-07-17 13:15:36.944965837 -0700
+@@ -203,6 +203,13 @@
+ </sequential>
+ </macrodef>
+
++ <!-- copy of target name=dist minus depends -->
++ <target name="test-build">
++ <run-dist-tests>
++ <jvmarg value="-Dignore.this=ignored"/>
++ </run-dist-tests>
++ </target>
++
+ <target name="test" depends="build">
+ <run-local-tests />
+ </target>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/junit/patches/test-system-build.xml.patch Mon Jul 27 16:33:17 2015 -0700
@@ -0,0 +1,34 @@
+Internal patch to get Userland system-test working.
+Will not offer upstream.
+
+
+--- junit-r4.11/build.xml_orig 2015-07-21 14:04:27.085904567 -0700
++++ junit-r4.11/build.xml 2015-07-22 16:03:07.512692190 -0700
+@@ -7,6 +7,7 @@
+ <property name="src" value="src/main/java" />
+ <property name="target" location="target" />
+ <property name="bin" location="${target}/main" />
++ <property name="system-binjar" location="/usr/share/lib/java/junit.jar" />
+ <property name="version-base" value="4.11" />
+ <property name="version-status" value="-SNAPSHOT" />
+ <property name="version" value="${version-base}${version-status}" />
+@@ -195,9 +196,8 @@
+ <java classname="org.junit.runner.JUnitCore" fork="yes" failonerror="true">
+ <arg value="org.junit.tests.AllTests"/>
+ <classpath>
+- <pathelement location="${bin}" />
++ <pathelement location="${system-binjar}" />
+ <pathelement location="${testbin}" />
+- <pathelement location="${hamcrestlib}" />
+ </classpath>
+ </java>
+ </sequential>
+@@ -210,7 +210,7 @@
+ </run-dist-tests>
+ </target>
+
+- <target name="test" depends="build">
++ <target name="test">
+ <run-local-tests />
+ </target>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/junit/test/results-32.master Mon Jul 27 16:33:17 2015 -0700
@@ -0,0 +1,9 @@
+ [java] JUnit version 4.11
+ [java] ..................................................................................................................................................................................................................................................................................................................................I.I.....................................................................................................................................................................................I....................................................................................................................
+
+ [java]
+ [java] OK (620 tests)
+ [java]
+
+BUILD SUCCESSFUL
+