diff options
| author | physick <mynameisgennadiy@vk.com> | 2026-07-31 15:21:45 +0500 |
|---|---|---|
| committer | physick <mynameisgennadiy@vk.com> | 2026-07-31 15:21:45 +0500 |
| commit | e20b4c3a5dfe081fa2d6d772617307fae4689698 (patch) | |
| tree | 95f0ce8a7ccd1398a45ff24b2e528924bccc357c /src/puzzles/puzzle.h | |
| parent | d56f4859c06d184f294cf4d73e7c1068db245809 (diff) | |
More desriptive output
Diffstat (limited to 'src/puzzles/puzzle.h')
| -rw-r--r-- | src/puzzles/puzzle.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/puzzles/puzzle.h b/src/puzzles/puzzle.h index 4dfd0f8..e7aebb1 100644 --- a/src/puzzles/puzzle.h +++ b/src/puzzles/puzzle.h @@ -25,11 +25,26 @@ typedef struct { PuzzleIO ExpectedResult; } Test; +enum PUZZLE_TEST_RESULT { + RESULT_OK = 0, + RESULT_WRONG_ANSWER, + RESULT_COMPTIME_NO_ENTRY, + RESULT_COMPTIME_ERR, + RESULT_RUNTIME_ERR, + // TODO: add async evaluation to prevent `while (true)` situation + RESULT_TIMEOUT, + RESULT_INIT_ERROR, +}; + +typedef struct { + enum PUZZLE_TEST_RESULT res; + char *message; +} TestResult; /// The user submitted code should be evaluated by this point. /// The entry point should be registered and the absence of the /// Main method signatire will be concidered an error -enum PUZZLE_TEST_RESULT RunTest(Test *test, WrenVM *vm, size_t max_op); +TestResult RunTest(Test *test, WrenVM *vm, size_t max_op); typedef struct { char *Name; |
