Bug 863445 - Part 3: Make build/mobile/robocop/Makefile.in produce robocop-debug-signed.apk. r=jmaher
authorNick Alexander <nalexander@mozilla.com>
Mon, 20 May 2013 11:39:50 -0700
changeset 143939 ea47a388215ddff7bbb6e2f9ce47cbd9fb224e2a
parent 143938 b7272530bd7cec9fef95f9a4bfa3eb16df353c7b
child 143940 b0d07be09b86c25f018504cc4852ccb63f9e8775
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs863445
milestone24.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,20 +58,20 @@ 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-ids=$(DEPTH)/mobile/android/base/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
@@ -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
@@ -324,19 +324,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= \
   $(NSINSTALL) $(GECKO_APP_AP_PATH)/fennec_ids.txt $(_ABS_DIST) && \
-  $(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