mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Add utility script to stress-test mapgen
This commit is contained in:
parent
fc3460470a
commit
0e63f18a73
4 changed files with 89 additions and 22 deletions
30
util/stress_mapgen.sh
Executable file
30
util/stress_mapgen.sh
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/bin/bash
|
||||
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
gameid=${gameid:-devtest}
|
||||
minetest=$dir/../bin/minetest
|
||||
testspath=$dir/../tests
|
||||
conf_server=$testspath/server.conf
|
||||
worldpath=$testspath/world
|
||||
|
||||
run () {
|
||||
if [ -n "$PERF" ]; then
|
||||
perf record -z --call-graph dwarf -- "$@"
|
||||
else
|
||||
"$@"
|
||||
fi
|
||||
}
|
||||
|
||||
[ -e $minetest ] || { echo "executable $minetest missing"; exit 1; }
|
||||
|
||||
rm -rf $worldpath
|
||||
mkdir -p $worldpath/worldmods
|
||||
|
||||
settings=(sqlite_synchronous=0 helper_mode=mapgen)
|
||||
[ -n "$PROFILER" ] && settings+=(profiler_print_interval=15)
|
||||
printf '%s\n' "${settings[@]}" >$testspath/server.conf \
|
||||
|
||||
ln -s $dir/helper_mod $worldpath/worldmods/
|
||||
|
||||
args=(--config $conf_server --world $worldpath --gameid $gameid)
|
||||
[ -n "$PROFILER" ] && args+=(--verbose)
|
||||
run $minetest --server "${args[@]}"
|
Loading…
Add table
Add a link
Reference in a new issue