|
| 1 | +#!/bin/sh |
| 2 | + |
| 3 | +set -e |
| 4 | + |
| 5 | +# This script generates a standalone .zip file that contains |
| 6 | +# LiveCodeScript tests. |
| 7 | + |
| 8 | +# Preparation |
| 9 | +# ----------- |
| 10 | + |
| 11 | +# Figure out some paths |
| 12 | +top_src_dir=$(cd $(dirname $0)/.. && pwd) |
| 13 | +em_bin_dir=${top_src_dir}/emscripten-bin |
| 14 | + |
| 15 | +test_src_dir=${top_src_dir}/tests |
| 16 | +em_test_src_dir=${test_src_dir}/_emscripten |
| 17 | +test_build_dir=${top_src_dir}/_tests |
| 18 | +em_test_build_dir=${test_build_dir}/emscripten |
| 19 | +em_stack_dir=${em_test_build_dir}/standalone/boot/standalone |
| 20 | + |
| 21 | +# Get version information |
| 22 | +short_ver=$(perl ${top_src_dir}/util/decode_version.pl BUILD_SHORT_VERSION ${top_src_dir}/version) |
| 23 | + |
| 24 | +# Clean up from previous run and create required directories |
| 25 | +rm -rf ${em_test_build_dir} |
| 26 | +mkdir -p ${em_test_build_dir} |
| 27 | + |
| 28 | +# Engine |
| 29 | +# ------ |
| 30 | + |
| 31 | +# Copy the engine into place |
| 32 | +cp -a ${em_bin_dir}/standalone-community-${short_ver}.{js,html.mem} ${em_test_build_dir} |
| 33 | +cp -a ${em_bin_dir}/standalone-community-${short_ver}.html ${em_test_build_dir}/tests.html |
| 34 | + |
| 35 | +# Standalone |
| 36 | +# ---------- |
| 37 | +# Construct a basic standalone boot filesystem |
| 38 | +cp -r ${top_src_dir}/engine/rsrc/emscripten-standalone-template ${em_test_build_dir}/standalone |
| 39 | +# Copy in test suite stacks |
| 40 | +mkdir -p ${em_stack_dir} |
| 41 | +cp -a ${test_src_dir} ${em_stack_dir} |
| 42 | +# Clean up undesirable files |
| 43 | +find ${test_src_dir} \ |
| 44 | + -not -name \*.livecodescript -o \ |
| 45 | + -name '_*' -o \ |
| 46 | + -name '.*' \ |
| 47 | + -print \ |
| 48 | + -exec rm '{}' ';' |
| 49 | +cp ${test_src_dir}/_test*lib.livecodescript ${em_stack_dir} |
| 50 | +# Copy in startup and boot stacks |
| 51 | +cp ${em_test_src_dir}/__boot.livecodescript ${em_test_build_dir}/standalone/boot/standalone/__boot.livecode |
| 52 | +cp ${em_test_src_dir}/__startup.livecodescript ${em_test_build_dir}/standalone/boot/__startup.livecode |
| 53 | +# Create the standalone.zip file |
| 54 | +( cd ${em_test_build_dir}/standalone && zip -0qr ${em_test_build_dir}/standalone.zip * ) |
0 commit comments