-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·60 lines (46 loc) · 1.14 KB
/
Copy pathtest.sh
File metadata and controls
executable file
·60 lines (46 loc) · 1.14 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
54
55
56
57
58
59
60
#!/bin/bash
set -e
source_files=( arrays game game_state imgdata input menu printing savegame room_docks room_harbor_plaza tui utf8 )
test_sources=( test_runner tests_arrays )
linker_command="ld -o tests"
echo "Compiling source files:"
for source_file in "${source_files[@]}"
do
echo " compiling ${source_file}.asm ..."
nasm -felf64 "${source_file}.asm"
linker_command="${linker_command} ${source_file}.o"
done
for test_source in "${test_sources[@]}"
do
echo " compiling test/${test_source}.asm"
(cd test; nasm -felf64 "${test_source}.asm")
linker_command="${linker_command} test/${test_source}.o"
done
echo "Compiling AssUnit"
(cd AssUnit; ./compile.sh)
cp AssUnit/libassunit.a ./
linker_command="${linker_command} -L. -lassunit"
echo ""
echo "Linkig with command:"
echo " ${linker_command}"
echo ""
$($linker_command)
rm *.o
rm test/*.o
rm libassunit.a
chmod +x tests
if [ "$(command -v tokei)" != "" ]; then
echo "Code stats for main program:"
echo ""
tokei . -e test
echo ""
echo "Code stats for test sources:"
echo ""
tokei test
fi
echo ""
echo "Output file:"
ls -lh tests
echo ""
echo ""
./tests