stress_mapgen.sh 802 B

123456789101112131415161718192021222324252627282930
  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. run () {
  9. if [ -n "$PERF" ]; then
  10. perf record -z --call-graph dwarf -- "$@"
  11. else
  12. "$@"
  13. fi
  14. }
  15. [ -e "$minetest" ] || { echo "executable $minetest missing"; exit 1; }
  16. rm -rf "$worldpath"
  17. mkdir -p "$worldpath/worldmods"
  18. settings=(sqlite_synchronous=0 helper_mode=mapgen)
  19. [ -n "$PROFILER" ] && settings+=(profiler_print_interval=15)
  20. printf '%s\n' "${settings[@]}" >"$testspath/server.conf" \
  21. ln -s "$dir/helper_mod" "$worldpath/worldmods/"
  22. args=(--config "$conf_server" --world "$worldpath" --gameid $gameid)
  23. [ -n "$PROFILER" ] && args+=(--verbose)
  24. run "$minetest" --server "${args[@]}"