Commit bca4457 1 parent 9e14f5f commit bca4457 Copy full SHA for bca4457
File tree 4 files changed +73
-1
lines changed
4 files changed +73
-1
lines changed Original file line number Diff line number Diff line change 88
88
- name : Install deps
89
89
run : |
90
90
source ./util/ci/common.sh
91
- install_linux_deps clang-7 llvm
91
+ install_linux_deps clang-7 llvm-7
92
92
93
93
- name : Build
94
94
run : |
@@ -102,6 +102,11 @@ jobs:
102
102
run : |
103
103
./bin/minetest --run-unittests
104
104
105
+ # Do this here because we have ASan and error paths are sensitive to dangling pointers
106
+ - name : Test error cases
107
+ run : |
108
+ ./util/test_error_cases.sh
109
+
105
110
# Current clang version
106
111
clang_18 :
107
112
runs-on : ubuntu-24.04
Original file line number Diff line number Diff line change
1
+ error (" intentional" )
Original file line number Diff line number Diff line change @@ -48,4 +48,24 @@ elseif mode == "mapgen" then
48
48
end
49
49
core .after (0 , next_ , 1 )
50
50
51
+ elseif mode == " error" then
52
+
53
+ local n = tonumber (core .settings :get (" error_type" ))
54
+ local error_lua = core .get_modpath (core .get_current_modname ()) .. " /error.lua"
55
+ if n == 1 then
56
+ print (" => error during startup <=" )
57
+ error (" intentional" )
58
+ elseif n == 2 then
59
+ print (" => error on first step <=" )
60
+ core .after (0 , error , " intentional" )
61
+ elseif n == 3 then
62
+ print (" => error in async script <=" )
63
+ core .register_async_dofile (error_lua )
64
+ elseif n == 4 then
65
+ print (" => error in mapgen script <=" )
66
+ core .register_mapgen_script (error_lua )
67
+ else
68
+ assert (false )
69
+ end
70
+
51
71
end
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ dir=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
3
+ gameid=${gameid:- devtest}
4
+ minetest=$dir /../bin/minetest
5
+ testspath=$dir /../tests
6
+ conf_server=$testspath /server.conf
7
+ worldpath=$testspath /world
8
+
9
+ [ -e " $minetest " ] || { echo " executable $minetest missing" ; exit 1; }
10
+
11
+ write_config () {
12
+ printf ' %s\n' > " $conf_server " \
13
+ helper_mode=error mg_name=singlenode " $@ "
14
+ }
15
+
16
+ run () {
17
+ timeout 10 " $@ "
18
+ r=$?
19
+ echo " Exit status: $r "
20
+ [ $r -eq 124 ] && echo " (timed out)"
21
+ if [ $r -ne 1 ]; then
22
+ echo " -> Test failed"
23
+ exit 1
24
+ fi
25
+ }
26
+
27
+ rm -rf " $worldpath "
28
+ mkdir -p " $worldpath /worldmods"
29
+
30
+ ln -s " $dir /helper_mod" " $worldpath /worldmods/"
31
+
32
+ args=(--server --config " $conf_server " --world " $worldpath " --gameid $gameid )
33
+
34
+ # make sure we can tell apart sanitizer and minetest errors
35
+ export ASAN_OPTIONS=" exitcode=42"
36
+ export MSAN_OPTIONS=" exitcode=42"
37
+
38
+ # see helper_mod/init.lua for the different types
39
+ for n in $( seq 1 4) ; do
40
+ write_config error_type=$n
41
+ run " $minetest " " ${args[@]} "
42
+ echo " ---------------"
43
+ done
44
+
45
+ echo " All done."
46
+ exit 0
You can’t perform that action at this time.
0 commit comments