From be989520749958289c1d0be30389550ff79dde6b Mon Sep 17 00:00:00 2001 From: Jukka Jylänki Date: Mon, 21 Oct 2013 22:20:25 +0300 Subject: Fix test_unistd_access and test_unistd_truncate on Windows. Both tests failed at the end on cleanup stage, when the test left behind files with readonly bit set, and shutil.rmtree() fails on Windows if any of the files are read-only. --- tests/unistd/access.c | 10 ++++++++++ tests/unistd/truncate.c | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/tests/unistd/access.c b/tests/unistd/access.c index 57d38f5c..92b52e5e 100644 --- a/tests/unistd/access.c +++ b/tests/unistd/access.c @@ -33,5 +33,15 @@ int main() { errno = 0; printf("\n"); } + + // Restore full permissions on all created files so that python test runner rmtree + // won't have problems on deleting the files. On Windows, calling shutil.rmtree() + // will fail if any of the files are read-only. + EM_ASM( + FS.chmod('forbidden', 0777); + FS.chmod('readable', 0777); + FS.chmod('writeable', 0777); + FS.chmod('allaccess', 0777); + ); return 0; } diff --git a/tests/unistd/truncate.c b/tests/unistd/truncate.c index e63a4c13..5620f502 100644 --- a/tests/unistd/truncate.c +++ b/tests/unistd/truncate.c @@ -76,5 +76,11 @@ int main() { memset(&s, 0, sizeof s); errno = 0; + // Restore full permissions on all created files so that python test runner rmtree + // won't have problems on deleting the files. On Windows, calling shutil.rmtree() + // will fail if any of the files are read-only. + EM_ASM( + FS.chmod('toread', 0777); + ); return 0; } -- cgit v1.2.3-18-g5258