Run JS regression tests in snapshot mode too
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
@@ -304,6 +304,11 @@ test-js.$(1).$(2): build.$$(NATIVE_SYSTEM)
|
|||||||
$$(Q) $$(call SHLOG,cd $$(OUT_DIR)/$(1)/check/$(2) && $$(ROOT_DIR)/tools/runners/run-test-suite.sh \
|
$$(Q) $$(call SHLOG,cd $$(OUT_DIR)/$(1)/check/$(2) && $$(ROOT_DIR)/tools/runners/run-test-suite.sh \
|
||||||
$$(OUT_DIR)/$(1)/jerry \
|
$$(OUT_DIR)/$(1)/jerry \
|
||||||
$(3),$$(OUT_DIR)/$(1)/check/$(2)/test.log,Testing)
|
$(3),$$(OUT_DIR)/$(1)/check/$(2)/test.log,Testing)
|
||||||
|
test-js.$(1).$(2).snapshot: build.$$(NATIVE_SYSTEM)
|
||||||
|
$$(Q) mkdir -p $$(OUT_DIR)/$(1)/check/$(2)
|
||||||
|
$$(Q) $$(call SHLOG,cd $$(OUT_DIR)/$(1)/check/$(2) && $$(ROOT_DIR)/tools/runners/run-test-suite.sh \
|
||||||
|
$$(OUT_DIR)/$(1)/jerry \
|
||||||
|
$(3) --snapshot,$$(OUT_DIR)/$(1)/check/$(2)/snapshot.test.log,Testing)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(foreach __TARGET,$(JERRY_TEST_TARGETS), \
|
$(foreach __TARGET,$(JERRY_TEST_TARGETS), \
|
||||||
@@ -358,10 +363,12 @@ test-unit: unittests
|
|||||||
test-js: \
|
test-js: \
|
||||||
$(foreach __TARGET,$(JERRY_TEST_TARGETS), \
|
$(foreach __TARGET,$(JERRY_TEST_TARGETS), \
|
||||||
$(foreach __SUITE,$(JERRY_TEST_SUITE_J) $(JERRY_TEST_SUITE_JTS), \
|
$(foreach __SUITE,$(JERRY_TEST_SUITE_J) $(JERRY_TEST_SUITE_JTS), \
|
||||||
test-js.$(__TARGET).$(firstword $(subst :, ,$(__SUITE))))) \
|
test-js.$(__TARGET).$(firstword $(subst :, ,$(__SUITE))) \
|
||||||
|
test-js.$(__TARGET).$(firstword $(subst :, ,$(__SUITE))).snapshot)) \
|
||||||
$(foreach __TARGET,$(JERRY_TEST_TARGETS_CP), \
|
$(foreach __TARGET,$(JERRY_TEST_TARGETS_CP), \
|
||||||
$(foreach __SUITE,$(JERRY_TEST_SUITE_JTS_CP), \
|
$(foreach __SUITE,$(JERRY_TEST_SUITE_JTS_CP), \
|
||||||
test-js.$(__TARGET).$(firstword $(subst :, ,$(__SUITE)))))
|
test-js.$(__TARGET).$(firstword $(subst :, ,$(__SUITE))) \
|
||||||
|
test-js.$(__TARGET).$(firstword $(subst :, ,$(__SUITE))).snapshot))
|
||||||
|
|
||||||
.PHONY: test-buildoptions
|
.PHONY: test-buildoptions
|
||||||
test-buildoptions: \
|
test-buildoptions: \
|
||||||
|
|||||||
@@ -15,14 +15,30 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
# Usage:
|
||||||
|
# ./tools/runners/run-test-suite.sh ENGINE TESTS [--snapshot] ENGINE_ARGS....
|
||||||
|
|
||||||
TIMEOUT=${TIMEOUT:=5}
|
TIMEOUT=${TIMEOUT:=5}
|
||||||
|
|
||||||
|
TEST_FILES=test.files
|
||||||
|
TEST_FAILED=test.failed
|
||||||
|
TEST_PASSED=test.passed
|
||||||
|
|
||||||
ENGINE="$1"
|
ENGINE="$1"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
TESTS="$1"
|
TESTS="$1"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
|
if [ "$1" == "--snapshot" ]
|
||||||
|
then
|
||||||
|
TEST_FILES="snapshot.$TEST_FILES"
|
||||||
|
TEST_FAILED="snapshot.$TEST_FAILED"
|
||||||
|
TEST_PASSED="snapshot.$TEST_PASSED"
|
||||||
|
IS_SNAPSHOT=true;
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
ENGINE_ARGS="$@"
|
ENGINE_ARGS="$@"
|
||||||
|
|
||||||
if [ ! -x $ENGINE ]
|
if [ ! -x $ENGINE ]
|
||||||
@@ -31,10 +47,6 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TEST_FILES=test.files
|
|
||||||
TEST_FAILED=test.failed
|
|
||||||
TEST_PASSED=test.passed
|
|
||||||
|
|
||||||
if [ -d $TESTS ]
|
if [ -d $TESTS ]
|
||||||
then
|
then
|
||||||
TESTS_DIR=$TESTS
|
TESTS_DIR=$TESTS
|
||||||
@@ -97,10 +109,34 @@ do
|
|||||||
|
|
||||||
full_test=$TESTS_DIR/${test#./}
|
full_test=$TESTS_DIR/${test#./}
|
||||||
|
|
||||||
echo -n "[$tested/$total] ${ENGINE#$ROOT_DIR} $ENGINE_ARGS ${full_test#$ROOT_DIR}: "
|
if [ "$IS_SNAPSHOT" == true ]
|
||||||
|
then
|
||||||
|
# Testing snapshot
|
||||||
|
|
||||||
( ulimit -t $TIMEOUT; $ENGINE $ENGINE_ARGS $full_test &>$ENGINE_TEMP )
|
SNAPSHOT_TEMP=`mktemp snapshot-out.XXXXXXXXXX`
|
||||||
status_code=$?
|
|
||||||
|
echo -n "[$tested/$total] ${ENGINE#$ROOT_DIR} $ENGINE_ARGS "
|
||||||
|
echo -n "--save-snapshot-for-global $SNAPSHOT_TEMP ${full_test#$ROOT_DIR}: "
|
||||||
|
|
||||||
|
( ulimit -t $TIMEOUT; $ENGINE $ENGINE_ARGS --save-snapshot-for-global $SNAPSHOT_TEMP $full_test &> $ENGINE_TEMP )
|
||||||
|
status_code=$?
|
||||||
|
|
||||||
|
if [ $status_code -eq 0 ]
|
||||||
|
then
|
||||||
|
echo "$PASS"
|
||||||
|
echo -n "[$tested/$total] ${ENGINE#$ROOT_DIR} $ENGINE_ARGS --exec-snapshot $SNAPSHOT_TEMP: "
|
||||||
|
|
||||||
|
( ulimit -t $TIMEOUT; $ENGINE $ENGINE_ARGS --exec-snapshot $SNAPSHOT_TEMP &> $ENGINE_TEMP )
|
||||||
|
status_code=$?
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f $SNAPSHOT_TEMP
|
||||||
|
else
|
||||||
|
echo -n "[$tested/$total] ${ENGINE#$ROOT_DIR} $ENGINE_ARGS ${full_test#$ROOT_DIR}: "
|
||||||
|
|
||||||
|
( ulimit -t $TIMEOUT; $ENGINE $ENGINE_ARGS $full_test &> $ENGINE_TEMP )
|
||||||
|
status_code=$?
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $status_code -ne $error_code ]
|
if [ $status_code -ne $error_code ]
|
||||||
then
|
then
|
||||||
|
|||||||
Reference in New Issue
Block a user