forked from carp-lang/Carp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_carp_tests.sh
executable file
·61 lines (51 loc) · 1.8 KB
/
run_carp_tests.sh
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
54
55
56
57
58
59
60
61
#!/bin/bash
set -e; # will make the script stop if there are any errors
set -u; # will make the script stop if there is use of undefined
NO_SDL=0
if [[ $# -gt 0 ]] && [[ "$1" == "--no_sdl" ]]; then
NO_SDL=1
fi
stack build;
# This is useful for devs, but these tests should not rely on `carp` being in
# PATH.
stack install;
# Build and run some examples
./test/execute.sh ./examples/basics.carp
./test/execute.sh ./examples/functor.carp
./test/execute.sh ./examples/external_struct.carp
./test/execute.sh ./examples/updating.carp
./test/execute.sh ./examples/sorting.carp
./test/execute.sh ./examples/globals.carp
./test/execute.sh ./examples/generic_structs.carp
./test/execute.sh ./examples/setting_variables.carp
./test/execute.sh ./examples/function_members.carp
./test/execute.sh ./examples/map.carp
./test/execute.sh ./examples/lambdas.carp
# Actual tests (using the test suite)
for f in ./test/*.carp; do
echo $f
stack exec carp -- -x --log-memory $f
echo
done
# Test for correct error messages when doing "carp --check" on the source.
for f in ./test-for-errors/*.carp; do
echo $f
./test/check.sh $f
echo
done
# Just make sure these compile
stack exec carp -- ./examples/mutual_recursion.carp -b
stack exec carp -- ./examples/guessing.carp -b
stack exec carp -- ./examples/no_core.carp --no-core -b
# Run tests which rely on SDL unless the `--no_sdl` argument was passed in
if [[ ${NO_SDL} -eq 0 ]]; then
stack exec carp -- ./examples/ant.carp -b
stack exec carp -- ./examples/reptile.carp -b
stack exec carp -- ./examples/game.carp -b
stack exec carp -- ./examples/minimal_sdl.carp -b
stack exec carp -- examples/sounds.carp -b
stack exec carp -- examples/fonts.carp -b
fi
# Generate core docs
stack exec carp -- ./docs/core/generate_core_docs.carp -b
echo "ALL TESTS DONE."