aboutsummaryrefslogtreecommitdiff
path: root/tests/test_core.py
diff options
context:
space:
mode:
authorAnthony Pesch <inolen@gmail.com>2013-09-02 13:58:39 -0700
committerAnthony Pesch <inolen@gmail.com>2013-09-27 00:46:17 -0700
commit9eaadf56f58b35376469e9a89373632fd34cf08c (patch)
tree1604648b4e270f5af03c6efc75dc287b2199d649 /tests/test_core.py
parentc354b8316cefef8fde6402cf0139f7a64f9b3103 (diff)
- updated several unistd tests to test against NODEFS
Diffstat (limited to 'tests/test_core.py')
-rw-r--r--tests/test_core.py46
1 files changed, 29 insertions, 17 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index d59fae40..e78fb513 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -7745,9 +7745,11 @@ def process(filename):
def test_unistd_access(self):
if Settings.ASM_JS: Settings.ASM_JS = 2 # skip validation, asm does not support random code
if not self.is_le32(): return self.skip('le32 needed for inline js')
- src = open(path_from_root('tests', 'unistd', 'access.c'), 'r').read()
- expected = open(path_from_root('tests', 'unistd', 'access.out'), 'r').read()
- self.do_run(src, expected)
+ for fs in ['MEMFS', 'NODEFS']:
+ src = open(path_from_root('tests', 'unistd', 'access.c'), 'r').read()
+ expected = open(path_from_root('tests', 'unistd', 'access.out'), 'r').read()
+ Building.COMPILER_TEST_OPTS = ['-D' + fs]
+ self.do_run(src, expected)
def test_unistd_curdir(self):
if Settings.ASM_JS: Settings.ASM_JS = 2 # skip validation, asm does not support random code
@@ -7783,9 +7785,11 @@ def process(filename):
def test_unistd_truncate(self):
if Settings.ASM_JS: Settings.ASM_JS = 2 # skip validation, asm does not support random code
if not self.is_le32(): return self.skip('le32 needed for inline js')
- src = open(path_from_root('tests', 'unistd', 'truncate.c'), 'r').read()
- expected = open(path_from_root('tests', 'unistd', 'truncate.out'), 'r').read()
- self.do_run(src, expected)
+ for fs in ['MEMFS', 'NODEFS']:
+ src = open(path_from_root('tests', 'unistd', 'truncate.c'), 'r').read()
+ expected = open(path_from_root('tests', 'unistd', 'truncate.out'), 'r').read()
+ Building.COMPILER_TEST_OPTS = ['-D' + fs]
+ self.do_run(src, expected)
def test_unistd_swab(self):
src = open(path_from_root('tests', 'unistd', 'swab.c'), 'r').read()
@@ -7807,15 +7811,19 @@ def process(filename):
self.do_run(src, expected)
def test_unistd_unlink(self):
- src = open(path_from_root('tests', 'unistd', 'unlink.c'), 'r').read()
- self.do_run(src, 'success', force_c=True)
+ for fs in ['MEMFS', 'NODEFS']:
+ src = open(path_from_root('tests', 'unistd', 'unlink.c'), 'r').read()
+ Building.COMPILER_TEST_OPTS = ['-D' + fs]
+ self.do_run(src, 'success', force_c=True)
def test_unistd_links(self):
if Settings.ASM_JS: Settings.ASM_JS = 2 # skip validation, asm does not support random code
if not self.is_le32(): return self.skip('le32 needed for inline js')
- src = open(path_from_root('tests', 'unistd', 'links.c'), 'r').read()
- expected = open(path_from_root('tests', 'unistd', 'links.out'), 'r').read()
- self.do_run(src, expected)
+ for fs in ['MEMFS', 'NODEFS']:
+ 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]
+ self.do_run(src, expected)
def test_unistd_sleep(self):
src = open(path_from_root('tests', 'unistd', 'sleep.c'), 'r').read()
@@ -7826,14 +7834,18 @@ def process(filename):
if Settings.ASM_JS: Settings.ASM_JS = 2 # skip validation, asm does not support random code
if not self.is_le32(): return self.skip('le32 needed for inline js')
if self.run_name == 'o2': return self.skip('non-asm optimized builds can fail with inline js')
- src = open(path_from_root('tests', 'unistd', 'io.c'), 'r').read()
- expected = open(path_from_root('tests', 'unistd', 'io.out'), 'r').read()
- self.do_run(src, expected)
+ for fs in ['MEMFS', 'NODEFS']:
+ src = open(path_from_root('tests', 'unistd', 'io.c'), 'r').read()
+ expected = open(path_from_root('tests', 'unistd', 'io.out'), 'r').read()
+ Building.COMPILER_TEST_OPTS = ['-D' + fs]
+ self.do_run(src, expected)
def test_unistd_misc(self):
- src = open(path_from_root('tests', 'unistd', 'misc.c'), 'r').read()
- expected = open(path_from_root('tests', 'unistd', 'misc.out'), 'r').read()
- self.do_run(src, expected)
+ for fs in ['MEMFS', 'NODEFS']:
+ src = open(path_from_root('tests', 'unistd', 'misc.c'), 'r').read()
+ expected = open(path_from_root('tests', 'unistd', 'misc.out'), 'r').read()
+ Building.COMPILER_TEST_OPTS = ['-D' + fs]
+ self.do_run(src, expected)
def test_uname(self):
src = r'''