Bug 404513 - "Add Makefile target to launch solo xpcshell test without interactive mode" [p=laurent@xulfr.org (Laurent Jouanneau) r=robcee sr=luser a1.9=beltzner]

This commit is contained in:
reed%reedloden.com 2007-11-23 01:42:22 +00:00
Родитель 0770ae93db
Коммит 65eb6d6f99
2 изменённых файлов: 32 добавлений и 6 удалений

Просмотреть файл

@ -1899,7 +1899,18 @@ check-interactive::
$(FWDSLASH_TOPSRCDIR) \
$(NATIVE_TOPSRCDIR) \
$(DEPTH)/_tests/xpcshell-simple/$(MODULE)/$$testdir \
$(SOLO_FILE);
$(SOLO_FILE) 1;
# Test execution
check-one::
@$(EXIT_ON_ERROR) \
$(RUN_TEST_PROGRAM) \
$(topsrcdir)/tools/test-harness/xpcshell-simple/test_one.sh \
$(DIST)/bin/xpcshell \
$(FWDSLASH_TOPSRCDIR) \
$(NATIVE_TOPSRCDIR) \
$(DEPTH)/_tests/xpcshell-simple/$(MODULE)/$$testdir \
$(SOLO_FILE) 0;
endif # XPCSHELL_TESTS
@ -2036,7 +2047,7 @@ endif
# Fake targets. Always run these rules, even if a file/directory with that
# name already exists.
#
.PHONY: all all_platforms alltags boot checkout chrome realchrome clean clobber clobber_all export install libs makefiles realclean run_viewer run_apprunner tools $(DIRS) $(TOOL_DIRS) FORCE check check-interactive
.PHONY: all all_platforms alltags boot checkout chrome realchrome clean clobber clobber_all export install libs makefiles realclean run_viewer run_apprunner tools $(DIRS) $(TOOL_DIRS) FORCE check check-interactive check-one
# Used as a dependency to force targets to rebuild
FORCE:
@ -2175,3 +2186,7 @@ check:: $(SUBMAKEFILES) $(MAKE_DIRS)
check-interactive:: $(SUBMAKEFILES) $(MAKE_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_DIRS)
check-one:: $(SUBMAKEFILES) $(MAKE_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_TOOL_DIRS)

Просмотреть файл

@ -85,6 +85,9 @@ fi
# The actual JS test to run.
target_js="$5"
# Says if the test should be launch in interactive mode or not
interactive_mode="$6"
###############################
# SETUP FOR RUNNING THE TESTS #
###############################
@ -102,7 +105,11 @@ done
# files matching the pattern tail_*.js are treated like teardown files
# - they are run after tail.js
tailfiles="-f $topsrcdir/tools/test-harness/xpcshell-simple/tail.js"
#tailfiles="$tailfiles -f $topsrcdir/tools/test-harness/xpcshell-simple/execute_test.js"
if [ ! "$interactive_mode" = "1" ]; then
tailfiles="$tailfiles -f $topsrcdir/tools/test-harness/xpcshell-simple/execute_test.js"
fi
for t in $testdir/unit/tail_*.js
do
if [ -f $t ]; then
@ -117,7 +124,11 @@ done
echo "NATIVE_TOPSRCDIR='$native_topsrcdir' TOPSRCDIR='$topsrcdir' $xpcshell -s $headfiles -f $testdir/unit/$target_js $tailfiles 2>&1"
echo -n "$target_js: "
NATIVE_TOPSRCDIR="$native_topsrcdir" TOPSRCDIR="$topsrcdir" $xpcshell -s $headfiles -f $testdir/unit/$target_js $tailfiles -i 2>&1
if [ ! "$interactive_mode" = "1" ]; then
NATIVE_TOPSRCDIR="$native_topsrcdir" TOPSRCDIR="$topsrcdir" $xpcshell -s $headfiles -f $testdir/unit/$target_js $tailfiles 2> $testdir/unit/$target_js.log 1>&2
else
NATIVE_TOPSRCDIR="$native_topsrcdir" TOPSRCDIR="$topsrcdir" $xpcshell -s $headfiles -f $testdir/unit/$target_js $tailfiles -i 2>&1
fi
rv="$?"
if [ ! "$rv" = "0" -o \
`grep -c '\*\*\* PASS' $testdir/unit/$target_js.log` = 0 ]