mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-02 22:37:50 +00:00
Backed out e7739a472f09, 3fd142236a0f, and 382ec69cdfb1 (Bug 863445) for Android rc1 and rc2 failures on a CLOSED TREE. r=me
--HG-- rename : mobile/android/base/fennec-ids-generator.py => build/mobile/robocop/parse_ids.py
This commit is contained in:
parent
48cef19b86
commit
ff732cfe09
@ -64,6 +64,7 @@ robocop_DEST := $(CURDIR)
|
||||
robocop_FILES := \
|
||||
$(TESTPATH)/robocop.ini \
|
||||
$(TESTPATH)/robocop_autophone.ini \
|
||||
$(srcdir)/parse_ids.py \
|
||||
$(NULL)
|
||||
robocop-deps := $(notdir $(robocop_FILES))
|
||||
|
||||
@ -80,9 +81,10 @@ GARBAGE += \
|
||||
$(java-tests-dep) \
|
||||
$(_JAVA_HARNESS) \
|
||||
classes.dex \
|
||||
robocop.apk \
|
||||
robocop.ap_ \
|
||||
robocop-debug-signed.apk \
|
||||
robocop-debug-signed-unaligned.apk \
|
||||
robocop-unsigned-unaligned.apk \
|
||||
robocop-unaligned.apk \
|
||||
$(robocop-deps) \
|
||||
$(NULL)
|
||||
|
||||
@ -99,7 +101,7 @@ include $(topsrcdir)/config/android-common.mk
|
||||
|
||||
GENERATED_DIRS_tools = classes $(dir-tests)
|
||||
|
||||
libs:: robocop-debug-signed.apk
|
||||
tools:: $(robocop-deps) robocop.apk
|
||||
|
||||
classes.dex: robocop.ap_
|
||||
classes.dex: $(robocop-deps)
|
||||
@ -108,15 +110,10 @@ 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))
|
||||
|
@ -7,6 +7,3 @@ 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.
|
||||
|
@ -12,27 +12,27 @@ def getFile(filename):
|
||||
data = fHandle.read()
|
||||
fHandle.close()
|
||||
return data
|
||||
|
||||
|
||||
def findIDs(data):
|
||||
start_function = False
|
||||
reID = re.compile('.*public static final class id {.*')
|
||||
reEnd = re.compile('.*}.*')
|
||||
idlist = []
|
||||
|
||||
|
||||
for line in data.split('\n'):
|
||||
if reEnd.match(line):
|
||||
start_function = False
|
||||
|
||||
|
||||
if start_function:
|
||||
id_value = line.split(' ')[-1]
|
||||
idlist.append(id_value.split(';')[0].split('='))
|
||||
|
||||
|
||||
if reID.match(line):
|
||||
start_function = True
|
||||
|
||||
|
||||
return idlist
|
||||
|
||||
|
||||
|
||||
|
||||
def printIDs(outputFile, idlist):
|
||||
fOutput = open(outputFile, 'w')
|
||||
for item in idlist:
|
||||
@ -46,7 +46,7 @@ def main(args=sys.argv[1:]):
|
||||
parser.add_option('-i', '--input', dest='inputFile', default='',
|
||||
help="filename of the input R.java file")
|
||||
options, args = parser.parse_args(args)
|
||||
|
||||
|
||||
if options.inputFile == '':
|
||||
print "Error: please provide input file: -i <filename>"
|
||||
sys.exit(1)
|
||||
@ -61,3 +61,4 @@ def main(args=sys.argv[1:]):
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@ -1091,10 +1091,6 @@ ifdef MOZ_WEBRTC
|
||||
ALL_JARS += jars/webrtc.jar
|
||||
endif
|
||||
|
||||
INSTALL_TARGETS += fennec_ids
|
||||
fennec_ids_FILES := fennec_ids.txt
|
||||
fennec_ids_DEST := $(DIST)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
# Override the Java settings with some specific android settings
|
||||
@ -1261,9 +1257,6 @@ R.java: $(MOZ_APP_ICON) $(RESOURCES) $(RES_DRAWABLE) $(RES_BRANDING_DRAWABLE_MDP
|
||||
gecko.ap_: AndroidManifest.xml res/drawable-mdpi/icon.png res/drawable-hdpi/icon.png res/drawable-xhdpi/icon.png res/drawable-xxhdpi/icon.png $(RESOURCES) $(RES_DRAWABLE) $(RES_BRANDING_DRAWABLE_MDPI) $(PP_RES_XML) res/values/strings.xml FORCE
|
||||
$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -S res -F $@
|
||||
|
||||
fennec_ids.txt: fennec-ids-generator.py R.java
|
||||
$(PYTHON) $(topsrcdir)/mobile/android/base/fennec-ids-generator.py -i R.java -o $@
|
||||
|
||||
libs:: classes.dex package-name.txt jni-stubs.inc
|
||||
$(INSTALL) classes.dex $(FINAL_TARGET)
|
||||
$(INSTALL) package-name.txt $(FINAL_TARGET)
|
||||
|
@ -1,43 +0,0 @@
|
||||
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.
|
@ -80,24 +80,14 @@ class RemoteOptions(MochitestOptions):
|
||||
help = "name of the pidfile to generate")
|
||||
defaults["pidFile"] = ""
|
||||
|
||||
self.add_option("--robocop-ini", action = "store",
|
||||
type = "string", dest = "robocopIni",
|
||||
help = "name of the .ini file containing the list of tests to run")
|
||||
defaults["robocopIni"] = ""
|
||||
|
||||
self.add_option("--robocop", action = "store",
|
||||
type = "string", dest = "robocop",
|
||||
help = "name of the .ini file containing the list of tests to run. [DEPRECATED- please use --robocop-ini")
|
||||
help = "name of the .ini file containing the list of tests to run")
|
||||
defaults["robocop"] = ""
|
||||
|
||||
self.add_option("--robocop-apk", action = "store",
|
||||
type = "string", dest = "robocopApk",
|
||||
help = "name of the Robocop APK to use for ADB test running")
|
||||
defaults["robocopApk"] = ""
|
||||
|
||||
self.add_option("--robocop-path", action = "store",
|
||||
type = "string", dest = "robocopPath",
|
||||
help = "Path to the folder where robocop.apk is located at. Primarily used for ADB test running. [DEPRECATED- please use --robocop-apk]")
|
||||
help = "Path to the folder where robocop.apk is located at. Primarily used for ADB test running")
|
||||
defaults["robocopPath"] = ""
|
||||
|
||||
self.add_option("--robocop-ids", action = "store",
|
||||
@ -168,37 +158,22 @@ class RemoteOptions(MochitestOptions):
|
||||
f.write("%s" % os.getpid())
|
||||
f.close()
|
||||
|
||||
# Robocop specific deprecated options.
|
||||
if options.robocop:
|
||||
if options.robocopIni:
|
||||
print "ERROR: can not use deprecated --robocop and replacement --robocop-ini together"
|
||||
return None
|
||||
options.robocopIni = options.robocop
|
||||
del options.robocop
|
||||
|
||||
if options.robocopPath:
|
||||
if options.robocopApk:
|
||||
print "ERROR: can not use deprecated --robocop-path and replacement --robocop-apk together"
|
||||
return None
|
||||
options.robocopApk = os.path.join(options.robocopPath, 'robocop.apk')
|
||||
del options.robocopPath
|
||||
|
||||
# Robocop specific options
|
||||
if options.robocopIni != "":
|
||||
if not os.path.exists(options.robocopIni):
|
||||
print "ERROR: Unable to find specified robocop .ini manifest '%s'" % options.robocopIni
|
||||
if options.robocop != "":
|
||||
if not os.path.exists(options.robocop):
|
||||
print "ERROR: Unable to find specified manifest '%s'" % options.robocop
|
||||
return None
|
||||
options.robocopIni = os.path.abspath(options.robocopIni)
|
||||
options.robocop = os.path.abspath(options.robocop)
|
||||
|
||||
if options.robocopApk != "":
|
||||
if not os.path.exists(options.robocopApk):
|
||||
print "ERROR: Unable to find robocop APK '%s'" % options.robocopApk
|
||||
if options.robocopPath != "":
|
||||
if not os.path.exists(os.path.join(options.robocopPath, 'robocop.apk')):
|
||||
print "ERROR: Unable to find robocop.apk in path '%s'" % options.robocopPath
|
||||
return None
|
||||
options.robocopApk = os.path.abspath(options.robocopApk)
|
||||
options.robocopPath = os.path.abspath(options.robocopPath)
|
||||
|
||||
if options.robocopIds != "":
|
||||
if not os.path.exists(options.robocopIds):
|
||||
print "ERROR: Unable to find specified robocop IDs file '%s'" % options.robocopIds
|
||||
print "ERROR: Unable to find specified IDs file '%s'" % options.robocopIds
|
||||
return None
|
||||
options.robocopIds = os.path.abspath(options.robocopIds)
|
||||
|
||||
@ -333,7 +308,7 @@ class MochiRemote(Mochitest):
|
||||
self._dm.removeDir(self.remoteProfile)
|
||||
|
||||
# we do not need this for robotium based tests, lets save a LOT of time
|
||||
if options.robocopIni:
|
||||
if options.robocop:
|
||||
shutil.rmtree(os.path.join(options.profilePath, 'webapps'))
|
||||
shutil.rmtree(os.path.join(options.profilePath, 'extensions', 'staged', 'mochikit@mozilla.org'))
|
||||
shutil.rmtree(os.path.join(options.profilePath, 'extensions', 'staged', 'worker-test@mozilla.org'))
|
||||
@ -360,7 +335,7 @@ class MochiRemote(Mochitest):
|
||||
env["MOZ_HIDE_RESULTS_TABLE"] = "1"
|
||||
retVal = Mochitest.buildURLOptions(self, options, env)
|
||||
|
||||
if not options.robocopIni:
|
||||
if not options.robocop:
|
||||
#we really need testConfig.js (for browser chrome)
|
||||
try:
|
||||
self._dm.pushDir(options.profilePath, self.remoteProfile)
|
||||
@ -515,7 +490,6 @@ def main():
|
||||
auto = RemoteAutomation(None, "fennec")
|
||||
parser = RemoteOptions(auto, scriptdir)
|
||||
options, args = parser.parse_args()
|
||||
|
||||
if (options.dm_trans == "adb"):
|
||||
if (options.deviceIP):
|
||||
dm = droid.DroidADB(options.deviceIP, options.devicePort, deviceRoot=options.remoteTestRoot)
|
||||
@ -552,12 +526,12 @@ def main():
|
||||
if (dm.processExist(procName)):
|
||||
dm.killProcess(procName)
|
||||
|
||||
if options.robocopIni != "":
|
||||
if options.robocop != "":
|
||||
# sut may wait up to 300 s for a robocop am process before returning
|
||||
dm.default_timeout = 320
|
||||
mp = manifestparser.TestManifest(strict=False)
|
||||
# TODO: pull this in dynamically
|
||||
mp.read(options.robocopIni)
|
||||
mp.read(options.robocop)
|
||||
robocop_tests = mp.active_tests(exists=False)
|
||||
tests = []
|
||||
my_tests = tests
|
||||
@ -585,8 +559,8 @@ def main():
|
||||
options.extraPrefs.append('browser.viewport.scaleRatio=100')
|
||||
options.extraPrefs.append('browser.chrome.dynamictoolbar=false')
|
||||
|
||||
if (options.dm_trans == 'adb' and options.robocopApk):
|
||||
dm._checkCmd(["install", "-r", options.robocopApk])
|
||||
if (options.dm_trans == 'adb' and options.robocopPath):
|
||||
dm._checkCmd(["install", "-r", os.path.join(options.robocopPath, "robocop.apk")])
|
||||
|
||||
retVal = None
|
||||
for test in robocop_tests:
|
||||
|
@ -63,15 +63,13 @@ RUN_MOCHITEST_REMOTE = \
|
||||
--testing-modules-dir=$(call core_abspath,_tests/modules) \
|
||||
$(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
|
||||
|
||||
RUN_MOCHITEST_ROBOCOP = \
|
||||
RUN_MOCHITEST_ROBOTIUM = \
|
||||
rm -f ./$@.log && \
|
||||
$(PYTHON) _tests/testing/mochitest/runtestsremote.py \
|
||||
--robocop-apk=$(DEPTH)/build/mobile/robocop/robocop-debug-signed.apk \
|
||||
--robocop-ini=$(DEPTH)/build/mobile/robocop/robocop.ini \
|
||||
--robocop-ids=$(DIST)/fennec_ids.txt \
|
||||
$(PYTHON) _tests/testing/mochitest/runtestsremote.py --robocop-path=$(DEPTH)/dist \
|
||||
--robocop-ids=$(DEPTH)/build/mobile/robocop/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)
|
||||
--robocop=$(DEPTH)/build/mobile/robocop/robocop.ini $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
|
||||
|
||||
ifndef NO_FAIL_ON_TEST_ERRORS
|
||||
define check_test_error_internal
|
||||
@ -97,17 +95,15 @@ mochitest-remote:
|
||||
$(RUN_MOCHITEST_REMOTE); \
|
||||
fi
|
||||
|
||||
mochitest-robotium: mochitest-robocop
|
||||
@echo "mochitest-robotium is deprecated -- please use mochitest-robocop"
|
||||
|
||||
mochitest-robocop: DM_TRANS?=adb
|
||||
mochitest-robocop:
|
||||
mochitest-robotium: robotium-id-map
|
||||
mochitest-robotium: DM_TRANS?=adb
|
||||
mochitest-robotium:
|
||||
@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_ROBOCOP); \
|
||||
$(RUN_MOCHITEST_ROBOTIUM); \
|
||||
fi
|
||||
|
||||
ifdef MOZ_B2G
|
||||
@ -439,8 +435,17 @@ make-stage-dir:
|
||||
stage-b2g: make-stage-dir
|
||||
$(NSINSTALL) $(topsrcdir)/b2g/test/b2g-unittest-requirements.txt $(PKG_STAGE)/b2g
|
||||
|
||||
robotium-id-map:
|
||||
ifeq ($(MOZ_BUILD_APP),mobile/android)
|
||||
$(PYTHON) $(DEPTH)/build/mobile/robocop/parse_ids.py -i $(DEPTH)/mobile/android/base/R.java -o $(DEPTH)/build/mobile/robocop/fennec_ids.txt
|
||||
endif
|
||||
|
||||
stage-mochitest: robotium-id-map
|
||||
stage-mochitest: make-stage-dir
|
||||
$(MAKE) -C $(DEPTH)/testing/mochitest stage-package
|
||||
ifeq ($(MOZ_BUILD_APP),mobile/android)
|
||||
$(NSINSTALL) $(DEPTH)/build/mobile/robocop/fennec_ids.txt $(PKG_STAGE)/mochitest
|
||||
endif
|
||||
|
||||
stage-reftest: make-stage-dir
|
||||
$(MAKE) -C $(DEPTH)/layout/tools/reftest stage-package
|
||||
|
@ -328,9 +328,11 @@ UPLOAD_EXTRA_FILES += robocop.apk
|
||||
UPLOAD_EXTRA_FILES += fennec_ids.txt
|
||||
ROBOCOP_PATH = $(call core_abspath,$(_ABS_DIST)/../build/mobile/robocop)
|
||||
INNER_ROBOCOP_PACKAGE= \
|
||||
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
|
||||
$(PYTHON) $(abspath $(topsrcdir)/build/mobile/robocop/parse_ids.py) -i $(call core_abspath,$(DEPTH)/mobile/android/base/R.java) -o $(call core_abspath,$(DEPTH)/build/mobile/robocop/fennec_ids.txt) && \
|
||||
$(NSINSTALL) $(call core_abspath,$(DEPTH)/build/mobile/robocop/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
|
||||
endif
|
||||
else
|
||||
INNER_ROBOCOP_PACKAGE=echo 'Testing is disabled - No Robocop for you'
|
||||
|
Loading…
x
Reference in New Issue
Block a user