Skip to content

Commit

Permalink
Bug 863445 - Part 3: Make build/mobile/robocop/Makefile.in produce ro…
Browse files Browse the repository at this point in the history
…bocop-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).
  • Loading branch information
ncalexan committed May 11, 2013
1 parent 1f1211c commit 2d6ac58
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 14 deletions.
14 changes: 9 additions & 5 deletions build/mobile/robocop/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,9 @@ GARBAGE += \
$(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)

Expand All @@ -98,7 +97,7 @@ 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)
Expand All @@ -107,10 +106,15 @@ 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))
Expand Down
3 changes: 3 additions & 0 deletions build/mobile/robocop/README
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ 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.
43 changes: 43 additions & 0 deletions mobile/android/base/tests/README.rst
Original file line number Diff line number Diff line change
@@ -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.
15 changes: 9 additions & 6 deletions testing/testsuite-targets.mk
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ RUN_MOCHITEST_REMOTE = \
--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-ids=$(DIST)/fennec_ids.txt \
--robocop-apk=$(DEPTH)/build/mobile/robocop/robocop-debug-signed.apk \
--robocop-ini=$(DEPTH)/build/mobile/robocop/robocop.ini \
--robocop-ids=$(DIST)/fennec_ids.txt \
--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)
Expand Down Expand Up @@ -97,14 +97,17 @@ mochitest-remote:
$(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
Expand Down
6 changes: 3 additions & 3 deletions toolkit/mozapps/installer/packager.mk
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,9 @@ 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'
Expand Down

0 comments on commit 2d6ac58

Please sign in to comment.