|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +set -e |
| 4 | +set -x |
| 5 | + |
| 6 | +/work/prepare_repo.sh |
| 7 | + |
| 8 | +source emsdk/emsdk_env.sh |
| 9 | + |
| 10 | +cd duktape |
| 11 | +ROOT=`pwd` |
| 12 | + |
| 13 | +test_combined_source_compilation() { |
| 14 | + make clean dist |
| 15 | + cd dist |
| 16 | + cat Makefile.cmdline |
| 17 | + rm -rf src-separate |
| 18 | + make -f Makefile.cmdline |
| 19 | + ls -l duk; size duk |
| 20 | + ./duk mandel.js > /tmp/out.txt |
| 21 | + cat /tmp/out.txt |
| 22 | + if [ `md5sum /tmp/out.txt | cut -f 1 -d ' '` != "627cd86f0a4255e018c564f86c6d0ab3" ]; then |
| 23 | + echo "Combined source compilation failed!" |
| 24 | + exit 1 |
| 25 | + fi |
| 26 | +} |
| 27 | + |
| 28 | +test_separate_source_compilation() { |
| 29 | + make clean dist |
| 30 | + cd dist |
| 31 | + sed -i 's/DUKTAPE_SOURCES = src\/duktape.c/DUKTAPE_SOURCES = src-separate\/*.c/' Makefile.cmdline |
| 32 | + sed -i 's/-I.\/src/-I.\/src-separate/' Makefile.cmdline |
| 33 | + cat Makefile.cmdline |
| 34 | + rm -rf src |
| 35 | + make -f Makefile.cmdline |
| 36 | + ls -l duk; size duk |
| 37 | + ./duk mandel.js > /tmp/out.txt |
| 38 | + cat /tmp/out.txt |
| 39 | + if [ `md5sum /tmp/out.txt | cut -f 1 -d ' '` != "627cd86f0a4255e018c564f86c6d0ab3" ]; then |
| 40 | + echo "Combined source compilation failed!" |
| 41 | + exit 1 |
| 42 | + fi |
| 43 | +} |
| 44 | + |
| 45 | +test_clang_compilation() { |
| 46 | + make clean duk-clang |
| 47 | +} |
| 48 | + |
| 49 | +test_gxx_compilation() { |
| 50 | + make clean duk-g++ |
| 51 | + make clean dukd-g++ |
| 52 | +} |
| 53 | + |
| 54 | +test_misc_compilation() { |
| 55 | + make clean duk-rom |
| 56 | + make clean duk-low |
| 57 | + make clean duk-low-norefc |
| 58 | + make clean duk-low-rom |
| 59 | + make clean duk-perf |
| 60 | + make clean duk-size |
| 61 | + make clean duk-pgo.O2 |
| 62 | + make clean dukd |
| 63 | + make clean dukd-rom |
| 64 | + make clean dukd-low |
| 65 | + make clean dukd-low-norefc |
| 66 | + make clean dukd-low-rom |
| 67 | +} |
| 68 | + |
| 69 | +test_configure_fastint() { |
| 70 | + make clean dist |
| 71 | + cd dist |
| 72 | + rm -rf /tmp/out |
| 73 | + python tools/configure.py -DDUK_USE_FASTINT --output-directory /tmp/out |
| 74 | + ls -l /tmp/out |
| 75 | +} |
| 76 | + |
| 77 | +test_releasetest() { |
| 78 | + make clean |
| 79 | + make releasetest |
| 80 | +} |
| 81 | + |
| 82 | +test_checklist_compile_test() { |
| 83 | + make clean dist |
| 84 | + cd dist |
| 85 | + bash ../util/checklist_compile_test.sh |
| 86 | +} |
| 87 | + |
| 88 | +echo "" |
| 89 | +echo "*** Test compilation from combined sources" |
| 90 | +echo "" |
| 91 | +cd $ROOT |
| 92 | +test_combined_source_compilation |
| 93 | + |
| 94 | +echo "" |
| 95 | +echo "*** Test compilation from separate sources" |
| 96 | +echo "" |
| 97 | +cd $ROOT |
| 98 | +test_separate_source_compilation |
| 99 | + |
| 100 | +echo "" |
| 101 | +echo "*** Test clang compilation (duk-clang)" |
| 102 | +echo "" |
| 103 | +cd $ROOT |
| 104 | +test_clang_compilation |
| 105 | + |
| 106 | +echo "" |
| 107 | +echo "*** Test C++ compilation (duk-g++)" |
| 108 | +echo "" |
| 109 | +cd $ROOT |
| 110 | +test_gxx_compilation |
| 111 | + |
| 112 | +echo "" |
| 113 | +echo "*** Test misc compilation targets (duk-low, etc)" |
| 114 | +echo "" |
| 115 | +cd $ROOT |
| 116 | +test_misc_compilation |
| 117 | + |
| 118 | +echo "" |
| 119 | +echo "*** Test configure.py -DDUK_USE_FASTINT" |
| 120 | +echo "" |
| 121 | +cd $ROOT |
| 122 | +test_configure_fastint |
| 123 | + |
| 124 | +echo "" |
| 125 | +echo "*** Test make releasetest" |
| 126 | +echo "" |
| 127 | +cd $ROOT |
| 128 | +test_releasetest |
| 129 | + |
| 130 | +echo "" |
| 131 | +echo "*** Test checklist_compile_test.sh" |
| 132 | +echo "" |
| 133 | +cd $ROOT |
| 134 | +test_checklist_compile_test |
| 135 | + |
| 136 | +echo "" |
| 137 | +echo "*** All done!" |
| 138 | +echo "" |
0 commit comments