Skip to content

Commit

Permalink
Merge pull request #214 from jow-/ucode-test-runner
Browse files Browse the repository at this point in the history
tests: replace test runner shell script with ucode implementation
  • Loading branch information
jow- authored Jul 29, 2024
2 parents b391fd7 + fbabec4 commit 26d7292
Show file tree
Hide file tree
Showing 4 changed files with 264 additions and 242 deletions.
8 changes: 8 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,14 @@ read_stdin(void)

stdin_unused = NULL;

/* On empty stdin, provide a dummy buffer and ensure that it is
* at least one byte long, due to
* https://github.com/google/sanitizers/issues/627 */
if (p == NULL) {
p = xstrdup("\n");
tlen = 1;
}

return uc_source_new_buffer("[stdin]", p, tlen);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/custom/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ADD_TEST(
NAME custom
COMMAND run_tests.sh
COMMAND $<TARGET_FILE:ucode> -L $<TARGET_FILE_DIR:fs_lib>/*.so -S run_tests.uc
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
SET_PROPERTY(TEST custom APPEND PROPERTY ENVIRONMENT
Expand All @@ -11,7 +11,7 @@ SET_PROPERTY(TEST custom APPEND PROPERTY ENVIRONMENT
IF(CMAKE_C_COMPILER_ID STREQUAL "Clang")
ADD_TEST(
NAME custom-san
COMMAND run_tests.sh
COMMAND $<TARGET_FILE:ucode> -L $<TARGET_FILE_DIR:fs_lib>/*.so -S run_tests.uc
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

Expand Down
240 changes: 0 additions & 240 deletions tests/custom/run_tests.sh

This file was deleted.

Loading

0 comments on commit 26d7292

Please sign in to comment.