all repos — circe-vpn @ 556b655293e9ce71509a72ef3c98ea334b5aa85b

Circe VPN

Added unit testing framework
Juniper Beatitudes [email protected]
Sun, 19 Jul 2026 13:01:59 -0500
commit

556b655293e9ce71509a72ef3c98ea334b5aa85b

parent

3e21e8f4297b844167f8630fb88c4287e25c0008

4 files changed, 44 insertions(+), 2 deletions(-)

jump to
M .gitmodules.gitmodules

@@ -7,3 +7,6 @@ url = https://github.com/pq-code-package/mlkem-native.git

[submodule "subprojects/TinyCrypT"] path = subprojects/TinyCrypT url = https://gitea.eyes-like-fire.org/juniper/TinyCrypT.git +[submodule "subprojects/Unity"] + path = subprojects/Unity + url = https://github.com/ThrowTheSwitch/Unity.git
M flake.nixflake.nix

@@ -32,8 +32,10 @@ clang-tools

valgrind bear tokei + ruby ]; NIX_ENFORCE_NO_NATIVE = 0; + hardeningDisable = [ "fortify" ]; }; teiresia_shl = pkgs.mkShell { name = "circe-tooling-env-teiresia";
M meson.buildmeson.build

@@ -1,6 +1,6 @@

project('Circe', 'c', version: '0.1.0') -## EXTERNAL DEPENDENCIES +## TINYCRYPT tct_subproj = subproject('TinyCrypT') tct_dependency = tct_subproj.get_variable('TinyCrypT_dep')

@@ -65,6 +65,24 @@

core_dep = declare_dependency(include_directories: core_incdir, link_with: core_target) set_variable(meson.project_name() + '_core_dep', core_dep) +## UNITY TESTS + +unity_proj = subproject('Unity') +unity_dep = unity_proj.get_variable('unity_dep') +runner_gen = unity_proj.get_variable('gen_test_runner') + if not meson.is_subproject() and not meson.is_cross_build() - # Tests go here + example_test = meson.source_root() / 'test/test_example.c' + example_test_runner = runner_gen.process(example_test) + test( + 'example_tests', + executable( + 'example_tests', + [example_test_runner, example_test], + include_directories: [], + link_with: [], + dependencies: unity_dep, + install: false, + ), + ) endif
A test/test_example.c

@@ -0,0 +1,19 @@

+#include "unity.h" + +void +setUp (void) +{ + // set stuff up here +} + +void +tearDown (void) +{ + // clean stuff up here +} + +void +test_example (void) +{ + TEST_ASSERT (0 == 0); +}