kopia lustrzana https://github.com/bristol-seds/pico-tracker
48 wiersze
1.2 KiB
Python
48 wiersze
1.2 KiB
Python
#!/usr/bin/env python
|
|
|
|
# ------------------------------------------------------------------------------
|
|
# Imports
|
|
# ------------------------------------------------------------------------------
|
|
|
|
import sys
|
|
sys.path.append("./test")
|
|
import main
|
|
|
|
from random import randint
|
|
|
|
# ------------------------------------------------------------------------------
|
|
# Test Script
|
|
# ------------------------------------------------------------------------------
|
|
|
|
class gps_baud_error_tc:
|
|
def __init__(self):
|
|
self.name = self.__class__.__name__
|
|
self.iterations = 20
|
|
|
|
|
|
def get_test(self):
|
|
"""Returns some suitable test parameters"""
|
|
params = main.struct_gps_baud_error_tc_params()
|
|
|
|
"""
|
|
Assign input parameters here
|
|
"""
|
|
|
|
return params
|
|
|
|
def is_correct(self, params, result, print_info):
|
|
"""Returns if a result is correct for the given parameters"""
|
|
|
|
"""
|
|
Compare result and params here, decide sth.
|
|
Can use print_info
|
|
"""
|
|
|
|
print_info("{} Hz on a {} MHz clock (Intended {} Hz)".format(
|
|
result["calculated_baud"],
|
|
result["peripheral_clock"],
|
|
result["intended_baud"]
|
|
)
|
|
|
|
return True
|