From 10c69b0ddc34a1fafada3f8b68a622b4aa2bea77 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 23 May 2026 02:18:41 +0530 Subject: chore: fix unit test build rules, add relay_selector+relay_validator tests, persist core extraction plan --- tests/unit/Makefile | 8 +++++++- tests/unit/stubs/freertos/FreeRTOS.h | 1 + tests/unit/test_beacon_price | Bin 35744 -> 0 bytes tests/unit/test_display | Bin 24816 -> 0 bytes tests/unit/test_firewall_sandbox | Bin 30568 -> 0 bytes tests/unit/test_market | Bin 49456 -> 0 bytes tests/unit/test_mining_payment | Bin 28664 -> 0 bytes tests/unit/test_negentropy_adapter | Bin 21216 -> 0 bytes tests/unit/test_session_payment_method | Bin 54680 -> 0 bytes tests/unit/test_stratum_proxy | Bin 40784 -> 0 bytes tests/unit/test_tollgate_client_mining | Bin 48448 -> 0 bytes 11 files changed, 8 insertions(+), 1 deletion(-) delete mode 100755 tests/unit/test_beacon_price delete mode 100755 tests/unit/test_display delete mode 100755 tests/unit/test_firewall_sandbox delete mode 100755 tests/unit/test_market delete mode 100755 tests/unit/test_mining_payment delete mode 100755 tests/unit/test_negentropy_adapter delete mode 100755 tests/unit/test_session_payment_method delete mode 100755 tests/unit/test_stratum_proxy delete mode 100755 tests/unit/test_tollgate_client_mining (limited to 'tests') diff --git a/tests/unit/Makefile b/tests/unit/Makefile index b0b6922..cb06472 100644 --- a/tests/unit/Makefile +++ b/tests/unit/Makefile @@ -22,7 +22,7 @@ LDFLAGS := -lmbedcrypto -lcjson -lm SECP256K1_OBJ := secp256k1.o precomputed_ecmult.o precomputed_ecmult_gen.o -TESTS := test_geohash test_identity test_nostr_event test_cashu test_session test_tollgate_client test_lnurl_pay test_lightning_payout test_mcp_handler test_nip04 test_cvm_server test_display test_negentropy_adapter test_beacon_price test_market test_mint_health test_mining_payment test_stratum_proxy test_session_payment_method test_tollgate_client_mining test_firewall_sandbox +TESTS := test_geohash test_identity test_nostr_event test_cashu test_session test_tollgate_client test_lnurl_pay test_lightning_payout test_mcp_handler test_nip04 test_cvm_server test_beacon_price test_market test_mint_health test_mining_payment test_stratum_proxy test_session_payment_method test_tollgate_client_mining test_firewall_sandbox test_relay_selector test_relay_validator .PHONY: all test clean $(TESTS) @@ -105,5 +105,11 @@ test_tollgate_client_mining: test_tollgate_client_mining.c test_firewall_sandbox: test_firewall_sandbox.c $(REPO_ROOT)/main/firewall.c $(CC) $(CFLAGS) -include stubs/dns_server.h $< $(REPO_ROOT)/main/firewall.c -o $@ $(LDFLAGS) +test_relay_selector: test_relay_selector.c + $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) + +test_relay_validator: test_relay_validator.c $(REPO_ROOT)/main/nostr_event.c $(REPO_ROOT)/main/identity.c $(REPO_ROOT)/components/wisp_relay/relay_validator.c $(SECP256K1_OBJ) + $(CC) $(CFLAGS) -I $(SECP256K1_PRIV_INC) -I $(REPO_ROOT)/main -I $(REPO_ROOT)/components/wisp_relay $< $(REPO_ROOT)/main/nostr_event.c $(REPO_ROOT)/main/identity.c $(REPO_ROOT)/components/wisp_relay/relay_validator.c $(SECP256K1_OBJ) -o $@ $(LDFLAGS) + clean: rm -f $(TESTS) $(SECP256K1_OBJ) diff --git a/tests/unit/stubs/freertos/FreeRTOS.h b/tests/unit/stubs/freertos/FreeRTOS.h index 543d4e4..fc38846 100644 --- a/tests/unit/stubs/freertos/FreeRTOS.h +++ b/tests/unit/stubs/freertos/FreeRTOS.h @@ -11,6 +11,7 @@ static inline uint32_t xTaskGetTickCount(void) { return 0; } static inline void vTaskDelay(uint32_t ticks) { (void)ticks; } #define pdMS_TO_TICKS(ms) ((ms) / 10) #define portTICK_PERIOD_MS 10 +#define configTICK_RATE_HZ 100 #define portMAX_DELAY 0xFFFFFFFF #define pdTRUE 1 #define pdFALSE 0 diff --git a/tests/unit/test_beacon_price b/tests/unit/test_beacon_price deleted file mode 100755 index a9f6357..0000000 Binary files a/tests/unit/test_beacon_price and /dev/null differ diff --git a/tests/unit/test_display b/tests/unit/test_display deleted file mode 100755 index 9b8364e..0000000 Binary files a/tests/unit/test_display and /dev/null differ diff --git a/tests/unit/test_firewall_sandbox b/tests/unit/test_firewall_sandbox deleted file mode 100755 index 3e2895b..0000000 Binary files a/tests/unit/test_firewall_sandbox and /dev/null differ diff --git a/tests/unit/test_market b/tests/unit/test_market deleted file mode 100755 index 8efac8e..0000000 Binary files a/tests/unit/test_market and /dev/null differ diff --git a/tests/unit/test_mining_payment b/tests/unit/test_mining_payment deleted file mode 100755 index d38bf9d..0000000 Binary files a/tests/unit/test_mining_payment and /dev/null differ diff --git a/tests/unit/test_negentropy_adapter b/tests/unit/test_negentropy_adapter deleted file mode 100755 index 64b6053..0000000 Binary files a/tests/unit/test_negentropy_adapter and /dev/null differ diff --git a/tests/unit/test_session_payment_method b/tests/unit/test_session_payment_method deleted file mode 100755 index 950a72f..0000000 Binary files a/tests/unit/test_session_payment_method and /dev/null differ diff --git a/tests/unit/test_stratum_proxy b/tests/unit/test_stratum_proxy deleted file mode 100755 index 963df67..0000000 Binary files a/tests/unit/test_stratum_proxy and /dev/null differ diff --git a/tests/unit/test_tollgate_client_mining b/tests/unit/test_tollgate_client_mining deleted file mode 100755 index d331bd1..0000000 Binary files a/tests/unit/test_tollgate_client_mining and /dev/null differ -- cgit v1.2.3