Commit f2d732f4 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

tests/extmod: Make tests skippable.

parent 7bb14635
......@@ -5,7 +5,8 @@ try:
import umachine as machine
except ImportError:
import machine
except ImportError:
machine.mem8
except:
print("SKIP")
import sys
sys.exit()
......
try:
import ubinascii as binascii
try:
import ubinascii as binascii
except ImportError:
import binascii
except ImportError:
import binascii
import sys
print("SKIP")
sys.exit()
print(binascii.a2b_base64(b''))
print(binascii.a2b_base64(b'Zg=='))
......
try:
import ubinascii as binascii
try:
import ubinascii as binascii
except ImportError:
import binascii
except ImportError:
import binascii
import sys
print("SKIP")
sys.exit()
print(binascii.b2a_base64(b''))
print(binascii.b2a_base64(b'f'))
......
try:
import ubinascii as binascii
try:
import ubinascii as binascii
except ImportError:
import binascii
except ImportError:
import binascii
import sys
print("SKIP")
sys.exit()
try:
binascii.crc32
except AttributeError:
......
try:
import ubinascii as binascii
try:
import ubinascii as binascii
except ImportError:
import binascii
except ImportError:
import binascii
import sys
print("SKIP")
sys.exit()
print(binascii.hexlify(b'\x00\x01\x02\x03\x04\x05\x06\x07'))
print(binascii.hexlify(b'\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f'))
......
try:
import ubinascii as binascii
try:
import ubinascii as binascii
except ImportError:
import binascii
except ImportError:
import binascii
import sys
print("SKIP")
sys.exit()
# two arguments supported in uPy but not CPython
a = binascii.hexlify(b'123', ':')
......
try:
import ubinascii as binascii
try:
import ubinascii as binascii
except ImportError:
import binascii
except ImportError:
import binascii
import sys
print("SKIP")
sys.exit()
print(binascii.unhexlify(b'0001020304050607'))
print(binascii.unhexlify(b'08090a0b0c0d0e0f'))
......
import uctypes
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
desc = {
# arr is array at offset 0, of UINT8 elements, array size is 2
......
import sys
import uctypes
try:
import uctypes
except ImportError:
print("SKIP")
sys.exit()
if sys.byteorder != "little":
print("SKIP")
......
import uctypes
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
desc = {
"arr": (uctypes.ARRAY | 0, uctypes.UINT8 | 2),
......
import uctypes
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
desc = {
"s0": uctypes.UINT16 | 0,
......
import uctypes
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
desc = {
"f32": uctypes.FLOAT32 | 0,
......
import uctypes
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
desc = {
"f32": uctypes.FLOAT32 | 0,
......
......@@ -2,7 +2,11 @@
# Codepaths for packed vs native structures are different. This test only works
# on little-endian machine (no matter if 32 or 64 bit).
import sys
import uctypes
try:
import uctypes
except ImportError:
print("SKIP")
sys.exit()
if sys.byteorder != "little":
print("SKIP")
......
# test printing of uctypes objects
import uctypes
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
# we use an address of "0" because we just want to print something deterministic
# and don't actually need to set/get any values in the struct
......
import sys
import uctypes
try:
import uctypes
except ImportError:
print("SKIP")
sys.exit()
if sys.byteorder != "little":
print("SKIP")
......
import sys
import uctypes
try:
import uctypes
except ImportError:
print("SKIP")
sys.exit()
if sys.byteorder != "little":
print("SKIP")
......
import uctypes
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
desc = {
# arr is array at offset 0, of UINT8 elements, array size is 2
......
import uctypes
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
S1 = {}
assert uctypes.sizeof(S1) == 0
......
try:
import uheapq as heapq
except:
import heapq
try:
import heapq
except ImportError:
import sys
print("SKIP")
sys.exit()
try:
heapq.heappop([])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment