diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-09-05 21:50:45 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-09-05 21:50:45 -0700 |
commit | e9624929302ad7f10d38a8de21dd0d7f5aa1f675 (patch) | |
tree | d3ba5e61079ba13e3bc1de30713398e5f0cc1733 /tests/test_core.py | |
parent | 5adf7fcf23da86a26e7b3976872440c97494d1b4 (diff) | |
parent | ac21f0bddcdac04ff17cf60209a934dc222327d3 (diff) |
Merge pull request #1581 from inolen/rwfile
added read/writeFile helpers, updated tests to use new FS APIs
Diffstat (limited to 'tests/test_core.py')
-rw-r--r-- | tests/test_core.py | 57 |
1 files changed, 6 insertions, 51 deletions
diff --git a/tests/test_core.py b/tests/test_core.py index ff768b5c..2238859b 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -7355,7 +7355,7 @@ def process(filename): FS.registerDevice(dummy_device, {}); FS.createDataFile('/', 'file', 'abcdef', true, true); - FS.mkdev('/device', 0666, dummy_device); + FS.mkdev('/device', dummy_device); \'\'\' ) open(filename, 'w').write(src) @@ -7613,32 +7613,14 @@ def process(filename): Settings.INCLUDE_FULL_LIBRARY = 0 def test_unistd_access(self): - add_pre_run = ''' -def process(filename): - import tools.shared as shared - src = open(filename, 'r').read().replace( - '// {{PRE_RUN_ADDITIONS}}', - open(shared.path_from_root('tests', 'unistd', 'access.js'), 'r').read() - ) - open(filename, 'w').write(src) -''' 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, post_build=add_pre_run) + self.do_run(src, expected) def test_unistd_curdir(self): - add_pre_run = ''' -def process(filename): - import tools.shared as shared - src = open(filename, 'r').read().replace( - '// {{PRE_RUN_ADDITIONS}}', - open(shared.path_from_root('tests', 'unistd', 'curdir.js'), 'r').read() - ) - open(filename, 'w').write(src) -''' src = open(path_from_root('tests', 'unistd', 'curdir.c'), 'r').read() expected = open(path_from_root('tests', 'unistd', 'curdir.out'), 'r').read() - self.do_run(src, expected, post_build=add_pre_run) + self.do_run(src, expected) def test_unistd_close(self): src = open(path_from_root('tests', 'unistd', 'close.c'), 'r').read() @@ -7665,18 +7647,9 @@ def process(filename): self.do_run(src, expected) def test_unistd_truncate(self): - add_pre_run = ''' -def process(filename): - import tools.shared as shared - src = open(filename, 'r').read().replace( - '// {{PRE_RUN_ADDITIONS}}', - open(shared.path_from_root('tests', 'unistd', 'truncate.js'), 'r').read() - ) - open(filename, 'w').write(src) -''' 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, post_build=add_pre_run) + self.do_run(src, expected) def test_unistd_swab(self): src = open(path_from_root('tests', 'unistd', 'swab.c'), 'r').read() @@ -7702,18 +7675,9 @@ def process(filename): self.do_run(src, 'success', force_c=True) def test_unistd_links(self): - add_pre_run = ''' -def process(filename): - import tools.shared as shared - src = open(filename, 'r').read().replace( - '// {{PRE_RUN_ADDITIONS}}', - open(shared.path_from_root('tests', 'unistd', 'links.js'), 'r').read() - ) - open(filename, 'w').write(src) -''' 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, post_build=add_pre_run) + self.do_run(src, expected) def test_unistd_sleep(self): src = open(path_from_root('tests', 'unistd', 'sleep.c'), 'r').read() @@ -7721,18 +7685,9 @@ def process(filename): self.do_run(src, expected) def test_unistd_io(self): - add_pre_run = ''' -def process(filename): - import tools.shared as shared - src = open(filename, 'r').read().replace( - '// {{PRE_RUN_ADDITIONS}}', - open(shared.path_from_root('tests', 'unistd', 'io.js'), 'r').read() - ) - open(filename, 'w').write(src) -''' 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, post_build=add_pre_run) + self.do_run(src, expected) def test_unistd_misc(self): src = open(path_from_root('tests', 'unistd', 'misc.c'), 'r').read() |