aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_core.py6
-rw-r--r--tests/unistd/access.c10
-rw-r--r--tests/unistd/truncate.c6
3 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index 4ab8f8e1..69fb31f3 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -7841,6 +7841,12 @@ def process(filename):
self.clear()
if not self.is_le32(): return self.skip('le32 needed for inline js')
for fs in ['MEMFS', 'NODEFS']:
+ if WINDOWS and fs == 'NODEFS':
+ print >> sys.stderr, 'Skipping NODEFS part of this test for test_unistd_links on Windows, since it would require administrative privileges.'
+ # Also, other detected discrepancies if you do end up running this test on NODEFS:
+ # test expects /, but Windows gives \ as path slashes.
+ # Calling readlink() on a non-link gives error 22 EINVAL on Unix, but simply error 0 OK on Windows.
+ continue
src = open(path_from_root('tests', 'unistd', 'links.c'), 'r').read()
expected = open(path_from_root('tests', 'unistd', 'links.out'), 'r').read()
Building.COMPILER_TEST_OPTS += ['-D' + fs]
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;
}