Modify JS test automation to be driven by external text files containing lists of urls, no bug, not part of the build.

This commit is contained in:
bob%bclary.com 2005-11-20 05:56:58 +00:00
parent 5f0f900ac6
commit c17f87551f
3 changed files with 65 additions and 34 deletions

View File

@ -1,13 +1,26 @@
# -*- Makefile -*-
TEST_HTTP ?= test.mozilla.com
TEST_JS = $(shell find . -name '*.js' -print)
all: menu.html
all: menu.html js-list.txt e4x-list.txt lc-list.txt menu-list.txt
menu.html: menuhead.html menufoot.html Makefile spidermonkey-n.tests $(TEST_JS)
perl mklistpage.pl > menubody.html
cat menuhead.html menubody.html menufoot.html > menu.html
clean:
rm -f menubody.html menu.html
menu-list.txt:
echo "http://$(TEST_HTTP)/tests/mozilla.org/js/menu.html" > menu-list.txt
js-list.txt: $(TEST_JS)
./list.sh ecma ecma_2 ecma_3 js1_1 js1_2 js1_3 js1_4 js1_5 js1_6 | sort > js-list.txt
e4x-list.txt: $(TEST_JS)
./list.sh e4x | sort > e4x-list.txt
lc-list.txt: $(TEST_JS)
./list.sh lc2 lc3 | sort > lc-list.txt
clean:
rm -f menubody.html menu.html js-list.txt e4x-list.txt lc-list.txt menu-list.txt

View File

@ -37,31 +37,24 @@
# ***** END LICENSE BLOCK *****
include config.mk
include $(TEST_BIN)/include.mk
dashes = ----------
msg = @echo "$(1)": $(dashes) $(2) $(dashes)
prepend = sed 's/^/$(1): /'
html2text = lynx --dump $(1)
TEST_PROFILE?=TEST
ifndef TEST_JSBROWSER_TIMEOUT
TEST_JSBROWSER_TIMEOUT=900
endif
ifndef TEST_E4XBROWSER_TIMEOUT
TEST_E4XBROWSER_TIMEOUT=900
endif
ifndef TEST_JSEACH_TIMEOUT
TEST_JSEACH_TIMEOUT=120
endif
ifndef TEST_E4XEACH_TIMEOUT
TEST_E4XEACH_TIMEOUT=120
endif
TEST_BUILDID ?= $(shell bin/buildid $(TEST_EXE))
TEST_JS = $(shell find . -name '*.js' -print)
CURDIR := $(shell pwd)
LOG = $(subst /www/tests/,/www/results/,$(CURDIR)/$(TEST_DATE)-$(TEST_NAME)-$(TEST_BUILDID)-$(TEST_OPTDEBUG))
LOG ?= $(subst /www/tests/,/www/results/,$(CURDIR)/$(TEST_DATE)-$(TEST_NAME)-$(TEST_BUILDID)-$(TEST_OPTDEBUG))
JS_FILES=$(shell find . -mindepth 2 -name '*.js' -print | grep -v shell.js | grep -v browser.js | grep -v template.js | sort)
@ -101,35 +94,37 @@ e4xshell:
# browser based tests
#
SPIDER=//spider/content/open.xul?depth%3D0%26timeout%3D120%26waittime%3D0%26hooksignal%3Don%26autostart%3Don%26autoquit%3Don%26javascripterrors%3Don%26javascriptwarnings%3Doff%26chromeerrors%3Don%26xblerrors%3Don%26csserrors%3Doff
URL=http%3A%2F%2F$(TEST_HTTP)%2Ftests%2Fmozilla.org%2Fjs%2Fmenu.html
jsbrowser: HOOK=http%3A%2F%2F$(TEST_HTTP)%2Ftests%2Fmozilla.org%2Fjs%2Fuserhook-js.js
jsbrowser: menu.html
$(call msg,jsbrowser,Begin JavaScript Test Suite)
$(TEST_BIN)/init-profile.sh -b $(TEST_EXE) -n $(TEST_PROFILE) -e $(TEST_DIR)/xpi -u $(TEST_DIR)/prefs/test-user.js -t js | $(call prepend,jsbrowser)
-$(TEST_BIN)/timed_run $(TEST_JSBROWSER_TIMEOUT) "-" $(TEST_EXE) -P $(TEST_PROFILE) -chrome chrome:$(SPIDER)%26url%3D$(URL)%26scripturl%3D$(HOOK) 2>&1 | $(call prepend,jsbrowser)
$(TEST_BIN)/pipeline.sh \
"$(TEST_BIN)/spider.pl $(TEST_BIN) $(TEST_JSBROWSER_TIMEOUT) $(TEST_EXE) $(TEST_PROFILE) /tests/mozilla.org/js/userhook-js.js menu-list.txt 0 js 2>&1" \
"sed 's/^/jsbrowser: /'"
$(call msg,jsbrowser,End JavaScript Test Suite)
e4xbrowser: HOOK=http%3A%2F%2F$(TEST_HTTP)%2Ftests%2Fmozilla.org%2Fjs%2Fuserhook-e4x.js
e4xbrowser: menu.html
$(call msg,jse4xbrowser,Begin JavaScript E4X Test Suite)
$(TEST_BIN)/init-profile.sh -b $(TEST_EXE) -n $(TEST_PROFILE) -e $(TEST_DIR)/xpi -u $(TEST_DIR)/prefs/test-user.js -t e4x | $(call prepend,jse4xbrowser)
-$(TEST_BIN)/timed_run $(TEST_E4XBROWSER_TIMEOUT) "-" $(TEST_EXE) -P $(TEST_PROFILE) -chrome chrome:$(SPIDER)%26url%3D$(URL)%26scripturl%3D$(HOOK) 2>&1 | $(call prepend,jse4xbrowser)
$(TEST_BIN)/pipeline.sh \
"$(TEST_BIN)/spider.pl $(TEST_BIN) $(TEST_JSBROWSER_TIMEOUT) $(TEST_EXE) $(TEST_PROFILE) /tests/mozilla.org/js/userhook-e4x.js menu-list.txt 0 e4x 2>&1" \
"sed 's/^/e4xbrowser: /'"
$(call msg,jse4xbrowser,End JavaScript E4X Test Suite)
menu.html: menuhead.html menufoot.html $(TEST_JS) Makefile
jsbrowsereach: menu.html
$(TEST_BIN)/init-profile.sh -b $(TEST_EXE) -n $(TEST_PROFILE) -e $(TEST_DIR)/xpi -u $(TEST_DIR)/prefs/test-user.js -t js | $(call prepend,jsbrowsereach)
$(TEST_BIN)/pipeline.sh \
"$(TEST_BIN)/spider.pl $(TEST_BIN) $(TEST_JSEACH_TIMEOUT) $(TEST_EXE) $(TEST_PROFILE) /tests/mozilla.org/js/userhookeach-js.js js-list.txt 0 js 2>&1" \
"sed 's/^/jsbrowsereach: /'"
e4xbrowsereach: menu.html
$(TEST_BIN)/init-profile.sh -b $(TEST_EXE) -n $(TEST_PROFILE) -e $(TEST_DIR)/xpi -u $(TEST_DIR)/prefs/test-user.js -t e4x | $(call prepend,e4xbrowsereach)
$(TEST_BIN)/pipeline.sh \
"$(TEST_BIN)/spider.pl $(TEST_BIN) $(TEST_JSEACH_TIMEOUT) $(TEST_EXE) $(TEST_PROFILE) /tests/mozilla.org/js/userhookeach-e4x.js e4x-list.txt 0 e4x 2>&1" \
"sed 's/^/e4xbrowsereach: /'"
menu.html: menuhead.html menufoot.html $(JS_FILES) Makefile
$(MAKE) -f Makefile
clean:
$(MAKE) -f Makefile clean
jsbrowsereach: menu.html
$(TEST_BIN)/init-profile.sh -b $(TEST_EXE) -n $(TEST_PROFILE) -e $(TEST_DIR)/xpi -u $(TEST_DIR)/prefs/test-user.js -t js | $(call prepend,jsbrowsereach)
./jseach.sh $(TEST_BIN) $(TEST_JSEACH_TIMEOUT) $(TEST_EXE) $(TEST_PROFILE)
e4xbrowsereach: menu.html
$(TEST_BIN)/init-profile.sh -b $(TEST_EXE) -n $(TEST_PROFILE) -e $(TEST_DIR)/xpi -u $(TEST_DIR)/prefs/test-user.js -t e4x | $(call prepend,e4xbrowsereach)
./e4xeach.sh $(TEST_BIN) $(TEST_E4XEACH_TIMEOUT) $(TEST_EXE) $(TEST_PROFILE)

23
js/tests/list.sh Executable file
View File

@ -0,0 +1,23 @@
if [[ -z $TEST_HTTP ]]; then
export TEST_HTTP=test.mozilla.com
fi
if [[ -z $1 ]]; then
dirs=.
else
dirs=$@
fi
find $dirs \
-mindepth 2 -name '*.js' -print | \
grep -v shell.js | \
grep -v browser.js | \
grep -v template.js | \
sed 's/^\.\///' | \
while read jsfile
do
result=`grep $jsfile spidermonkey-n.tests`
if [[ -z $result ]]; then
echo "http://${TEST_HTTP}/tests/mozilla.org/js/js-test-driver-standards.html?test=$jsfile;language=language;javascript"
fi
done