From 84697c07239ae6bf3f97bd691938bb75c2c72df7 Mon Sep 17 00:00:00 2001 From: j842 Date: Sun, 17 Aug 2025 21:12:13 +1200 Subject: [PATCH] test: Add 1 and update 2 files --- .gitea/workflows/buildtestpublish.yaml | 2 +- source/test.sh | 17 +++++++++++++---- test.sh | 20 ++++++++++++++++++++ 3 files changed, 34 insertions(+), 5 deletions(-) create mode 100755 test.sh diff --git a/.gitea/workflows/buildtestpublish.yaml b/.gitea/workflows/buildtestpublish.yaml index 39b1820..06b4884 100644 --- a/.gitea/workflows/buildtestpublish.yaml +++ b/.gitea/workflows/buildtestpublish.yaml @@ -31,7 +31,7 @@ jobs: - name: Run Tests run: | - cd source && ./test.sh + ./test.sh - name: Publish as Latest run: | diff --git a/source/test.sh b/source/test.sh index cac19ba..b5e0899 100755 --- a/source/test.sh +++ b/source/test.sh @@ -1,12 +1,21 @@ #!/bin/bash set -euo pipefail SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" - -ARCH=$(uname -m) +PARENT_DIR="$(dirname "${SCRIPT_DIR}")" PREV_DIR=$(pwd) trap 'cd "$PREV_DIR"' EXIT -"$SCRIPT_DIR/output/dropshell.${ARCH}" hash "${SCRIPT_DIR}/test.sh" -"$SCRIPT_DIR/output/dropshell.${ARCH}" help +# The Docker build outputs to the parent directory's output folder +DROPSHELL="${PARENT_DIR}/output/dropshell" + +# Check if the binary exists +if [ ! -f "$DROPSHELL" ]; then + echo "Error: dropshell binary not found at $DROPSHELL" + echo "Please run build.sh first" + exit 1 +fi + +"$DROPSHELL" hash "${SCRIPT_DIR}/test.sh" +"$DROPSHELL" help diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..5f8b02f --- /dev/null +++ b/test.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -euo pipefail + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" + +# Check if the binary exists +DROPSHELL="${SCRIPT_DIR}/output/dropshell" +if [ ! -f "$DROPSHELL" ]; then + echo "Error: dropshell binary not found at $DROPSHELL" + echo "Please run ./build.sh first" + exit 1 +fi + +echo "Testing dropshell binary..." + +# Run basic tests +"$DROPSHELL" hash "$0" +"$DROPSHELL" help + +echo "Tests completed successfully!" \ No newline at end of file