This repository was archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 226
Expand file tree
/
Copy pathemscripten_testgen.sh
More file actions
executable file
·53 lines (42 loc) · 1.98 KB
/
emscripten_testgen.sh
File metadata and controls
executable file
·53 lines (42 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
set -e
# This script generates a standalone .zip file that contains
# LiveCodeScript tests.
# Preparation
# -----------
# Figure out some paths
top_src_dir=$(cd $(dirname $0)/.. && pwd)
em_bin_dir=${top_src_dir}/emscripten-bin
test_src_dir=${top_src_dir}/tests
em_test_src_dir=${test_src_dir}/_emscripten
test_build_dir=${top_src_dir}/_tests
em_test_build_dir=${test_build_dir}/emscripten
em_stack_dir=${em_test_build_dir}/standalone/boot/standalone
# Get version information
short_ver=$(perl ${top_src_dir}/util/decode_version.pl BUILD_SHORT_VERSION ${top_src_dir}/version)
# Comput boot stack hash
boot_hash=$(head -c1024 ${em_test_src_dir}/__boot.livecodescript | sha1sum -b | cut -f1 -d" ")
# Clean up from previous run and create required directories
rm -rf ${em_test_build_dir}
mkdir -p ${em_test_build_dir}
# Engine
# ------
# Copy the engine into place
cp -a ${em_bin_dir}/standalone-community-${short_ver}.js ${em_test_build_dir}
cp -a ${em_bin_dir}/standalone-community-${short_ver}.html.mem ${em_test_build_dir}
cp -a ${em_bin_dir}/standalone-community-${short_ver}.html ${em_test_build_dir}/tests.html
# Standalone
# ----------
# Construct a basic standalone boot filesystem
cp -r ${top_src_dir}/engine/rsrc/emscripten-standalone-template ${em_test_build_dir}/standalone
# Copy in test suite stacks
mkdir -p ${em_stack_dir}
cp -a ${test_src_dir} ${em_stack_dir}
# Copy in boot stack
cp ${em_test_src_dir}/__boot.livecodescript ${em_test_build_dir}/standalone/boot/standalone/__boot.livecode
# Copy in startup stack and make substitutions
cp ${top_src_dir}/engine/rsrc/emscripten-startup-template.livecodescript ${em_test_build_dir}/standalone/boot/__startup.livecode
sed -i"foo" -e"s,@BOOT_HASH@,${boot_hash}," ${em_test_build_dir}/standalone/boot/__startup.livecode
sed -i"foo" -e"s,@ENGINE_VERSION@,${short_ver}," ${em_test_build_dir}/standalone/boot/__startup.livecode
# Create the standalone.zip file
( cd ${em_test_build_dir}/standalone && zip -0qr ${em_test_build_dir}/standalone.zip * )