Bug 863445 - Part 3: Make build/mobile/robocop/Makefile.in produce robocop-debug-signed.apk. r=jmaher
☠☠ backed out by 6d8a73f77af3 ☠ ☠
authorNick Alexander <nalexander@mozilla.com>
Sat, 11 May 2013 16:53:49 -0700
changeset 142607 dac51812454af7591eb140d3cf73a01d566f79fe
parent 142606 611c81436abea784c03905f66711a14ca8e914b5
child 142608 0c854002b29f5940204a880baea2bbf3491faa72
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs863445
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 863445 - Part 3: Make build/mobile/robocop/Makefile.in produce robocop-debug-signed.apk. r=jmaher Also makes the developer-facing `make mochitest-robocop` run robocop-debug-signed.apk, and deprecates `make mochitest-robotium` (since we name this suite robocop on TBPL).
build/mobile/robocop/Makefile.in
build/mobile/robocop/README
mobile/android/base/tests/README.rst
testing/testsuite-targets.mk
toolkit/mozapps/installer/packager.mk
--- a/build/mobile/robocop/Makefile.in
+++ b/build/mobile/robocop/Makefile.in
@@ -75,45 +75,49 @@ MOCHITEST_ROBOCOP_FILES := \
   $(wildcard $(TESTPATH)/robocop*.js) \
   $(NULL)
 
 GARBAGE += \
   AndroidManifest.xml \
   $(java-tests-dep) \
   $(_JAVA_HARNESS) \
   classes.dex \
-  robocop.apk \
   robocop.ap_ \
-  robocop-unsigned-unaligned.apk \
-  robocop-unaligned.apk \
+  robocop-debug-signed.apk \
+  robocop-debug-signed-unaligned.apk \
   $(robocop-deps) \
   $(NULL)
 
 DEFINES += \
   -DANDROID_PACKAGE_NAME=$(ANDROID_PACKAGE_NAME) \
   $(NULL)
 
 JAVA_CLASSPATH = $(ANDROID_SDK)/android.jar:$(ROBOTIUM_PATH)
 
 include $(topsrcdir)/config/rules.mk
 
 # Override rules.mk java flags with the android specific ones
 include $(topsrcdir)/config/android-common.mk
 
 GENERATED_DIRS_tools = classes $(dir-tests)
 
-tools:: $(robocop-deps) robocop.apk
+libs:: robocop-debug-signed.apk
 
 classes.dex: robocop.ap_
 classes.dex: $(robocop-deps)
 classes.dex: $(java-harness-dep)
 classes.dex: $(java-tests-dep)
 	$(JAVAC) $(JAVAC_FLAGS) -d classes $(JAVAFILES) $(_JAVA_HARNESS) $(java-tests-dep)
 	$(DX) --dex --output=$@ classes $(ROBOTIUM_PATH) $(ANDROID_COMPT_LIB)
 
-robocop.apk: $(robocop-deps) robocop.ap_ classes.dex
 robocop.ap_: AndroidManifest.xml $(TESTPATH)/assets/*
 	$(AAPT) package -f -M $< -I $(ANDROID_SDK)/android.jar -I . -S res -A $(TESTPATH)/assets -F $@ -J ./
 
+robocop-debug-signed-unaligned.apk: robocop.ap_ classes.dex
+	$(APKBUILDER) $@ -v $(APKBUILDER_FLAGS) -z robocop.ap_ -f classes.dex
+
+robocop-debug-signed.apk: robocop-debug-signed-unaligned.apk
+	$(ZIPALIGN) -f -v 4 $^ $@
+
 # PP_java-tests not fully usable here
 # Intermediate step toward a library rule.
 $(dir-tests)/%.java: $(TESTPATH)/%.java.in $(call mkdir_deps,$(dir-tests))
 	$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $< > $@
--- a/build/mobile/robocop/README
+++ b/build/mobile/robocop/README
@@ -2,8 +2,11 @@ Robocop is a Mozilla project which uses 
 
 Robotium is an open source tool licensed under the Apache 2.0 license and the original 
 source can be found here:
 http://code.google.com/p/robotium/
 
 We are including robotium-solo-3.6.jar as a binary and are not modifying it in any way 
 from the original download found at: 
 http://code.google.com/p/robotium/
+
+Firefox for Android developers should read the documentation in
+mobile/android/base/tests/README.rst.
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/tests/README.rst
@@ -0,0 +1,43 @@
+Robocop Mochitest
+=================
+
+*Robocop Mochitest* tests run on Native Android builds marked with an
+'rc' in TBPL.  These are Java based tests which run from the mochitest
+harness and generate similar log files.  These are designed for
+testing the native UI of Android devices by sending events to the
+front end.
+
+See the documentation at
+https://wiki.mozilla.org/Auto-tools/Projects/Robocop/WritingTests for
+details.
+
+Development cycle
+-----------------
+
+To deploy the robocop APK to your device and start the robocop test
+suite, use::
+
+    make -C $OBJDIR mochitest-robocop
+
+The Java files in ``mobile/android/base/tests`` are dependencies of the
+robocop APK built by ``build/mobile/robocop``.  If you modify Java files
+in ``mobile/android/base/tests``, you need to rebuild the robocop APK
+with::
+
+    mach build/mobile/robocop
+
+Changes to ``.html``, ``.css``, ``.sjs``, and ``.js`` files in
+``mobile/android/base/tests`` do not require rebuilding the robocop
+APK -- these changes are always 'live', since they are served by the
+mochitest HTTP server and downloaded each test run by your device.
+
+``mach package`` does build and sign a robocop APK, but ``make
+mochitest-robocop`` does not use it.  (This signed APK is used to test
+signed releases on the buildbots).
+
+As always, changes to ``mobile/android/base``, ``mobile/android/chrome``,
+``mobile/android/modules``, etc., require::
+
+    mach mobile/android/base && mach package && mach install
+
+as usual.
--- a/testing/testsuite-targets.mk
+++ b/testing/testsuite-targets.mk
@@ -58,22 +58,22 @@ RERUN_MOCHITEST = \
 RUN_MOCHITEST_REMOTE = \
   rm -f ./$@.log && \
   $(PYTHON) _tests/testing/mochitest/runtestsremote.py --autorun --close-when-done \
     --console-level=INFO --log-file=./$@.log --file-level=INFO $(DM_FLAGS) --dm_trans=$(DM_TRANS) \
     --app=$(TEST_PACKAGE_NAME) --deviceIP=${TEST_DEVICE} --xre-path=${MOZ_HOST_BIN} \
     --testing-modules-dir=$(call core_abspath,_tests/modules) \
     $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
 
-RUN_MOCHITEST_ROBOTIUM = \
+RUN_MOCHITEST_ROBOCOP = \
   rm -f ./$@.log && \
   $(PYTHON) _tests/testing/mochitest/runtestsremote.py \
-    --robocop-apk=$(DIST)/robocop.apk \
+    --robocop-apk=$(DEPTH)/build/mobile/robocop/robocop-debug-signed.apk \
+    --robocop-ini=$(DEPTH)/build/mobile/robocop/robocop.ini \
     --robocop-ids=$(DIST)/fennec_ids.txt \
-    --robocop-ini=$(DEPTH)/build/mobile/robocop/robocop.ini \
     --console-level=INFO --log-file=./$@.log --file-level=INFO $(DM_FLAGS) --dm_trans=$(DM_TRANS) \
     --app=$(TEST_PACKAGE_NAME) --deviceIP=${TEST_DEVICE} --xre-path=${MOZ_HOST_BIN} \
     $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
 
 ifndef NO_FAIL_ON_TEST_ERRORS
 define check_test_error_internal
   @errors=`grep "TEST-UNEXPECTED-" $@.log` ;\
   if test "$$errors" ; then \
@@ -92,24 +92,27 @@ mochitest-remote:
 	@if [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \
         echo "please prepare your host with the environment variable MOZ_HOST_BIN"; \
     elif [ "${TEST_DEVICE}" = "" -a "$(DM_TRANS)" != "adb" ]; then \
         echo "please prepare your host with the environment variable TEST_DEVICE"; \
     else \
         $(RUN_MOCHITEST_REMOTE); \
     fi
 
-mochitest-robotium: DM_TRANS?=adb
-mochitest-robotium:
+mochitest-robotium: mochitest-robocop
+	@echo "mochitest-robotium is deprecated -- please use mochitest-robocop"
+
+mochitest-robocop: DM_TRANS?=adb
+mochitest-robocop:
 	@if [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \
         echo "please prepare your host with the environment variable MOZ_HOST_BIN"; \
     elif [ "${TEST_DEVICE}" = "" -a "$(DM_TRANS)" != "adb" ]; then \
         echo "please prepare your host with the environment variable TEST_DEVICE"; \
     else \
-        $(RUN_MOCHITEST_ROBOTIUM); \
+        $(RUN_MOCHITEST_ROBOCOP); \
     fi
 
 ifdef MOZ_B2G
 mochitest-plain:
 	@if [ "${GAIA_PROFILE_DIR}"  = "" ]; then \
         echo "please specify the GAIA_PROFILE_DIR env variable"; \
     else \
         $(RUN_MOCHITEST_B2G_DESKTOP); \
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -323,19 +323,19 @@ GECKO_APP_AP_PATH = $(call core_abspath,
 
 ifdef ENABLE_TESTS
 INNER_ROBOCOP_PACKAGE=echo
 ifeq ($(MOZ_BUILD_APP),mobile/android)
 UPLOAD_EXTRA_FILES += robocop.apk
 UPLOAD_EXTRA_FILES += fennec_ids.txt
 ROBOCOP_PATH = $(call core_abspath,$(_ABS_DIST)/../build/mobile/robocop)
 INNER_ROBOCOP_PACKAGE= \
-  $(APKBUILDER) $(_ABS_DIST)/robocop-raw.apk -v $(APKBUILDER_FLAGS) -z $(ROBOCOP_PATH)/robocop.ap_ -f $(ROBOCOP_PATH)/classes.dex && \
-  $(JARSIGNER) $(_ABS_DIST)/robocop-raw.apk && \
-  $(ZIPALIGN) -f -v 4 $(_ABS_DIST)/robocop-raw.apk $(_ABS_DIST)/robocop.apk
+  cp $(ROBOCOP_PATH)/robocop-debug-signed-unaligned.apk $(_ABS_DIST)/robocop-unaligned.apk && \
+  $(JARSIGNER) $(_ABS_DIST)/robocop-unaligned.apk && \
+  $(ZIPALIGN) -f -v 4 $(_ABS_DIST)/robocop-unaligned.apk $(_ABS_DIST)/robocop.apk
 endif
 else
 INNER_ROBOCOP_PACKAGE=echo 'Testing is disabled - No Robocop for you'
 endif
 
 ifdef MOZ_OMX_PLUGIN
 DIST_FILES += libomxplugin.so libomxplugingb.so libomxplugingb235.so libomxpluginhc.so libomxpluginsony.so libomxpluginfroyo.so libomxpluginjb-htc.so
 endif