From dcffbcee3d0463ae7d9a8e25e5739d0a5b249ed5 Mon Sep 17 00:00:00 2001 From: Quinn Purdy Date: Thu, 21 Sep 2023 12:33:17 -0400 Subject: [PATCH] Added additional make commands 'test-ui' which runs only playmode tests and 'test-sdk' which runs only editmode tests --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Makefile b/Makefile index 5307836e..30b6c404 100644 --- a/Makefile +++ b/Makefile @@ -57,3 +57,16 @@ test: echo "" && \ echo "Play mode Test results: " && \ head -n 2 TestResults_Play.xml | grep -Eo 'result="[^"]+"|total="[^"]+"|passed="[^"]+"|failed="[^"]+"|inconclusive="[^"]+"|skipped="[^"]+"|start-time="[^"]+"|end-time="[^"]+"|duration="[^"]+"' | grep -Ev 'clr-version=|engine-version=|asserts=|id=|testcasecount=' | sed -E 's/^[^"]+"([^"]+)"[^"]+"([^"]+)".*/\1: \2/' + +test-ui: + rm TestResults*.xml ; \ + Unity -runTests -projectPath "$(pwd)" -testPlatform playmode -testResults TestResults_Play.xml ; \ + echo "Play mode Test results: " && \ + head -n 2 TestResults_Play.xml | grep -Eo 'result="[^"]+"|total="[^"]+"|passed="[^"]+"|failed="[^"]+"|inconclusive="[^"]+"|skipped="[^"]+"|start-time="[^"]+"|end-time="[^"]+"|duration="[^"]+"' | grep -Ev 'clr-version=|engine-version=|asserts=|id=|testcasecount=' | sed -E 's/^[^"]+"([^"]+)"[^"]+"([^"]+)".*/\1: \2/' + +test-sdk: + rm TestResults*.xml ; cd ./testchain && (yarn start:hardhat & echo $$! > .pid) && cd .. && \ + Unity -batchmode -runTests -projectPath "$(pwd)" -testPlatform editmode -testResults TestResults_Edit.xml ; Unity -quit && \ + make stop && \ + echo "Edit mode Test results: " && \ + head -n 2 TestResults_Edit.xml | grep -Eo 'result="[^"]+"|total="[^"]+"|passed="[^"]+"|failed="[^"]+"|inconclusive="[^"]+"|skipped="[^"]+"|start-time="[^"]+"|end-time="[^"]+"|duration="[^"]+"' | grep -Ev 'clr-version=|engine-version=|asserts=|id=|testcasecount=' | sed -E 's/^[^"]+"([^"]+)"[^"]+"([^"]+)".*/\1: \2/'