tests/import: Add test for importing viper code with additional flags.

This commit is contained in:
Damien George 2019-12-02 16:27:24 +11:00
parent abc642973d
commit 111d1ffb64
2 changed files with 22 additions and 0 deletions

View File

@ -73,6 +73,27 @@ user_files = {
b'\x00\x00\x00\x00\x00\x00\x00\x00' # dummy machine code
b'\x00\x00\x00' # scope_flags, n_pos_args, type_sig
),
# test loading viper with additional scope flags and relocation
'/mod2.mpy': (
b'M\x05\x0b\x1f\x20' # header
b'\x20' # n bytes, bytecode
b'\x00\x08\x02m\x02m' # prelude
b'\x51' # LOAD_CONST_NONE
b'\x63' # RETURN_VALUE
b'\x00\x01' # n_obj, n_raw_code
b'\x12' # n bytes(=4), viper code
b'\x00\x00\x00\x00' # dummy machine code
b'\x00' # n_qstr
b'\x70' # scope_flags: VIPERBSS | VIPERRODATA | VIPERRELOC
b'\x00\x00' # n_obj, n_raw_code
b'\x06rodata' # rodata, 6 bytes
b'\x04' # bss, 4 bytes
b'\x03\x01\x00' # dummy relocation of rodata
),
}
# create and mount a user filesystem

View File

@ -1,2 +1,3 @@
mod0 ValueError incompatible .mpy arch
mod1 OK
mod2 OK