aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authormax99x <max99x@gmail.com>2011-07-09 20:14:00 +0300
committermax99x <max99x@gmail.com>2011-07-09 20:14:00 +0300
commit11e404d7a8c76dbc1f10e24f4cee527f36d20092 (patch)
treedb9f500e777b9eee54c4f2fb46a31976340a67de /tests
parentb5b48bab8bddb23a80031897d97f8942e702787a (diff)
Polish for emscripten.py and its tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/autoassemble.bcbin576 -> 0 bytes
-rw-r--r--tests/autoassemble.c6
-rw-r--r--tests/cases/unannotated.ll (renamed from tests/unannotated.ll)0
-rw-r--r--tests/cases/unannotated.txt1
-rw-r--r--tests/runner.py26
5 files changed, 25 insertions, 8 deletions
diff --git a/tests/autoassemble.bc b/tests/autoassemble.bc
deleted file mode 100644
index 27a668c8..00000000
--- a/tests/autoassemble.bc
+++ /dev/null
Binary files differ
diff --git a/tests/autoassemble.c b/tests/autoassemble.c
new file mode 100644
index 00000000..0619933c
--- /dev/null
+++ b/tests/autoassemble.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+int main() {
+ puts("test\n");
+ return 0;
+}
diff --git a/tests/unannotated.ll b/tests/cases/unannotated.ll
index 96ce5468..96ce5468 100644
--- a/tests/unannotated.ll
+++ b/tests/cases/unannotated.ll
diff --git a/tests/cases/unannotated.txt b/tests/cases/unannotated.txt
new file mode 100644
index 00000000..9daeafb9
--- /dev/null
+++ b/tests/cases/unannotated.txt
@@ -0,0 +1 @@
+test
diff --git a/tests/runner.py b/tests/runner.py
index 04856b8b..28abbfde 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -2673,15 +2673,25 @@ if 'benchmark' not in sys.argv:
# This test *should* fail
assert 'Assertion failed' in str(e), str(e)
- def test_unannotated(self):
- self.do_ll_test(path_from_root('tests', 'unannotated.ll'), 'test\n')
-
def test_autoassemble(self):
- filename = os.path.join(self.get_dir(), 'src.bc')
- shutil.copy(path_from_root('tests', 'autoassemble.bc'), filename)
- self.do_emscripten(filename, append_ext=False)
- shutil.copy(filename + '.o.js', os.path.join(self.get_dir(), 'src.cpp.o.js'))
- self.do_test(None, 'test\n', no_build=True)
+ src = r'''
+ #include <stdio.h>
+
+ int main() {
+ puts("test\n");
+ return 0;
+ }
+ '''
+ dirname = self.get_dir()
+ filename = os.path.join(dirname, 'src.cpp')
+ self.build(src, dirname, filename)
+
+ new_filename = os.path.join(dirname, 'new.bc')
+ shutil.copy(filename + '.o', new_filename)
+ self.do_emscripten(new_filename, append_ext=False)
+
+ shutil.copy(filename + '.o.js', os.path.join(self.get_dir(), 'new.cpp.o.js'))
+ self.do_test(None, 'test\n', basename='new.cpp', no_build=True)
def test_dlmalloc_linked(self):
src = open(path_from_root('tests', 'dlmalloc_test.c'), 'r').read()