3dc324d3f1
This adds the Python files in the tests/ directory to be formatted with ./tools/codeformat.py. The basics/ subdirectory is excluded for now so we aren't changing too much at once. In a few places `# fmt: off`/`# fmt: on` was used where the code had special formatting for readability or where the test was actually testing the specific formatting.
23 lines
355 B
Python
23 lines
355 B
Python
@micropython.viper
|
|
def f1c(x: int) -> int:
|
|
return x
|
|
|
|
|
|
@micropython.native
|
|
def call(r):
|
|
f = f1c
|
|
for _ in r:
|
|
f(1)
|
|
|
|
|
|
bm_params = {
|
|
(50, 10): (15000,),
|
|
(100, 10): (30000,),
|
|
(1000, 10): (300000,),
|
|
(5000, 10): (1500000,),
|
|
}
|
|
|
|
|
|
def bm_setup(params):
|
|
return lambda: call(range(params[0])), lambda: (params[0] // 1000, None)
|