test: Update 4 files
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 8s
Build-Test-Publish / build (linux/arm64) (push) Failing after 10s
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/amd64) (push) Failing after 8s
Build-Test-Publish / build (linux/arm64) (push) Failing after 10s
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:
parent
007c1cfdf8
commit
e30111f812
4
.gitignore
vendored
4
.gitignore
vendored
@ -48,6 +48,10 @@ CTestTestfile.cmake
|
|||||||
*.iws
|
*.iws
|
||||||
*.ipr
|
*.ipr
|
||||||
|
|
||||||
|
# Test data
|
||||||
|
dehydrate_test_data/
|
||||||
|
test_temp/
|
||||||
|
|
||||||
# macOS
|
# macOS
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.AppleDouble
|
.AppleDouble
|
||||||
|
@ -42,16 +42,12 @@ docker run --rm \
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Quick architecture check - the binary should at least start
|
# Quick architecture check - just verify the binary format
|
||||||
if ! timeout 5 ./dehydrate_test 2>/dev/null; then
|
if ! file dehydrate_test | grep -q 'executable'; then
|
||||||
# If it fails to run, check if it's an architecture mismatch
|
echo 'ERROR: Generated file is not an executable'
|
||||||
if file dehydrate_test | grep -q 'cannot execute'; then
|
file dehydrate_test
|
||||||
echo 'ERROR: Binary architecture mismatch'
|
|
||||||
echo 'Host arch:' && uname -m
|
|
||||||
echo 'Binary info:' && file dehydrate_test
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
"
|
"
|
||||||
|
|
||||||
# Check if compilation succeeded
|
# Check if compilation succeeded
|
||||||
@ -62,5 +58,13 @@ if [ ! -f "./dehydrate_test" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Fix ownership of the binary (created by Docker as root)
|
||||||
|
if [ "$(stat -c %u ./dehydrate_test)" != "$(id -u)" ]; then
|
||||||
|
# Use Docker to change ownership to current user
|
||||||
|
docker run --rm -v "$PROJECT_DIR":/workdir -w /workdir/test \
|
||||||
|
gitea.jde.nz/public/dropshell-build-base:latest \
|
||||||
|
chown "$(id -u):$(id -g)" dehydrate_test
|
||||||
|
fi
|
||||||
|
|
||||||
# Run the test
|
# Run the test
|
||||||
./dehydrate_test
|
./dehydrate_test
|
Binary file not shown.
@ -137,7 +137,25 @@ int main() {
|
|||||||
|
|
||||||
// Clean up any existing test data
|
// Clean up any existing test data
|
||||||
if (fs::exists(test_root)) {
|
if (fs::exists(test_root)) {
|
||||||
|
try {
|
||||||
fs::remove_all(test_root);
|
fs::remove_all(test_root);
|
||||||
|
} catch (const fs::filesystem_error& e) {
|
||||||
|
// If removal fails due to permissions, try to fix permissions first
|
||||||
|
std::cerr << "Warning: Failed to remove test directory, attempting to fix permissions: " << e.what() << std::endl;
|
||||||
|
try {
|
||||||
|
// Try to make files writable
|
||||||
|
for (auto& entry : fs::recursive_directory_iterator(test_root)) {
|
||||||
|
if (entry.is_regular_file()) {
|
||||||
|
fs::permissions(entry.path(), fs::perms::owner_write, fs::perm_options::add);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fs::remove_all(test_root);
|
||||||
|
} catch (const fs::filesystem_error& e2) {
|
||||||
|
std::cerr << "Error: Could not clean up test directory: " << e2.what() << std::endl;
|
||||||
|
std::cerr << "Please manually remove: " << test_root << std::endl;
|
||||||
|
// Continue anyway - the test might still work
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create directories
|
// Create directories
|
||||||
|
Loading…
x
Reference in New Issue
Block a user