aboutsummaryrefslogtreecommitdiffstats
path: root/tools/test.sh
diff options
context:
space:
mode:
authorKostya <mail@sartin.in>2026-08-18 06:52:47 +0000
committerKostya <mail@sartin.in>2026-08-18 06:52:47 +0000
commitd2688a197bd680580699f05e8194f9180e4832fa (patch)
tree0531ef505b0637c9c4bcc17ab6183a6089e26889 /tools/test.sh
parent13a221ffaefc169d028c7eab6f21ac88052d1d40 (diff)
downloadguess-market-d2688a197bd680580699f05e8194f9180e4832fa.tar.gz
guess-market-d2688a197bd680580699f05e8194f9180e4832fa.tar.xz
guess-market-d2688a197bd680580699f05e8194f9180e4832fa.zip
Add XML schema validation, split build scripts by module, rename BuyMenuCommand to PlaceOrderMenuCommand
Introduces XMLValidatorV1 and deserializer/adapter classes for events, ledgers, markets, users, and trading mechanisms. Replaces the monolithic build.bat/run.sh scripts with per-module tools (_util.sh, build.sh, package.sh, test.sh) that compile in dependency order.
Diffstat (limited to 'tools/test.sh')
-rw-r--r--tools/test.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/tools/test.sh b/tools/test.sh
new file mode 100644
index 0000000..4eaeb82
--- /dev/null
+++ b/tools/test.sh
@@ -0,0 +1,47 @@
1#!/bin/bash
2
3set -e
4cd "$(dirname "$0")/.."
5. tools/_util.sh
6
7[ -d build/classes ] || {
8 echo "No build/classes - run tools/build.sh first"
9 exit 1
10}
11
12JUNIT_JAR=$(ls lib/junit/junit-platform-console-standalone-*.jar 2>/dev/null | head -n 1)
13[ -n "$JUNIT_JAR" ] || {
14 echo "JUnit standalone jar missing from lib/junit/"
15 exit 1
16}
17
18PROD_CP="$(module_cp $MODULES)"
19
20echo "=== Compiling test sources ==="
21: >"$TMP/tests.txt"
22for m in $MODULES; do
23 [ -d "$m/src/test/java" ] && find "$m/src/test/java" -name '*.java' >>"$TMP/tests.txt"
24done
25if [ ! -s "$TMP/tests.txt" ]; then
26 echo " (no test sources)"
27 exit 0
28fi
29
30mkdir -p build/test-classes
31javac --release "$JAVA_RELEASE" -d build/test-classes \
32 -cp "$PROD_CP$SEP$JUNIT_JAR$SEP$LIBCP" "@$TMP/tests.txt"
33
34echo "=== Running tests ==="
35
36TEST_CP="$PROD_CP${SEP}build/test-classes"
37for j in lib/*/*.jar; do
38 case "$j" in *junit-platform-console-standalone*) continue ;; esac
39 TEST_CP="$TEST_CP$SEP$j"
40done
41
42AGENT_JAR=$(ls lib/mockito/byte-buddy-agent-*.jar 2>/dev/null | head -n 1)
43AGENT_ARG=""
44[ -n "$AGENT_JAR" ] && AGENT_ARG="-javaagent:$AGENT_JAR"
45
46java $AGENT_ARG -jar "$JUNIT_JAR" execute \
47 --class-path "$TEST_CP" --scan-class-path --details=summary