aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2020-10-20 14:14:42 +0200
committerMarc André Tanner <mat@brain-dump.org>2020-10-20 14:14:42 +0200
commitc10d22e5b71273adb492ef220a779d7d4da7f751 (patch)
tree63171f9842ad30c516be5b806d3ad85b60720784
parent0f275a1e3123f6031548355af97e22e067abb4a1 (diff)
downloadvis-c10d22e5b71273adb492ef220a779d7d4da7f751.tar.gz
vis-c10d22e5b71273adb492ef220a779d7d4da7f751.tar.xz
test/core: add time(3) stub for tis-interpreter
Not sure why a deterministic stub implementation is not provided by the CI environment[1], even though the public tis-interpreter repositories contain relevant code[2,3]. [1] https://github.com/TrustInSoft-CI/TrustInSoft-CI/issues/12 [2] https://github.com/TrustInSoft/tis-kernel/blob/748d28baba90c03c0f5f4654d2e7bb47dfbe4e7d/share/tis-interpreter/common_time.c#L148 [3] https://github.com/TrustInSoft/tis-interpreter/blob/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/tis-interpreter/common_helpers/common_time.c#L138
-rw-r--r--core/tap.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/tap.h b/core/tap.h
index 2a16ef6..390eb6f 100644
--- a/core/tap.h
+++ b/core/tap.h
@@ -36,6 +36,15 @@ static int exit_status() {
} \
} while (0)
+#include <time.h>
+time_t time(time_t *p)
+{
+ static time_t value;
+ value++;
+ if (p) *p = value;
+ return value;
+}
+
#else
#include <ccan/tap/tap.h>
#define TIS_INTERPRETER 0