aboutsummaryrefslogtreecommitdiff
path: root/tests/test_core.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-09-29 11:51:22 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-09-29 11:51:22 -0700
commit61221f3dd86360875f1a6ece4aebaa0a20bc025c (patch)
tree7ea64acb419554505a891a2b0b06537077216268 /tests/test_core.py
parent51256ab4452f9b1aa3774ef2eece26faa652ab22 (diff)
parent4db117910eb13fc93d632dd4e3fb4cf127544538 (diff)
Merge pull request #1601 from inolen/idbfs
NODEFS and IDBFS support
Diffstat (limited to 'tests/test_core.py')
-rw-r--r--tests/test_core.py50
1 files changed, 33 insertions, 17 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index d59fae40..f41d59ab 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -7742,12 +7742,18 @@ def process(filename):
finally:
Settings.INCLUDE_FULL_LIBRARY = 0
+ def test_fs_nodefs_rw(self):
+ src = open(path_from_root('tests', 'fs', 'test_nodefs_rw.c'), 'r').read()
+ self.do_run(src, 'success', force_c=True)
+
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 +7789,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 +7815,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 +7838,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'''