test: Update 18 files
Some checks failed
Build-Test-Publish / build (linux/arm64) (push) Failing after 9s
Build-Test-Publish / build (linux/amd64) (push) Failing after 22s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Has been skipped
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Has been skipped
Some checks failed
Build-Test-Publish / build (linux/arm64) (push) Failing after 9s
Build-Test-Publish / build (linux/amd64) (push) Failing after 22s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Has been skipped
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Has been skipped
This commit is contained in:
@ -6,23 +6,59 @@ PROJECT_DIR="$( cd "$SCRIPT_DIR/.." && pwd )"
|
||||
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
# Clean up old test data
|
||||
rm -rf dehydrate_test_data
|
||||
# Clean up old test data and any existing binaries
|
||||
# Force removal with chmod to handle permission issues
|
||||
if [ -d dehydrate_test_data ]; then
|
||||
chmod -R u+w dehydrate_test_data 2>/dev/null || true
|
||||
rm -rf dehydrate_test_data
|
||||
fi
|
||||
rm -f dehydrate_test
|
||||
|
||||
# Build the test program - mount the entire project directory to access ../output/dehydrate
|
||||
docker run --rm -v "$PROJECT_DIR":/workdir -w /workdir/test gitea.jde.nz/public/dropshell-build-base:latest \
|
||||
# Build the test program using Docker
|
||||
# The Docker container supports both amd64 and arm64 architectures
|
||||
docker run --rm \
|
||||
-v "$PROJECT_DIR":/workdir \
|
||||
-w /workdir/test \
|
||||
gitea.jde.nz/public/dropshell-build-base:latest \
|
||||
bash -c "
|
||||
if [ -f dehydrate_test.cpp ]; then
|
||||
g++ -std=c++23 -static dehydrate_test.cpp -o dehydrate_test
|
||||
else
|
||||
# Verify we can find the source file
|
||||
if [ ! -f dehydrate_test.cpp ]; then
|
||||
echo 'ERROR: dehydrate_test.cpp not found in current directory'
|
||||
echo 'Working directory:' && pwd
|
||||
echo 'Available files:' && ls -la
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Clean any existing binary and compile
|
||||
rm -f dehydrate_test
|
||||
if ! g++ -std=c++23 -static dehydrate_test.cpp -o dehydrate_test; then
|
||||
echo 'ERROR: Compilation failed'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Verify binary was created and is executable
|
||||
if [ ! -f dehydrate_test ]; then
|
||||
echo 'ERROR: Binary was not created'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Quick architecture check - the binary should at least start
|
||||
if ! timeout 5 ./dehydrate_test 2>/dev/null; then
|
||||
# If it fails to run, check if it's an architecture mismatch
|
||||
if file dehydrate_test | grep -q 'cannot execute'; then
|
||||
echo 'ERROR: Binary architecture mismatch'
|
||||
echo 'Host arch:' && uname -m
|
||||
echo 'Binary info:' && file dehydrate_test
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
"
|
||||
|
||||
# Check if compilation succeeded
|
||||
if [ ! -f "./dehydrate_test" ]; then
|
||||
echo "Error: Failed to compile dehydrate_test"
|
||||
echo "Error: Failed to compile dehydrate_test - binary not found"
|
||||
echo "Files in current directory:"
|
||||
ls -la
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
Reference in New Issue
Block a user