Move snapshot generation function to the snapshot tool (#2057)

Now there is a snapshot tool which can merge snapshots
but was unable to generate snapshots by itself.

This change moves the snapshot generation utilities
to the snapshot tool.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This commit is contained in:
Péter Gál
2017-11-05 18:37:27 +01:00
committed by Akos Kiss
parent ee24965bcf
commit 8ae659227e
4 changed files with 302 additions and 145 deletions
+6 -6
View File
@@ -59,10 +59,10 @@ JERRY_TESTS_OPTIONS = [
Options('jerry_tests-debug-cpointer_32bit',
['--debug', '--cpointer-32bit=on', '--mem-heap=1024']),
Options('jerry_tests-snapshot',
['--snapshot-save=on', '--snapshot-exec=on'],
['--snapshot-save=on', '--snapshot-exec=on', '--jerry-cmdline-snapshot=on'],
['--snapshot']),
Options('jerry_tests-debug-snapshot',
['--debug', '--snapshot-save=on', '--snapshot-exec=on'],
['--debug', '--snapshot-save=on', '--snapshot-exec=on', '--jerry-cmdline-snapshot=on'],
['--snapshot']),
Options('jerry_tests-es2015-subset-debug',
['--debug', '--profile=es2015-subset']),
@@ -76,20 +76,20 @@ JERRY_TEST_SUITE_OPTIONS.extend([
Options('jerry_test_suite-minimal',
['--profile=minimal']),
Options('jerry_test_suite-minimal-snapshot',
['--profile=minimal', '--snapshot-save=on', '--snapshot-exec=on'],
['--profile=minimal', '--snapshot-save=on', '--snapshot-exec=on', '--jerry-cmdline-snapshot=on'],
['--snapshot']),
Options('jerry_test_suite-minimal-debug',
['--debug', '--profile=minimal']),
Options('jerry_test_suite-minimal-debug-snapshot',
['--debug', '--profile=minimal', '--snapshot-save=on', '--snapshot-exec=on'],
['--debug', '--profile=minimal', '--snapshot-save=on', '--snapshot-exec=on', '--jerry-cmdline-snapshot=on'],
['--snapshot']),
Options('jerry_test_suite-es2015-subset',
['--profile=es2015-subset']),
Options('jerry_test_suite-es2015-subset-snapshot',
['--profile=es2015-subset', '--snapshot-save=on', '--snapshot-exec=on'],
['--profile=es2015-subset', '--snapshot-save=on', '--snapshot-exec=on', '--jerry-cmdline-snapshot=on'],
['--snapshot']),
Options('jerry_test_suite-es2015-subset-debug-snapshot',
['--debug', '--profile=es2015-subset', '--snapshot-save=on', '--snapshot-exec=on'],
['--debug', '--profile=es2015-subset', '--snapshot-save=on', '--snapshot-exec=on', '--jerry-cmdline-snapshot=on'],
['--snapshot'])
])
+10 -3
View File
@@ -49,7 +49,14 @@ then
TEST_FILES="$TEST_FILES.snapshot"
TEST_FAILED="$TEST_FAILED.snapshot"
TEST_PASSED="$TEST_PASSED.snapshot"
IS_SNAPSHOT=true;
IS_SNAPSHOT=true
SNAPSHOT_TOOL=${ENGINE}-snapshot
if [ ! -x $SNAPSHOT_TOOL ]
then
echo "$0: $SNAPSHOT_TOOL: not an executable"
exit 1
fi
shift
fi
@@ -134,8 +141,8 @@ do
# Testing snapshot
SNAPSHOT_TEMP=`mktemp $(basename -s .js $test).snapshot.XXXXXXXXXX`
cmd_line="${ENGINE#$ROOT_DIR} $ENGINE_ARGS --save-snapshot-for-global $SNAPSHOT_TEMP ${full_test#$ROOT_DIR}"
$TIMEOUT_CMD $TIMEOUT $ENGINE $ENGINE_ARGS --save-snapshot-for-global $SNAPSHOT_TEMP $full_test &> $ENGINE_TEMP
cmd_line="${SNAPSHOT_TOOL#$ROOT_DIR} generate --context global -o $SNAPSHOT_TEMP ${full_test#$ROOT_DIR}"
$TIMEOUT_CMD $TIMEOUT $SNAPSHOT_TOOL generate --context global -o $SNAPSHOT_TEMP $full_test &> $ENGINE_TEMP
status_code=$?
if [ $status_code -eq 0 ]