diff options
author | Jukka Jylänki <jujjyl@gmail.com> | 2013-10-21 22:20:25 +0300 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-10-21 22:20:25 +0300 |
commit | be989520749958289c1d0be30389550ff79dde6b (patch) | |
tree | 19aac510aee14008fd576e8b16e585a13b4cc58a | |
parent | aa3c7f8214e8c12dd70d91b237b1fab184390608 (diff) |
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.
-rw-r--r-- | tests/unistd/access.c | 10 | ||||
-rw-r--r-- | tests/unistd/truncate.c | 6 |
2 files changed, 16 insertions, 0 deletions
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; } |