From c6ac50f2e8c8c7ea130027f5bb0f3c4193695e47 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Fri, 20 Jan 2023 15:14:04 +0100 Subject: [PATCH 1/5] pkg/libfixmath: bump version custom patches are no longer needed --- pkg/libfixmath/Makefile | 2 +- pkg/libfixmath/patches/0001-Fix-warnings.patch | Bin 3088 -> 0 bytes .../patches/0002-Adapt-unittests-for-RIOT.patch | Bin 8833 -> 0 bytes 3 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 pkg/libfixmath/patches/0001-Fix-warnings.patch delete mode 100644 pkg/libfixmath/patches/0002-Adapt-unittests-for-RIOT.patch diff --git a/pkg/libfixmath/Makefile b/pkg/libfixmath/Makefile index 821da687d1..3883ad93f8 100644 --- a/pkg/libfixmath/Makefile +++ b/pkg/libfixmath/Makefile @@ -1,5 +1,5 @@ PKG_NAME := libfixmath -PKG_VERSION := 24488b16cc0359daada0682a9bd3a11a801d0a01 +PKG_VERSION := b987044c73dcaba496bb5bc86e69d134cd8790ec PKG_URL := https://github.com/PetteriAimonen/libfixmath PKG_LICENSE := MIT diff --git a/pkg/libfixmath/patches/0001-Fix-warnings.patch b/pkg/libfixmath/patches/0001-Fix-warnings.patch deleted file mode 100644 index f990c3d85447aa19430604350e4f1c4d80458c50..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3088 zcmbVOYj4{&6#ZNQ{SUVp)=04>Q<5$D5eFVt1Ov9B16uS;GZd6W*&Jla&?66|`R}`= zWIY@!aYq=EFE7s_d3Y~%uhV1;-psSdWM;X z5%)rVzoq$Rgm2UNp5>|G!wc;Pz!V195Z@&zc%0kT%V;G20Va_Ik^w1-nCCgm@@({2 z|1~zSylSmZZ+V`O0!%=p4Iz(M2L6V|YZeS)20YFfN}0r&I?zxe0s)Iy*`aF+q%5Xe z_CMxSXR}{5MG1Hqg08Q54s_I`p4a10I3Dgj5H|>?&e$-*iEYn_i;E=Acq|U2ms3H( zp_g~H0^K!-E)3)o&D(?rD2_PMJQ0VgRtDVCs9-}OSqc|k5e`wZ97Xc^mPQ#Wr0j9k zJH!B$3_gmQH$WWvsOTb6?lyP|pz;&wq_~pFxv#VTuB+s z-*cgkbS!~X3ln#D1$*b>wsvf0q@^KIrdTnJhm!C zjsT8obc{e?Wos!X>~f+*?S!Y^PURGlWSSEZO6BWkWy4td%2FOaV1UwGL}|)^XAmc_ zrm08Q3?dfhklbR3?W3y_NMs7UTf+GbIj^#yN-42a9)kLgX9pT$&+{~UHoRBC8h&&{ zD-{K0%JL$OtK1SB2&3e#6^u=|REgVnJJz3u&K0)rt?or@HYL=X8OC%naousydoR|w zXP08_5y$Eb#fL^d(JWn<(AA$PSzBt|$>Xmy((poqH#}6O1xrkC?Jf4asdOLBC=%*_78p%o8y-IS5im#HKqUWn5 zrzneoSw(53xrkNNyOWW15jCp+VWH(UR;zGnS6oWQw>+XL&mS>Y{Ftt diff --git a/pkg/libfixmath/patches/0002-Adapt-unittests-for-RIOT.patch b/pkg/libfixmath/patches/0002-Adapt-unittests-for-RIOT.patch deleted file mode 100644 index d85a42c465eeed523797aaf960446d82c808fc7b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8833 zcmds7ZExE+68^4VF?A3?T1$#3`7OyNmtfnV-Rm}oCfFX(EDYHa6Wz*EPLf*#x%~H= zA@y$APPgf9?~Im`C~`0Md6K7~M*FPMLC)^&| z)`(j}4}OUwxbp9Tjlr^x#6Petizyc<<_OM1f8|DA;=}pO^#UJ$bc-6(6*Xr;lmxEH zlT+oToB2oZ!S{5q$MCZop(L9DbB+d+BYOmWi&>U(wVeISpJzw#@gL{cKfMO~!2S)+ zJ@-C?WfWwYpJplWIDz+XF0U2EFbt)7alnHW8%_Py{j_Xs&H;b_0XBrb_+gjMUJG}g z#A%}=_Htye4SmuqX>^byZST{XnVg+-n9okm5lb;*Rn)&S3}*PD3pcwnDq(kGY(N~T zvjRilLFlJ2zjLEo0(~%sAWHot3*snM`nFgw= zy4vZ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eVv+V96HphInw9_-SKN8;FAy{&hbiFL=Y$1E z1;iL z`YSHqmHr+)gZ`q7zd(O&n^?9lFW(iW{b#@wW&9PGI*cL;TU@qa`W2iYz$p#(obM#>_-dF$ipNPs!5Upm*O z-`t?aHP6)LrG#q}2z{9vW0&n}TP!7}`S!@7f#S|ocCpwLh59Xro}7eN#( zmJ5udM0$>qynM7)JpYMp$D*}-4F)i+h&0zF8!cI_M{6~)%ib6b7mF5iYj*6stvM*7*^q{u)=ixHF!xIWRhtQ6@U-?NQUX|umTQ7V^#}}64e010` zTga1(BT-@7$IjsbdN7?{;CaS$3caHqTwTAn)#>!@n|D~F;oBbUt!Sz6tOLhiH_7d? z>2D0A_;;81=LoN#GKTziEX$KwR(|>;__!ao3njvs4Rt(ez_LP_1ea7I=4~S;mw#{J wQU6{s7c}=B2g-O1L`iaCZOuP}khyfDNyk=d<9#a+$F$4<#WwA+X(`Ho0V{%k;Q#;t From ea799e738d094b6257ace970fed56efeaca47654 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Fri, 20 Jan 2023 17:41:30 +0100 Subject: [PATCH 2/5] core/init: allow to run callback on main exit --- core/lib/init.c | 7 ++++++- makefiles/pseudomodules.inc.mk | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/lib/init.c b/core/lib/init.c index b20252945d..cdf7358a4e 100644 --- a/core/lib/init.c +++ b/core/lib/init.c @@ -60,7 +60,12 @@ static void *main_trampoline(void *arg) LOG_INFO(CONFIG_BOOT_MSG_STRING "\n"); } - main(); + int res = main(); + + if (IS_USED(MODULE_TEST_UTILS_MAIN_EXIT_CB)) { + void test_utils_main_exit_cb(int res); + test_utils_main_exit_cb(res); + } #ifdef MODULE_TEST_UTILS_PRINT_STACK_USAGE void print_stack_usage_metric(const char *name, void *stack, unsigned max_size); diff --git a/makefiles/pseudomodules.inc.mk b/makefiles/pseudomodules.inc.mk index 2516929079..17cb40b7de 100644 --- a/makefiles/pseudomodules.inc.mk +++ b/makefiles/pseudomodules.inc.mk @@ -581,6 +581,7 @@ PSEUDOMODULES += crypto_aes_unroll # declare shell version of test_utils_interactive_sync PSEUDOMODULES += test_utils_interactive_sync_shell +PSEUDOMODULES += test_utils_main_exit_cb # All auto_init modules are pseudomodules PSEUDOMODULES += auto_init_% From d102723bc99ffc09d8d963ae4bbbc74830b558cc Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Fri, 20 Jan 2023 17:42:54 +0100 Subject: [PATCH 3/5] tests/pkg_libfixmath_unittests: adapt test to upstream changes Let's no longer patch the upstream test but use it directly --- pkg/libfixmath/Makefile | 2 +- pkg/libfixmath/Makefile.include | 3 ++- tests/pkg_libfixmath_unittests/Makefile | 5 +++++ tests/pkg_libfixmath_unittests/main.c | 17 ++++++----------- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/pkg/libfixmath/Makefile b/pkg/libfixmath/Makefile index 3883ad93f8..bb7164d0fb 100644 --- a/pkg/libfixmath/Makefile +++ b/pkg/libfixmath/Makefile @@ -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 diff --git a/pkg/libfixmath/Makefile.include b/pkg/libfixmath/Makefile.include index c85b62aef4..c178d16777 100644 --- a/pkg/libfixmath/Makefile.include +++ b/pkg/libfixmath/Makefile.include @@ -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 diff --git a/tests/pkg_libfixmath_unittests/Makefile b/tests/pkg_libfixmath_unittests/Makefile index 0472e5e238..dfbe881e7a 100644 --- a/tests/pkg_libfixmath_unittests/Makefile +++ b/tests/pkg_libfixmath_unittests/Makefile @@ -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 diff --git a/tests/pkg_libfixmath_unittests/main.c b/tests/pkg_libfixmath_unittests/main.c index d401275d7f..032e70d132 100644 --- a/tests/pkg_libfixmath_unittests/main.c +++ b/tests/pkg_libfixmath_unittests/main.c @@ -29,17 +29,12 @@ */ #include -#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"); + } } From 7deb8eee1a823091a9f621ee6e7df2c051c2058d Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Sat, 21 Jan 2023 23:06:27 +0100 Subject: [PATCH 4/5] pkg/tinydtls: bump version --- pkg/tinydtls/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/tinydtls/Makefile b/pkg/tinydtls/Makefile index 621dbf9615..973f44dbc1 100644 --- a/pkg/tinydtls/Makefile +++ b/pkg/tinydtls/Makefile @@ -1,6 +1,6 @@ PKG_NAME=tinydtls PKG_URL=https://github.com/eclipse/tinydtls.git -PKG_VERSION=297fced854b652591b78113f0ba8d57ad9f934d9 +PKG_VERSION=c58f484ac417afe036273d65506b63a0902c740c PKG_LICENSE=EPL-1.0,EDL-1.0 include $(RIOTBASE)/pkg/pkg.mk From bb515ab51ef2a18c681c21edfa74d4fedfbfbd2e Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Sat, 21 Jan 2023 23:09:32 +0100 Subject: [PATCH 5/5] pkg/tinydtls: don't set custom log level tinyDTLS now uses RIOT's log.h --- pkg/tinydtls/Makefile.include | 6 ------ pkg/tinydtls/contrib/sock_dtls.c | 1 - 2 files changed, 7 deletions(-) diff --git a/pkg/tinydtls/Makefile.include b/pkg/tinydtls/Makefile.include index aebc670325..fda2825bd6 100644 --- a/pkg/tinydtls/Makefile.include +++ b/pkg/tinydtls/Makefile.include @@ -39,12 +39,6 @@ ifeq (,$(CONFIG_KCONFIG_USEPKG_TINYDTLS)) endif endif -ifneq (,$(or $(CONFIG_DTLS_DEBUG),$(filter -DCONFIG_DTLS_DEBUG,$(CFLAGS)))) - CFLAGS += -DTINYDTLS_LOG_LVL=6 -else - CFLAGS += -DTINYDTLS_LOG_LVL=0 -endif - # For now contrib only contains sock_dtls adaption ifneq (,$(filter tinydtls_sock_dtls,$(USEMODULE))) DIRS += $(RIOTBASE)/pkg/tinydtls/contrib diff --git a/pkg/tinydtls/contrib/sock_dtls.c b/pkg/tinydtls/contrib/sock_dtls.c index 124a0a07bd..cab2941557 100644 --- a/pkg/tinydtls/contrib/sock_dtls.c +++ b/pkg/tinydtls/contrib/sock_dtls.c @@ -887,7 +887,6 @@ void sock_dtls_close(sock_dtls_t *sock) void sock_dtls_init(void) { dtls_init(); - dtls_set_log_level(TINYDTLS_LOG_LVL); } static void _ep_to_session(const sock_udp_ep_t *ep, session_t *session)