Skip to content

Commit

Permalink
Add test-config to uart common
Browse files Browse the repository at this point in the history
Add test config needed by uart tests to embedded-uart-common.
  • Loading branch information
Zifzaf committed Sep 29, 2020
1 parent f09a118 commit 9ad2900
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions embedded-uart-common/test-config/base_config.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
test_common_dir := ../embedded-uart-common/test-config

sensirion_test_sources := ${test_common_dir}/sensirion_test_setup.h \
${test_common_dir}/sensirion_test_setup.cpp

CXXFLAGS ?= $(CFLAGS) -fsanitize=address -I${test_common_dir}
LDFLAGS ?= -lasan -lstdc++ -lCppUTest -lCppUTestExt
5 changes: 5 additions & 0 deletions embedded-uart-common/test-config/sensirion_test_setup.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "CppUTest/CommandLineTestRunner.h"

int main(int argc, char** argv) {
return CommandLineTestRunner::RunAllTests(argc, argv);
}
13 changes: 13 additions & 0 deletions embedded-uart-common/test-config/sensirion_test_setup.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef SENSIRION_TEST_SETUP_H
#define SENSIRION_TEST_SETUP_H

#include "CppUTest/TestHarness.h"
#include "sensirion_uart.h"
#include <stdio.h>

#define CHECK_ZERO(actual) CHECK_EQUAL(0, (actual))
#define CHECK_ZERO_TEXT(actual, text) CHECK_EQUAL_TEXT(0, (actual), (text))

int main(int argc, char** argv);

#endif /* SENSIRION_TEST_SETUP_H */

0 comments on commit 9ad2900

Please sign in to comment.