summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-10-16 13:56:39 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-10-16 13:56:39 -0400
commit1d0653a6e595ffb6816042de50eb5434a386d9d0 (patch)
treefef21d2cf5d623625a276b31faf9a4087ad824d4
parent77c8686edd087a605b69e71c51c9adfe5bd26720 (diff)
pke-test: refactor to use pktst
-rw-r--r--tests/pke-test-asset-manager.cpp10
-rw-r--r--tests/pke-test-asset-manager.h4
-rw-r--r--tests/pke-test-audio.cpp9
-rw-r--r--tests/pke-test-audio.h4
-rw-r--r--tests/pke-test-dummy.cpp9
-rw-r--r--tests/pke-test-dummy.h4
-rw-r--r--tests/pke-test-font.cpp10
-rw-r--r--tests/pke-test-font.hpp13
-rw-r--r--tests/pke-test-load-unload.cpp13
-rw-r--r--tests/pke-test-load-unload.h4
-rw-r--r--tests/pke-test-serialization.cpp10
-rw-r--r--tests/pke-test-serialization.h4
-rw-r--r--tests/pke-test-static-ui.cpp9
-rw-r--r--tests/pke-test-static-ui.h4
-rw-r--r--tests/pke-test-types.h35
-rw-r--r--tests/pke-test.cpp77
16 files changed, 72 insertions, 147 deletions
diff --git a/tests/pke-test-asset-manager.cpp b/tests/pke-test-asset-manager.cpp
index 55a368f..c553682 100644
--- a/tests/pke-test-asset-manager.cpp
+++ b/tests/pke-test-asset-manager.cpp
@@ -4,11 +4,13 @@
#include "asset-manager.hpp"
#include "ecs.hpp"
#include "font.hpp"
+#include "pke-test-stubs.h"
#include "thread-pool.hpp"
static pk_membucket *bkt;
void pke_test_asset_manager_spinup() {
+ pke_test_stub_init_vulkan();
bkt = pk_mem_bucket_create("pke_test_asset_manager", PK_MEM_DEFAULT_BUCKET_SIZE, PK_MEMBUCKET_FLAG_NONE);
pk_mem_bucket_set_client_mem_bucket(bkt);
pk_ev_init(nullptr);
@@ -27,6 +29,7 @@ void pke_test_asset_manager_teardown() {
pk_mem_bucket_destroy(bkt);
pk_mem_bucket_set_client_mem_bucket(nullptr);
bkt = nullptr;
+ pke_test_stub_teardown_vulkan();
};
int pke_test_asset_manager_001() {
@@ -36,21 +39,20 @@ int pke_test_asset_manager_001() {
return int(a != NULL && handle != AssetHandle_MAX);
}
-struct pke_test_group *pke_test_asset_manager_get_group() {
+struct pk_test_group *pke_test_asset_manager_get_group() {
static const uint64_t test_count = 1;
- static struct pke_test tests[test_count] = {
+ static struct pk_test tests[test_count] = {
{
.title = "test 001",
.func = pke_test_asset_manager_001,
.expected_result = 1,
}
};
- static struct pke_test_group group = {};
+ static struct pk_test_group group = {};
group.title = "asset_manager";
group.n_tests = test_count;
group.tests = &tests[0];
group.test_setup = pke_test_asset_manager_spinup;
group.test_teardown = pke_test_asset_manager_teardown;
-
return &group;
}
diff --git a/tests/pke-test-asset-manager.h b/tests/pke-test-asset-manager.h
index 802b67f..3e8b288 100644
--- a/tests/pke-test-asset-manager.h
+++ b/tests/pke-test-asset-manager.h
@@ -1,13 +1,13 @@
#ifndef PKE_PKE_TEST_ASSET_MANAGER_H
#define PKE_PKE_TEST_ASSET_MANAGER_H
-#include "pke-test-types.h"
+#include "pk.h"
#ifdef __cplusplus
extern "C" {
#endif
-struct pke_test_group *pke_test_asset_manager_get_group();
+struct pk_test_group *pke_test_asset_manager_get_group();
#ifdef __cplusplus
}
diff --git a/tests/pke-test-audio.cpp b/tests/pke-test-audio.cpp
index 488a67c..e594f9e 100644
--- a/tests/pke-test-audio.cpp
+++ b/tests/pke-test-audio.cpp
@@ -10,6 +10,7 @@
#include "audio-types.hpp"
#include "audio.hpp"
#include "asset-manager.hpp"
+#include "pke-test-stubs.h"
#include "thread-pool.hpp"
#include "window.hpp"
@@ -22,6 +23,7 @@ static pk_membucket *bkt = nullptr;
#define PKE_TEST_AUDIO_SLEEP_DUR_NS 10
void pke_test_audio_spinup() {
+ pke_test_stub_init_vulkan();
// pk_funcinstr_init();
pkeSettings.isSimulationPaused = true;
bkt = pk_mem_bucket_create("pke_test_audio", PK_MEM_DEFAULT_BUCKET_SIZE, PK_MEMBUCKET_FLAG_NONE);
@@ -48,6 +50,7 @@ void pke_test_audio_teardown() {
pk_mem_bucket_set_client_mem_bucket(nullptr);
bkt = nullptr;
// pk_funcinstr_teardown();
+ pke_test_stub_teardown_vulkan();
};
@@ -196,9 +199,9 @@ int pke_test_audio_003() {
return 0;
}
-struct pke_test_group *pke_test_audio_get_group() {
+struct pk_test_group *pke_test_audio_get_group() {
static const uint64_t test_count = 3;
- static struct pke_test tests[test_count] = {
+ static struct pk_test tests[test_count] = {
{
.title = "test 001",
.func = pke_test_audio_001,
@@ -215,7 +218,7 @@ struct pke_test_group *pke_test_audio_get_group() {
.expected_result = 0,
},
};
- static struct pke_test_group group = {};
+ static struct pk_test_group group = {};
group.title = "audio";
group.group_setup = nullptr;
group.group_teardown = nullptr;
diff --git a/tests/pke-test-audio.h b/tests/pke-test-audio.h
index 851c695..fa48e7d 100644
--- a/tests/pke-test-audio.h
+++ b/tests/pke-test-audio.h
@@ -1,13 +1,13 @@
#ifndef PKE_PKE_TEST_AUDIO_H
#define PKE_PKE_TEST_AUDIO_H
-#include "pke-test-types.h"
+#include "pk.h"
#ifdef __cplusplus
extern "C" {
#endif
-struct pke_test_group *pke_test_audio_get_group();
+struct pk_test_group *pke_test_audio_get_group();
#ifdef __cplusplus
}
diff --git a/tests/pke-test-dummy.cpp b/tests/pke-test-dummy.cpp
index 914f3cf..be05ba8 100644
--- a/tests/pke-test-dummy.cpp
+++ b/tests/pke-test-dummy.cpp
@@ -6,6 +6,7 @@
#include "ecs.hpp"
#include "physics.hpp"
#include "pk.h"
+#include "pke-test-stubs.h"
#include "player-input.hpp"
#include "scene.hpp"
#include "static-ui.hpp"
@@ -14,6 +15,7 @@
static pk_membucket *bkt;
int pke_test_dummy_001() {
+ pke_test_stub_init_vulkan();
bkt = pk_mem_bucket_create("pke_test_dummy", PK_MEM_DEFAULT_BUCKET_SIZE, PK_MEMBUCKET_FLAG_NONE);
pk_mem_bucket_set_client_mem_bucket(bkt);
pk_ev_init(bkt);
@@ -47,12 +49,13 @@ int pke_test_dummy_001() {
pk_mem_bucket_destroy(bkt);
pk_mem_bucket_set_client_mem_bucket(nullptr);
bkt = nullptr;
+ pke_test_stub_teardown_vulkan();
return 0;
}
-struct pke_test_group *pke_test_dummy_get_group() {
+struct pk_test_group *pke_test_dummy_get_group() {
static const uint64_t test_count = 2;
- static struct pke_test tests[test_count] = {
+ static struct pk_test tests[test_count] = {
{
.title = "test 001",
.func = pke_test_dummy_001,
@@ -64,7 +67,7 @@ struct pke_test_group *pke_test_dummy_get_group() {
.expected_result = 0,
},
};
- static struct pke_test_group group = {};
+ static struct pk_test_group group = {};
group.title = "dummy test";
group.n_tests = test_count;
group.tests = &tests[0];
diff --git a/tests/pke-test-dummy.h b/tests/pke-test-dummy.h
index 6abf8b7..64b5921 100644
--- a/tests/pke-test-dummy.h
+++ b/tests/pke-test-dummy.h
@@ -1,13 +1,13 @@
#ifndef PKE_PKE_TEST_DUMMY_H
#define PKE_PKE_TEST_DUMMY_H
-#include "pke-test-types.h"
+#include "pk.h"
#ifdef __cplusplus
extern "C" {
#endif
-struct pke_test_group *pke_test_dummy_get_group();
+struct pk_test_group *pke_test_dummy_get_group();
#ifdef __cplusplus
}
diff --git a/tests/pke-test-font.cpp b/tests/pke-test-font.cpp
index 856dbdb..a766f26 100644
--- a/tests/pke-test-font.cpp
+++ b/tests/pke-test-font.cpp
@@ -5,11 +5,14 @@
#include "ecs.hpp"
#include "font.hpp"
#include "pk.h"
+#include "pke-test-stubs.h"
+#include "pke-test-types.h"
#include "thread-pool.hpp"
static pk_membucket *bkt;
void pke_test_font_setup() {
+ pke_test_stub_init_vulkan();
bkt = pk_mem_bucket_create("pke_test_font", PK_MEM_DEFAULT_BUCKET_SIZE, PK_MEMBUCKET_FLAG_NONE);
pk_mem_bucket_set_client_mem_bucket(bkt);
pk_ev_init(bkt);
@@ -28,6 +31,7 @@ void pke_test_font_teardown() {
pk_mem_bucket_destroy(bkt);
pk_mem_bucket_set_client_mem_bucket(nullptr);
bkt = nullptr;
+ pke_test_stub_teardown_vulkan();
}
/* Ensure the font exists
@@ -64,9 +68,9 @@ int pke_test_font_002() {
return 0;
}
-struct pke_test_group *pke_test_font_get_group() {
+struct pk_test_group *pke_test_font_get_group() {
static const uint64_t test_count = 2;
- static struct pke_test tests[test_count] = {
+ static struct pk_test tests[test_count] = {
{
.title = "test 001",
.func = pke_test_font_001,
@@ -78,7 +82,7 @@ struct pke_test_group *pke_test_font_get_group() {
.expected_result = 0,
},
};
- static struct pke_test_group group = {};
+ static struct pk_test_group group = {};
group.title = "font test";
group.test_setup = pke_test_font_setup;
group.test_teardown = pke_test_font_teardown;
diff --git a/tests/pke-test-font.hpp b/tests/pke-test-font.hpp
index 19b2ddd..e1d7776 100644
--- a/tests/pke-test-font.hpp
+++ b/tests/pke-test-font.hpp
@@ -1,8 +1,17 @@
#ifndef PKE_PKE_TEST_FONT_HPP
#define PKE_PKE_TEST_FONT_HPP
-#include "pke-test-types.h"
+#include "pk.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct pk_test_group *pke_test_font_get_group();
+
+#ifdef __cplusplus
+}
+#endif
-struct pke_test_group *pke_test_font_get_group();
#endif /* PKE_PKE_TEST_FONT_HPP */
diff --git a/tests/pke-test-load-unload.cpp b/tests/pke-test-load-unload.cpp
index 6f7fd66..e421aee 100644
--- a/tests/pke-test-load-unload.cpp
+++ b/tests/pke-test-load-unload.cpp
@@ -10,14 +10,13 @@
#include "game.hpp"
#include "level.hpp"
#include "physics.hpp"
-#include "pk.h"
+#include "pke-test-stubs.h"
+#include "pke-test-types.h"
#include "player-input.hpp"
#include "scene.hpp"
#include "static-ui.hpp"
#include "thread-pool.hpp"
-#include "pk.h"
-
extern pk_arr_t<Entity_Base*> entitiesMarkedForRemoval;
extern pk_arr_t<EntityHandle> entitiesYetToBeRemoved;
@@ -210,6 +209,7 @@ int pke_test_load_unload_do_thing_002(int iteration) {
}
void pke_test_load_unload_init() {
+ pke_test_stub_init_vulkan();
bkt = pk_mem_bucket_create("pke_test_load_unload", PK_MEM_DEFAULT_BUCKET_SIZE, PK_MEMBUCKET_FLAG_NONE);
pk_mem_bucket_set_client_mem_bucket(bkt);
pkeSettings.mem_bkt.game = bkt;
@@ -252,6 +252,7 @@ void pke_test_load_unload_teardown() {
pkeSettings.rt.activeLevel = nullptr;
pkeSettings.rt.nextLevel = nullptr;
pkeSettings.rt.previousLevel = nullptr;
+ pke_test_stub_teardown_vulkan();
}
int pke_test_load_unload_001() {
@@ -274,11 +275,11 @@ int pke_test_load_unload_002() {
return 0;
}
-struct pke_test_group *
+struct pk_test_group *
pke_test_load_unload_get_group()
{
static const uint64_t test_count = 2;
- static struct pke_test tests[test_count] = {
+ static struct pk_test tests[test_count] = {
{
.title = "test 001",
.func = pke_test_load_unload_001,
@@ -290,7 +291,7 @@ pke_test_load_unload_get_group()
.expected_result = 0,
},
};
- static struct pke_test_group group{};
+ static struct pk_test_group group{};
group.title = "load-unload";
group.group_setup = nullptr;
group.group_teardown = nullptr;
diff --git a/tests/pke-test-load-unload.h b/tests/pke-test-load-unload.h
index be28f0f..1e7ce46 100644
--- a/tests/pke-test-load-unload.h
+++ b/tests/pke-test-load-unload.h
@@ -1,13 +1,13 @@
#ifndef PKE_PKE_TEST_LOAD_UNLOAD_H
#define PKE_PKE_TEST_LOAD_UNLOAD_H
-#include "pke-test-types.h"
+#include "pk.h"
#ifdef __cplusplus
extern "C" {
#endif
-struct pke_test_group *pke_test_load_unload_get_group();
+struct pk_test_group *pke_test_load_unload_get_group();
#ifdef __cplusplus
}
diff --git a/tests/pke-test-serialization.cpp b/tests/pke-test-serialization.cpp
index 3c77ff9..e1fda74 100644
--- a/tests/pke-test-serialization.cpp
+++ b/tests/pke-test-serialization.cpp
@@ -9,6 +9,8 @@
#include "level.hpp"
#include "physics.hpp"
#include "pk.h"
+#include "pke-test-stubs.h"
+#include "pke-test-types.h"
#include "scene.hpp"
#include "serialization-component.hpp"
#include "serialization.hpp"
@@ -47,6 +49,7 @@ const pk_uuid uuid_n[] = {
// const pk_uuid uuid_34 = FAKE_UUID_GEN(0x22);
void pke_test_serialization_spinup() {
+ pke_test_stub_init_vulkan();
// pk_funcinstr_init();
bkt = pk_mem_bucket_create("pke_test_serialization", PK_MEM_DEFAULT_BUCKET_SIZE, PK_MEMBUCKET_FLAG_NONE);
pk_mem_bucket_set_client_mem_bucket(bkt);
@@ -85,6 +88,7 @@ void pke_test_serialization_teardown() {
pk_mem_bucket_set_client_mem_bucket(nullptr);
bkt = nullptr;
// pk_funcinstr_teardown();
+ pke_test_stub_teardown_vulkan();
};
int pke_test_serialization_999() {
@@ -881,9 +885,9 @@ int pke_test_deserialization_105() {
return 0;
}
-struct pke_test_group *pke_test_serialization_get_group() {
+struct pk_test_group *pke_test_serialization_get_group() {
static const uint64_t test_count = 11;
- static struct pke_test tests[test_count] = {
+ static struct pk_test tests[test_count] = {
{
.title = "test 999",
.func = pke_test_serialization_999,
@@ -940,7 +944,7 @@ struct pke_test_group *pke_test_serialization_get_group() {
.expected_result = 0,
},
};
- static struct pke_test_group group = {};
+ static struct pk_test_group group = {};
group.title = "de/serialization";
group.group_setup = nullptr;
group.group_teardown = nullptr;
diff --git a/tests/pke-test-serialization.h b/tests/pke-test-serialization.h
index 0d4aa2b..af7926e 100644
--- a/tests/pke-test-serialization.h
+++ b/tests/pke-test-serialization.h
@@ -1,13 +1,13 @@
#ifndef PKE_PKE_TEST_SERIALIZATION_H
#define PKE_PKE_TEST_SERIALIZATION_H
-#include "pke-test-types.h"
+#include "pk.h"
#ifdef __cplusplus
extern "C" {
#endif
-struct pke_test_group *pke_test_serialization_get_group();
+struct pk_test_group *pke_test_serialization_get_group();
#ifdef __cplusplus
}
diff --git a/tests/pke-test-static-ui.cpp b/tests/pke-test-static-ui.cpp
index c102aba..aa989cc 100644
--- a/tests/pke-test-static-ui.cpp
+++ b/tests/pke-test-static-ui.cpp
@@ -4,6 +4,7 @@
#include "./pke-test-types.h"
#include "ecs.hpp"
+#include "pke-test-stubs.h"
#include "player-input.hpp"
#include "window.hpp"
#include "vendor-glm-include.hpp"
@@ -26,6 +27,7 @@ struct pke_ui_flex_params {
static pk_membucket *bkt;
void pke_test_static_ui_setup() {
+ pke_test_stub_init_vulkan();
bkt = pk_mem_bucket_create("pke_test_static_ui", PK_MEM_DEFAULT_BUCKET_SIZE, PK_MEMBUCKET_FLAG_NONE);
pk_mem_bucket_set_client_mem_bucket(bkt);
Extent.width = 1920;
@@ -44,6 +46,7 @@ void pke_test_static_ui_teardown() {
pk_mem_bucket_destroy(bkt);
pk_mem_bucket_set_client_mem_bucket(nullptr);
bkt = nullptr;
+ pke_test_stub_teardown_vulkan();
}
// test static
@@ -203,9 +206,9 @@ int pke_test_static_ui_200() {
return 0;
}
-pke_test_group *pke_test_static_ui_get_group() {
+pk_test_group *pke_test_static_ui_get_group() {
static const uint64_t test_count = 3;
- static struct pke_test tests[test_count] = {
+ static struct pk_test tests[test_count] = {
{
.title = "test 000",
.func = pke_test_static_ui_000,
@@ -222,7 +225,7 @@ pke_test_group *pke_test_static_ui_get_group() {
.expected_result = 0,
},
};
- static struct pke_test_group group = {};
+ static struct pk_test_group group = {};
group.title = "static_ui";
group.group_setup = NULL;
group.group_teardown = NULL;
diff --git a/tests/pke-test-static-ui.h b/tests/pke-test-static-ui.h
index 673adf8..2da27a6 100644
--- a/tests/pke-test-static-ui.h
+++ b/tests/pke-test-static-ui.h
@@ -1,13 +1,13 @@
#ifndef PKE_PKE_TEST_STATIC_UI_H
#define PKE_PKE_TEST_STATIC_UI_H
-#include "pke-test-types.h"
+#include "pk.h"
#ifdef __cplusplus
extern "C" {
#endif
-struct pke_test_group *pke_test_static_ui_get_group();
+struct pk_test_group *pke_test_static_ui_get_group();
#ifdef __cplusplus
}
diff --git a/tests/pke-test-types.h b/tests/pke-test-types.h
index 5a9ee24..a71e78b 100644
--- a/tests/pke-test-types.h
+++ b/tests/pke-test-types.h
@@ -1,41 +1,6 @@
#ifndef PKE_PKE_TEST_TYPES_H
#define PKE_PKE_TEST_TYPES_H
-#include <setjmp.h>
-#include <stdint.h>
-
-struct pke_test_long_jump {
- uint8_t expected_exit;
- uint8_t caught;
- jmp_buf jump_env;
-};
-extern struct pke_test_long_jump lj;
-
-typedef int (pke_test_func)();
-struct pke_test_group;
-typedef struct pke_test_group *(pke_test_get_group)();
-
-typedef void (pke_test_group_setup());
-typedef void (pke_test_group_teardown());
-typedef void (pke_test_setup());
-typedef void (pke_test_teardown());
-
-struct pke_test {
- const char *title;
- pke_test_func *func;
- int expected_result;
-};
-
-struct pke_test_group {
- const char *title;
- pke_test_group_setup *group_setup;
- pke_test_group_teardown *group_teardown;
- pke_test_setup *test_setup;
- pke_test_teardown *test_teardown;
- struct pke_test *tests;
- uint32_t n_tests;
-};
-
#define PKE_TEST_ASSERT(condition, index) if (!(condition)) { return ++index; } else { ++index; }
#endif /* PKE_PKE_TEST_TYPES_H */
diff --git a/tests/pke-test.cpp b/tests/pke-test.cpp
index 7a314b5..b7a45aa 100644
--- a/tests/pke-test.cpp
+++ b/tests/pke-test.cpp
@@ -11,37 +11,16 @@
#include "./pke-test-stubs.h"
#include "pk.h"
-#include "unistd.h"
-#include <stdio.h>
-#define CLR_WHITE "\033[0m"
-#define CLR_GREEN "\033[92m"
-#define CLR_RED "\033[31m"
-
-// https://stackoverflow.com/questions/64190847/how-to-catch-a-call-to-exit-for-unit-testing
-struct pke_test_long_jump lj;
-void exit(int code) {
- if (lj.expected_exit) {
- lj.caught = 1;
- longjmp(lj.jump_env, 1);
- }
- _exit(code);
-}
+#include <unistd.h>
int main(int argc, char *argv[])
{
(void)argc;
(void)argv;
- int i = 0;
- int result;
- uint32_t k, pass_count, test_group_count, test_group_pass_count;
- double elapsed_ms;
- double group_ms;
- double total_ms;
- pk_tmr func_tmr;
- pk_tmr total_tmr;
- pke_test_get_group *group_fns[] = {
+ const unsigned long test_group_count = 6;
+ pk_test_group_get *group_fns[test_group_count] = {
pke_test_dummy_get_group,
pke_test_static_ui_get_group,
pke_test_serialization_get_group,
@@ -49,57 +28,9 @@ int main(int argc, char *argv[])
pke_test_load_unload_get_group,
pke_test_font_get_group,
// pke_test_audio_get_group,
- NULL,
};
- total_ms = 0;
- test_group_count = 0;
- test_group_pass_count = 0;
- pk_tmr_start(total_tmr);
- fprintf(stdout, "\r\n");
- pke_test_get_group *fn = group_fns[i];
- while (fn != NULL) {
- test_group_count += 1;
- pass_count = 0;
- group_ms = 0;
- struct pke_test_group *group = (fn)();
- fprintf(stdout, "[pke-test]:[%s] Begin.\n", group->title);
- if (group->group_setup != NULL) (group->group_setup)();
- for (k = 0; k < group->n_tests; ++k) {
- pke_test_stub_init_vulkan();
- if (group->test_setup != NULL) (group->test_setup)();
- lj.expected_exit = 0;
- lj.caught = 0;
- pk_tmr_start(func_tmr);
- result = (group->tests[k].func)();
- pk_tmr_stop(func_tmr);
- elapsed_ms = pk_tmr_duration_dbl_mili(func_tmr);
- group_ms += elapsed_ms;
- total_ms += elapsed_ms;
- if (result == group->tests[k].expected_result){
- pass_count += 1;
- fprintf(stdout, "[pke-test]:[%s]:[%s] %sPassed.%s\n", group->title, group->tests[k].title, CLR_GREEN, CLR_WHITE);
- fprintf(stdout, "[pke-test]:[%s]:[%s] Elapsed ms: '%f'.\n", group->title, group->tests[k].title, elapsed_ms);
- } else {
- fprintf(stdout, "[pke-test]:[%s]:[%s] %sFailed.%s Expected: '%i' Got: '%i'.\n", group->title, group->tests[k].title, CLR_RED, CLR_WHITE, group->tests[k].expected_result, result);
- }
- if (group->test_teardown != NULL) (group->test_teardown)();
- pke_test_stub_teardown_vulkan();
- }
- if (group->group_teardown != NULL) (group->group_teardown)();
- fprintf(stdout, "[pke-test]:[%s] End. ( %s%03d%s / %03d ) Tests Completed.\n", group->title, pass_count == group->n_tests ? CLR_GREEN : CLR_RED, pass_count, CLR_WHITE, group->n_tests);
- fprintf(stdout, "[pke-test]:[%s] End. Elapsed ms: '%f'.\n\n", group->title, group_ms);
- if (pass_count == group->n_tests) {
- test_group_pass_count += 1;
- }
- i += 1;
- fn = group_fns[i];
- }
- pk_tmr_stop(total_tmr);
-
- fprintf(stdout, "[pke-test] End. ( %s%03d%s / %03d ) Test Groups Completed.\n", test_group_count == test_group_pass_count ? CLR_GREEN : CLR_RED, test_group_pass_count, CLR_WHITE, test_group_count);
- fprintf(stdout, "[pke-test] End. Elapsed ms: '%f' (test fn sum).\n", total_ms);
- fprintf(stdout, "[pke-test] End. Elapsed ms: '%f' (actual).\n\n", pk_tmr_duration_dbl_mili(total_tmr));
+ pk_test_run_test_groups(group_fns, test_group_count);
return 0;
}