From 3fb252d01948f9fd78116e53a3da9c5b61c4a804 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 31 Jan 2019 10:56:22 +0100 Subject: add simple compile and option-combination tests for posix arch --- src/app/test_basic/Makefile.inc | 0 src/app/test_basic/main.cc | 31 +++++++++++++++++++++++++++++++ src/arch/posix/Makefile.inc | 2 +- tests/posix | 10 ++++++++++ 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 src/app/test_basic/Makefile.inc create mode 100644 src/app/test_basic/main.cc create mode 100755 tests/posix diff --git a/src/app/test_basic/Makefile.inc b/src/app/test_basic/Makefile.inc new file mode 100644 index 0000000..e69de29 diff --git a/src/app/test_basic/main.cc b/src/app/test_basic/main.cc new file mode 100644 index 0000000..4ac5067 --- /dev/null +++ b/src/app/test_basic/main.cc @@ -0,0 +1,31 @@ +#include "arch.h" +#include "driver/gpio.h" +#include "driver/stdout.h" +#include "driver/uptime.h" + +void loop(void) +{ + kout << "Loop" << endl; + gpio.led_toggle(0); +#ifdef TIMER_S + kout << dec << uptime.get_s() << endl; +#endif +} + +int main(void) +{ + arch.setup(); + gpio.setup(); + kout.setup(); + + /* + * There may be some delay between program start and UART capture start. + */ + for (uint8_t i = 0; i < 255; i++) { + kout << "Hello, World!" << endl; + } + + arch.idle_loop(); + + return 0; +} diff --git a/src/arch/posix/Makefile.inc b/src/arch/posix/Makefile.inc index 17cdfd9..7433bb5 100644 --- a/src/arch/posix/Makefile.inc +++ b/src/arch/posix/Makefile.inc @@ -40,7 +40,7 @@ run: build/system.elf monitor: run -program: +program: build/system.elf arch_clean: rm -f ${OBJECTS} diff --git a/tests/posix b/tests/posix new file mode 100755 index 0000000..8e12a30 --- /dev/null +++ b/tests/posix @@ -0,0 +1,10 @@ +#!/bin/sh + +uarttest() { + ~/var/projects/uarttest/bin/uarttest.py "$@" +} + +uarttest --runtime=2 --check "grep 'Hello, World!$'" '!build/system.elf' './mp app=test_basic arch=posix loop={!1} aspectc={0!1} gpio_trace={!1} arch_drivers={!counter} drivers={!softi2c}' + +# Loop +uarttest --runtime=2 --check "grep 'Hello, World!$'" '!build/system.elf' './mp app=test_basic arch=posix loop=1 aspectc={0!1} gpio_trace={!1} arch_drivers={!counter}' -- cgit v1.2.3