minecraft-pi-docker/scripts/test.sh

31 lines
602 B
Bash
Raw Normal View History

2021-06-17 21:32:24 +00:00
#!/bin/sh
set -e
2023-12-26 22:29:45 +00:00
# Variables
MODE="$(echo "$1" | tr '[:upper:]' '[:lower:]')"
2024-02-04 02:07:53 +00:00
ARCH='host'
2022-03-09 23:47:31 +00:00
2023-12-26 22:29:45 +00:00
# Build
2024-02-04 02:07:53 +00:00
./scripts/build.mjs none "${MODE}" "${ARCH}" -DMCPI_HEADLESS_MODE=ON
2023-12-26 22:29:45 +00:00
# Add To PATH
2024-02-04 02:07:53 +00:00
export PATH="$(pwd)/out/${MODE}/${ARCH}/usr/bin:${PATH}"
2021-06-17 21:32:24 +00:00
2023-12-26 22:29:45 +00:00
# Make Test Directory
2021-06-17 21:32:24 +00:00
rm -rf build/test
mkdir -p build/test
2023-12-26 22:29:45 +00:00
# Run
if [ "${MODE}" = "server" ]; then
# Server Test
cd build/test
minecraft-pi-reborn-server --only-generate
cd ../../
else
# Client Test
export _MCPI_SKIP_ROOT_CHECK=1
export HOME="$(pwd)/build/test"
minecraft-pi-reborn-client --default --no-cache --benchmark
fi