diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-10-16 14:11:28 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-10-16 14:11:36 -0400 |
| commit | fb575049567ba037cf30f43d99a67fd1981b59a4 (patch) | |
| tree | 38d36f7541e576355f33b44c8f2677b42f4e2a9f /tests | |
| parent | 6d53452ebc24287a72eedb9a2cc3f9e21c55362c (diff) | |
pke-at-test: first-pass using pktst
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/pke-at-test-dummy.cpp | 42 | ||||
| -rw-r--r-- | tests/pke-at-test-dummy.h | 8 | ||||
| -rw-r--r-- | tests/pke-at-test-main.cpp | 18 |
3 files changed, 68 insertions, 0 deletions
diff --git a/tests/pke-at-test-dummy.cpp b/tests/pke-at-test-dummy.cpp new file mode 100644 index 0000000..341aba5 --- /dev/null +++ b/tests/pke-at-test-dummy.cpp @@ -0,0 +1,42 @@ + +#include "./pke-at-test-dummy.h" +#include "pke/pk.h" + +int dummy_test_001() { + PK_TEST_ASSERT_EQ_RET(14, 9 + 5); + return 0; +} + +int dummy_test_002() { + // PK_TEST_ASSERT_EQ_RET(15, 9 + 5); + PK_TEST_ASSERT_EQ_RET(14, 9 + 5); + return 0; +} + +struct pk_test_group *pke_at_test_get_dummy() { + static pk_test_group g{}; + + static const unsigned char n_tests = 2; + static pk_test tests[n_tests] = { + { + .title = "dummy_test_001", + .func = dummy_test_001, + .expected_result = 0, + }, + { + .title = "dummy_test_002", + .func = dummy_test_002, + .expected_result = 0, + }, + }; + + g.title = "dummy-tests"; + g.group_setup = nullptr; + g.group_teardown = nullptr; + g.test_setup = nullptr; + g.test_teardown = nullptr; + g.tests = tests; + g.n_tests = n_tests; + + return &g; +} diff --git a/tests/pke-at-test-dummy.h b/tests/pke-at-test-dummy.h new file mode 100644 index 0000000..ebd887d --- /dev/null +++ b/tests/pke-at-test-dummy.h @@ -0,0 +1,8 @@ +#ifndef PKE_AT_PKE_AT_TEST_DUMMY_H +#define PKE_AT_PKE_AT_TEST_DUMMY_H + +#include <pke/pk.h> + +struct pk_test_group *pke_at_test_get_dummy(); + +#endif /* PKE_AT_PKE_AT_TEST_DUMMY_H */ diff --git a/tests/pke-at-test-main.cpp b/tests/pke-at-test-main.cpp new file mode 100644 index 0000000..367bbf4 --- /dev/null +++ b/tests/pke-at-test-main.cpp @@ -0,0 +1,18 @@ + +#include "./pke-at-test-dummy.h" + +#include <pke/pk.h> + +int main(int argc, char *argv[]) +{ + (void)argc; + (void)argv; + + pk_test_group_get *fns[] = { + pke_at_test_get_dummy + }; + + pk_test_run_test_groups(fns, 1); + + return 0; +} |
