Skip to content

Commit

Permalink
tests/pkg_libfixmath_unittests: adapt test to upstream changes
Browse files Browse the repository at this point in the history
Let's no longer patch the upstream test but use it directly
  • Loading branch information
benpicco committed Jan 20, 2023
1 parent ea799e7 commit d102723
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pkg/libfixmath/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ all: $(filter libfixmath-unittests,$(USEMODULE))
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/$(PKG_NAME) -f $(CURDIR)/Makefile.$(PKG_NAME)

libfixmath-unittests:
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/unittests -f $(CURDIR)/Makefile.$(PKG_NAME)-unittests
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/tests -f $(CURDIR)/Makefile.$(PKG_NAME)-unittests
3 changes: 2 additions & 1 deletion pkg/libfixmath/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ CFLAGS += $(libfixmath_options:CONFIG_FIXMATH_%=-DFIXMATH_%)
INCLUDES += -I$(PKG_SOURCE_DIR)/libfixmath

ifneq (,$(filter libfixmath-unittests,$(USEMODULE)))
INCLUDES += -I$(PKG_SOURCE_DIR)/unittests
INCLUDES += -I$(PKG_SOURCE_DIR)
INCLUDES += -I$(PKG_SOURCE_DIR)/tests
endif
5 changes: 5 additions & 0 deletions tests/pkg_libfixmath_unittests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ ifneq (,$(filter native,$(BOARD)))
endif

USEMODULE += printf_float
USEMODULE += test_utils_main_exit_cb

CFLAGS += -Wno-error=strict-prototypes
CFLAGS += -Wno-error=old-style-definition
CFLAGS += -Wno-error=format

TEST_ON_CI_WHITELIST += native

Expand Down
17 changes: 6 additions & 11 deletions tests/pkg_libfixmath_unittests/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,12 @@
*/

#include <stdio.h>
#include "libfixmath-unittests.h"

#define RUN(x) if (x() != 0) { return 1; }

int main(void)
void test_utils_main_exit_cb(int res)
{
RUN(fix16_exp_unittests);
RUN(fix16_macros_unittests);
RUN(fix16_str_unittests);
RUN(fix16_unittests);

puts("SUCCESS");
return 0;
if (res) {
puts("FAILED");
} else {
puts("SUCCESS");
}
}

0 comments on commit d102723

Please sign in to comment.