|
10 | 10 | from test_LEB128 import test_unsigned_LEB128 |
11 | 11 | from leb128s import leb128sencodedecodeexhaustive |
12 | 12 | from leb128s import leb128uencodedecodeexhaustive |
| 13 | +from sectionvalidation import * |
13 | 14 | from abc import ABCMeta, abstractmethod |
14 | 15 | sys.path.append('../') |
15 | 16 | from utils import Colors |
@@ -88,52 +89,25 @@ def Legacy(self): |
88 | 89 | def GetName(self): |
89 | 90 | return('leb128exhaustive') |
90 | 91 |
|
| 92 | +class SectionValidationTest(Void_Spwner): |
| 93 | + def Legacy(self): |
| 94 | + section_validation() |
| 95 | + |
| 96 | + def GetName(self): |
| 97 | + return('sectionvalidationtest') |
| 98 | + |
91 | 99 | ################################################################################ |
92 | 100 | def main(): |
93 | | - return_list = [] |
94 | 101 | # LEB128 tests |
95 | 102 | leb128encodetest = LEB128EncodeTest() |
96 | 103 | leb128encodetest.Spwn() |
97 | 104 | # leb128s exhaustive |
98 | 105 | leb128sex = LEB128Exhaustive() |
99 | 106 | leb128sex.Spwn() |
100 | | - # parser test on the WASM testsuite |
101 | | - obj_list = ObjectList() |
102 | | - for testfile in obj_list: |
103 | | - pid = os.fork() |
104 | | - # I dont have a bellybutton |
105 | | - if pid == 0: |
106 | | - # @DEVI-FIXME-pipe stdout and stderr to a file instead of the |
107 | | - # bitbucket |
108 | | - sys.stdout = open('/dev/null', 'w') |
109 | | - sys.stderr = open('/dev/null', 'w') |
110 | | - |
111 | | - interpreter = PythonInterpreter() |
112 | | - module = interpreter.parse(testfile) |
113 | | - interpreter.appendmodule(module) |
114 | | - interpreter.dump_sections(module) |
115 | | - interpreter.runValidations() |
116 | | - vm = VM(interpreter.getmodules()) |
117 | | - ms = vm.getState() |
118 | | - # interpreter.dump_sections(module) |
119 | | - DumpIndexSpaces(ms) |
120 | | - DumpLinearMems(ms.Linear_Memory, 1000) |
121 | | - sys.exit() |
122 | | - # the parent process |
123 | | - elif pid > 0: |
124 | | - # @DEVI-FIXME-we are intentionally blocking. later i will fix this |
125 | | - # so we can use multicores to run our reg tests faster. |
126 | | - cpid, status = os.waitpid(pid, 0) |
127 | | - return_list.append(status) |
128 | | - if status == 0: |
129 | | - print(success + testfile) |
130 | | - else: |
131 | | - print(fail + testfile) |
132 | | - else: |
133 | | - # basically we couldnt fork a child |
134 | | - print(fail + 'return code:' + pid) |
135 | | - raise Exception("could not fork child") |
136 | 107 |
|
| 108 | + # parser test on the WASM testsuite |
| 109 | + sectionvalidation = SectionValidationTest() |
| 110 | + sectionvalidation.Spwn() |
137 | 111 |
|
138 | 112 | if __name__ == '__main__': |
139 | 113 | main() |
0 commit comments