Use test_*_enabled
This commit is contained in:
@ -21,6 +21,7 @@ gen_src_body() {
|
||||
(
|
||||
for n in $*; do
|
||||
echo "extern uint32_t test_${n}_period_ms;"
|
||||
echo "extern bool test_${n}_enabled;"
|
||||
done
|
||||
echo ""
|
||||
for func in create destroy; do
|
||||
@ -28,7 +29,7 @@ gen_src_body() {
|
||||
echo " uint32_t total=0, success=0;"
|
||||
for n in $*; do
|
||||
cat << EOF
|
||||
if (!test_${n}_${func}()) {
|
||||
if (test_${n}_enabled && !test_${n}_${func}()) {
|
||||
LOG(LL_ERROR, ("Could not $func test $n"));
|
||||
} else {
|
||||
success++;
|
||||
@ -58,7 +59,7 @@ EOF
|
||||
EOF
|
||||
for n in $*; do
|
||||
cat << EOF
|
||||
if (now > next_${n}_run) {
|
||||
if (test_${n}_enabled && (now > next_${n}_run)) {
|
||||
if (test_${n}_run()) success++;
|
||||
next_${n}_run = now + (test_${n}_period_ms/1000.f);
|
||||
total++;
|
||||
@ -120,7 +121,7 @@ gen_src_head
|
||||
for f in tests/*.c; do
|
||||
base=$(basename $f | cut -f1 -d'.')
|
||||
echo "CHK $base in $f"
|
||||
egrep -q "test_${base}_enabled.*true" $f && base_list="$base_list $base"
|
||||
base_list="$base_list $base"
|
||||
done
|
||||
|
||||
gen_inc_body $base_list
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "tests_autogen.h"
|
||||
|
||||
uint32_t test_example_period_ms = 10000;
|
||||
bool test_example_enabled = true;
|
||||
bool test_example_enabled = false;
|
||||
|
||||
bool test_example_create(void) {
|
||||
// LOG(LL_INFO, ("Setting up"));
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "mgos_imu.h"
|
||||
|
||||
uint32_t test_imu_period_ms = 100; // 10Hz
|
||||
bool test_imu_enabled = true;
|
||||
bool test_imu_enabled = false;
|
||||
static struct mgos_imu *s_imu = NULL;
|
||||
|
||||
#define BOARD 3
|
||||
|
Reference in New Issue
Block a user