Permalink
Please sign in to comment.
Browse files
Work toward getting Oil unit tests to pass under byterun.
This is mostly an experiment for learning. For example, a type-specialized bytecode interpreter needs to handle exceptions, generators, etc. in the same way. - make 'opyc run' work again - shell scripts to run Oil unit tests under byterun - Make note of 4 unhandled exceptions, 3 of which look the same. - shell scripts to run byterun unit tests - logging tweaks to byterun: start moving away from stdlib logging - Add the concept of a GuestException, since host and guest were confused. But don't hook it up yet since it makes unit tests fail. - Improve error message for unbound method called with wrong receiver type, but don't hook it up yet because of failing tests.
- Loading branch information...
Showing
with
284 additions
and 53 deletions.
- +128 −19 opy/byterun/pyvm2.py
- +31 −0 opy/byterun/pyvm2_test.py
- +1 −0 opy/byterun/vmtest.py
- +1 −1 opy/callgraph.py
- +6 −11 opy/opy_main.py
- +33 −20 opy/smoke.sh
- +84 −2 opy/test.sh
| @@ -0,0 +1,31 @@ | ||
| #!/usr/bin/python | ||
| """ | ||
| pyvm2_test.py: Tests for pyvm2.py | ||
| """ | ||
| import unittest | ||
| import pyvm2 # module under test | ||
| import pyobj | ||
| def dummy(): | ||
| return 1 + 2 | ||
| class TestGuestException(unittest.TestCase): | ||
| def testGuestException(self): | ||
| co = dummy.__code__ | ||
| back = None # Frame pointer | ||
| locals_ = globals() | ||
| globals_ = globals() | ||
| frames = [pyobj.Frame(co, globals_, locals_, back)] | ||
| g = pyvm2.GuestException(RuntimeError, 1, frames) | ||
| print(g) | ||
| if __name__ == '__main__': | ||
| unittest.main() |
Oops, something went wrong.
0 comments on commit
0b27f31