mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
tests: Move native while test from pybnative to micropython.
And make it so this test can run on any target. LED and time testing has been removed from this test, that can now be tested using: ./run-tests.py --via-mpy --emit native. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
13
tests/micropython/native_while.py
Normal file
13
tests/micropython/native_while.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# test native while loop
|
||||
|
||||
|
||||
@micropython.native
|
||||
def f(n):
|
||||
i = 0
|
||||
while i < n:
|
||||
print(i)
|
||||
i += 1
|
||||
|
||||
|
||||
f(2)
|
||||
f(4)
|
||||
@@ -1,17 +0,0 @@
|
||||
import time, pyb
|
||||
|
||||
|
||||
@micropython.native
|
||||
def f(led, n, d):
|
||||
led.off()
|
||||
i = 0
|
||||
while i < n:
|
||||
print(i)
|
||||
led.toggle()
|
||||
time.sleep_ms(d)
|
||||
i += 1
|
||||
led.off()
|
||||
|
||||
|
||||
f(pyb.LED(1), 2, 150)
|
||||
f(pyb.LED(2), 4, 50)
|
||||
@@ -941,7 +941,7 @@ the last matching regex is used:
|
||||
)
|
||||
if args.target == "pyboard":
|
||||
# run pyboard tests
|
||||
test_dirs += ("float", "stress", "pyb", "pybnative", "inlineasm")
|
||||
test_dirs += ("float", "stress", "pyb", "inlineasm")
|
||||
elif args.target in ("renesas-ra"):
|
||||
test_dirs += ("float", "inlineasm", "renesas-ra")
|
||||
elif args.target == "rp2":
|
||||
|
||||
Reference in New Issue
Block a user