From 626b8ffc5c85165ea830adee6bd522ebea7c3611 Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Wed, 21 Aug 2024 07:33:17 -0500 Subject: [PATCH] add web test runners (experimental) --- c/src/include/utils.h | 3 +- cplusplus/src/include/utils.hpp | 3 +- docs/_static/test-c.html | 64 +++++++++++++++++++++++++++++++++ docs/_static/test-cp.html | 64 +++++++++++++++++++++++++++++++++ 4 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 docs/_static/test-c.html create mode 100644 docs/_static/test-cp.html diff --git a/c/src/include/utils.h b/c/src/include/utils.h index 6c7dac1b..fcebffb0 100644 --- a/c/src/include/utils.h +++ b/c/src/include/utils.h @@ -4,6 +4,7 @@ #include #include #include +#include "macros.h" #ifdef _WIN32 #include #include @@ -131,7 +132,7 @@ typedef struct { AnswerType type; } Answer; -Answer get_answer(uint16_t id) { +Answer EMSCRIPTEN_KEEPALIVE get_answer(uint16_t id) { Answer ret = { .id = id, }; diff --git a/cplusplus/src/include/utils.hpp b/cplusplus/src/include/utils.hpp index f9da7791..3598076f 100644 --- a/cplusplus/src/include/utils.hpp +++ b/cplusplus/src/include/utils.hpp @@ -9,6 +9,7 @@ #include #include #include +#include "macros.h" #ifdef _WIN32 #include @@ -100,7 +101,7 @@ typedef struct { AnswerType type; } Answer; -Answer get_answer(const uint16_t id) { +Answer EMSCRIPTEN_KEEPALIVE get_answer(const uint16_t id) { Answer answer; char c_id[6]; snprintf(c_id, sizeof(c_id), "%" PRIu16, id); diff --git a/docs/_static/test-c.html b/docs/_static/test-c.html new file mode 100644 index 00000000..f6d63bc9 --- /dev/null +++ b/docs/_static/test-c.html @@ -0,0 +1,64 @@ + + + + + C Tests (Packaged with emscripten) + + + + + +
+ + + + diff --git a/docs/_static/test-cp.html b/docs/_static/test-cp.html new file mode 100644 index 00000000..ce8fe5f4 --- /dev/null +++ b/docs/_static/test-cp.html @@ -0,0 +1,64 @@ + + + + + C++ Tests (Packaged with emscripten) + + + + + +
+ + + +