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:
@ -137,7 +137,25 @@ int main() {
|
||||
|
||||
// Clean up any existing test data
|
||||
if (fs::exists(test_root)) {
|
||||
fs::remove_all(test_root);
|
||||
try {
|
||||
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
|
||||
|
Reference in New Issue
Block a user