citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit c7613333b5d82c338611d7b906a7d4aedf2f7338
parent e52e2b57a61f2073cc168acad58f13ad9565b366
Author: Kyle Milz <kyle@0x30.net>
Date:   Sat, 20 Aug 2016 01:18:35 -0600

src: error out when incompatible runtime objects are run

Diffstat:
Msrc/runtime.c | 2+-
Mt/rt_ver.sh | 9+++++----
2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/runtime.c b/src/runtime.c @@ -149,7 +149,7 @@ citrun_node_add(uint8_t node_major, uint8_t node_minor, struct citrun_node *n) size_t shm_pos = 0; if (node_major != citrun_major || node_minor != citrun_minor) { - warnx("libcitrun %i.%i: node with version %i.%i skipped", + errx(1, "libcitrun %i.%i: incompatible node version %i.%i", citrun_major, citrun_minor, node_major, node_minor); return; diff --git a/t/rt_ver.sh b/t/rt_ver.sh @@ -1,8 +1,8 @@ # # Check that linking object files of one citrun version with libcitrun of -# another shows a warning message. +# another errors. # -echo 1..2 +echo 1..3 . test/utils.sh cat <<EOF > main.c @@ -19,9 +19,10 @@ EOF /usr/bin/cc -o main main.o $TEST_TOOLS/libcitrun.a main 2> out +[ $? -eq 1 ] && echo ok 2 - runtime errored program out cat <<EOF > good -main: libcitrun 0.0: node with version 0.255 skipped +main: libcitrun 0.0: incompatible node version 0.255 EOF -diff -u good out && echo ok 2 +diff -u good out && echo ok 3 - error message