tests/pkg_minmea: migrate to testrunner

This commit is contained in:
Alexandre Abadie 2017-11-10 09:06:38 +01:00
parent 783e04e7e6
commit f5d2f0f503
3 changed files with 22 additions and 1 deletions

View File

@ -7,3 +7,6 @@ USEPKG += minmea
BOARD_BLACKLIST := chronos msb-430 msb-430h telosb wsn430-v1_3b wsn430-v1_4 z1
include $(RIOTBASE)/Makefile.include
test:
tests/01-run.py

View File

@ -26,16 +26,18 @@ static const char *_gll = "$GNGLL,5229.0178,N,01326.7605,E,114350.000,A,A*45";
int main(void)
{
puts("START");
struct minmea_sentence_gll frame;
int res = minmea_parse_gll(&frame, _gll);
if (!res) {
puts("error parsing GPS sentence");
puts("FAILURE: error parsing GPS sentence");
}
else {
printf("parsed coordinates: lat=%f lon=%f\n",
minmea_tocoord(&frame.latitude),
minmea_tocoord(&frame.longitude));
puts("SUCCESS");
}
return 0;

View File

@ -0,0 +1,16 @@
#!/usr/bin/env python3
import os
import sys
import math
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
import testrunner
def testfunc(child):
child.expect_exact('START')
child.expect_exact('SUCCESS')
if __name__ == "__main__":
sys.exit(testrunner.run(testfunc))