citrun

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

commit 2aadafcc6295d601053384ed4aa18e048bc2090b
parent 34fe6776314c6ba43f007d0c6ca45bc47e11e24a
Author: kyle <kyle@getaddrinfo.net>
Date:   Sat, 31 Oct 2015 17:31:55 -0600

tests: link against runtime

- export LD_LIBRARY_PATH, LDFLAGS, and LDLIBS
- also change test cleaning
  - clean every test before running
  - if test fails, leave program and instrumented source behind
  - if test passes, clean everything up

Diffstat:
Mrun_tests.sh | 15+++++++++------
Mtests/if_statement/Makefile | 2+-
Dtests/if_statement/test.sh | 4----
3 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/run_tests.sh b/run_tests.sh @@ -6,29 +6,32 @@ if which tput > /dev/null; then RESET=`tput sgr0` fi -export LD_LIBRARY_PATH="runtime" export SCV_PATH="$HOME/src/scv/instrument" export PATH="$SCV_PATH:$PATH" -which cc + +export CFLAGS="-pthread" +export LDFLAGS="-L$HOME/src/scv/runtime -pthread" + +export LD_LIBRARY_PATH="$HOME/src/scv/runtime" +export LDLIBS="-lruntime" for t in `ls tests/*/prog.c`; do dirname=`dirname ${t}` + make -C $dirname clean + if ! make -C $dirname prog; then - echo "$dirname: make failed!" - make -C $dirname clean + echo "$dirname:$RED make prog failed!$RESET" continue fi # diff against the last known good instrumented source if ! diff -u $dirname/instrumented.c $dirname/prog_inst.c; then echo "$dirname:$RED source compare failed$RESET" - make -C $dirname clean continue fi # test that the instrumented binary works properly if ! make -C $dirname "test"; then echo "$dirname:$RED test failed!$RESET" - make -C $dirname clean continue fi diff --git a/tests/if_statement/Makefile b/tests/if_statement/Makefile @@ -1,5 +1,5 @@ test: - @sh test.sh + @echo "test suite empty" clean: @rm -f prog prog_inst.c diff --git a/tests/if_statement/test.sh b/tests/if_statement/test.sh @@ -1,4 +0,0 @@ -#!/bin/sh - -echo "${0}: test suite empty" -exit 1