citrun

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

commit c8a377de0e9c8a9f9bc3fb8c535dc5e0bcf21fb4
parent cbce0281b2f439322e9d74e3c4d0985744111c9d
Author: kyle <kyle@0x30.net>
Date:   Sat, 12 Nov 2016 12:27:52 -0700

tlib: move utils.sh and libtap.sh to t/

Diffstat:
Mt/check_baddir.sh | 2+-
Mt/check_empty.sh | 2+-
Mt/e2e_basic.sh | 2+-
Mt/e2e_stdout.sh | 2+-
Mt/inst_basic_link.sh | 2+-
Mt/inst_binop.sh | 2+-
Mt/inst_dowhile.sh | 2+-
Mt/inst_fail.sh | 2+-
Mt/inst_for.sh | 2+-
Mt/inst_funcdef.sh | 2+-
Mt/inst_if.sh | 2+-
Mt/inst_link_multiple.sh | 2+-
Mt/inst_log.sh | 2+-
Mt/inst_macro.sh | 2+-
Mt/inst_path.sh | 2+-
Mt/inst_preamble.sh | 2+-
Mt/inst_preprocess.sh | 2+-
Mt/inst_return.sh | 2+-
Mt/inst_src_ext.sh | 2+-
Mt/inst_switch.sh | 2+-
Mt/inst_two_src.sh | 2+-
Mt/inst_while.sh | 2+-
Rtlib/libtap.sh -> t/libtap.subr | 0
Mt/rt_badver.sh | 2+-
At/utils.subr | 24++++++++++++++++++++++++
Mt/wrap_badarg.sh | 2+-
Mt/wrap_exitcode.sh | 2+-
Dtlib/utils.sh | 24------------------------
Mtt/package.subr | 4++--
29 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/t/check_baddir.sh b/t/check_baddir.sh @@ -2,7 +2,7 @@ # # Verify that passing a bad directory to citrun-check errors out. # -. tlib/utils.sh +. t/utils.subr plan 1 output_good="citrun-check: some_nonexistent_dir: directory does not exist" diff --git a/t/check_empty.sh b/t/check_empty.sh @@ -2,7 +2,7 @@ # # Verify the output when 0 citrun.log files are found. # -. tlib/utils.sh +. t/utils.subr plan 1 output_good="No log files found." diff --git a/t/e2e_basic.sh b/t/e2e_basic.sh @@ -2,7 +2,7 @@ # # Check that a simple program can execute successfully with instrumentation. # -. tlib/utils.sh +. t/utils.subr plan 7 cat <<EOF > fib.c diff --git a/t/e2e_stdout.sh b/t/e2e_stdout.sh @@ -2,7 +2,7 @@ # # Simple program that prints output. # -. tlib/utils.sh +. t/utils.subr plan 5 cat <<EOF > hello.c diff --git a/t/inst_basic_link.sh b/t/inst_basic_link.sh @@ -2,7 +2,7 @@ # # Check that the most basic of compile command lines works. # -. tlib/utils.sh +. t/utils.subr plan 4 cat <<EOF > main.c diff --git a/t/inst_binop.sh b/t/inst_binop.sh @@ -2,7 +2,7 @@ # # Test that binary operators in strange cases work. Includes enums and globals. # -. tlib/utils.sh +. t/utils.subr plan 5 cat <<EOF > enum.c diff --git a/t/inst_dowhile.sh b/t/inst_dowhile.sh @@ -2,7 +2,7 @@ # # Make sure that do while loop condition instrumentation works. # -. tlib/utils.sh +. t/utils.subr plan 5 cat <<EOF > while.c diff --git a/t/inst_fail.sh b/t/inst_fail.sh @@ -2,7 +2,7 @@ # # Check that a program that won't compile natively is handled properly. # -. tlib/utils.sh +. t/utils.subr plan 4 echo "int main(void) { return 0; " > bad.c diff --git a/t/inst_for.sh b/t/inst_for.sh @@ -2,7 +2,7 @@ # # Test that for loop condition instrumenting works. # -. tlib/utils.sh +. t/utils.subr plan 5 cat <<EOF > for.c diff --git a/t/inst_funcdef.sh b/t/inst_funcdef.sh @@ -2,7 +2,7 @@ # # Check that really long function declarations are instrumented properly. # -. tlib/utils.sh +. t/utils.subr plan 5 cat <<EOF > funcdef.c diff --git a/t/inst_if.sh b/t/inst_if.sh @@ -2,7 +2,7 @@ # # Check that if statement conditions are instrumented properly. # -. tlib/utils.sh +. t/utils.subr plan 5 cat <<EOF > if.c diff --git a/t/inst_link_multiple.sh b/t/inst_link_multiple.sh @@ -2,7 +2,7 @@ # # Check that linking more than one instrumented object file together works. # -. tlib/utils.sh +. t/utils.subr plan 4 cat <<EOF > one.c diff --git a/t/inst_log.sh b/t/inst_log.sh @@ -3,7 +3,7 @@ # Check that a raw citrun.log file is in good shape. # citrun-check relies on this output, and citrun-check is used quite a bit. # -. tlib/utils.sh +. t/utils.subr plan 2 cat <<EOF > source_0.c diff --git a/t/inst_macro.sh b/t/inst_macro.sh @@ -3,7 +3,7 @@ # Test for some tricky macro situations. In particular macro expansions at the # end of binary operators. # -. tlib/utils.sh +. t/utils.subr plan 5 cat <<EOF > macro.c diff --git a/t/inst_path.sh b/t/inst_path.sh @@ -4,7 +4,7 @@ # - not having PATH set errors # - not having CITRUN_SHARE in PATH when using transparent compile mode errors # -. tlib/utils.sh +. t/utils.subr plan 2 OLDPATH=${PATH} diff --git a/t/inst_preamble.sh b/t/inst_preamble.sh @@ -2,7 +2,7 @@ # # Test that the instrumentation preamble is what we think it is. # -. tlib/utils.sh +. t/utils.subr plan 3 touch preamble.c diff --git a/t/inst_preprocess.sh b/t/inst_preprocess.sh @@ -2,7 +2,7 @@ # # Make sure preprocessor flags -E, -MM cause no instrumentation to be done. # -. tlib/utils.sh +. t/utils.subr plan 3 echo "int main(void) { return 0; }" > prepro.c diff --git a/t/inst_return.sh b/t/inst_return.sh @@ -2,7 +2,7 @@ # # Check that return statement values (if any) are instrumented correctly. # -. tlib/utils.sh +. t/utils.subr plan 5 cat <<EOF > return.c diff --git a/t/inst_src_ext.sh b/t/inst_src_ext.sh @@ -2,7 +2,7 @@ # # Check that the advertised source file extensions work. # -. tlib/utils.sh +. t/utils.subr plan 8 touch main.{c,cc,cxx,cpp,C} diff --git a/t/inst_switch.sh b/t/inst_switch.sh @@ -2,7 +2,7 @@ # # Make sure that switch statement condition instrumentation works. # -. tlib/utils.sh +. t/utils.subr plan 5 cat <<EOF > switch.c diff --git a/t/inst_two_src.sh b/t/inst_two_src.sh @@ -3,7 +3,7 @@ # Check that two source files given on the same command line both get # instrumented fully. # -. tlib/utils.sh +. t/utils.subr plan 4 cat <<EOF > main.c diff --git a/t/inst_while.sh b/t/inst_while.sh @@ -2,7 +2,7 @@ # # Make sure that while loop condition instrumentation works. # -. tlib/utils.sh +. t/utils.subr plan 5 cat <<EOF > while.c diff --git a/tlib/libtap.sh b/t/libtap.subr diff --git a/t/rt_badver.sh b/t/rt_badver.sh @@ -3,7 +3,7 @@ # Check that linking object files of one citrun version with libcitrun of # another errors. # -. tlib/utils.sh +. t/utils.subr plan 3 cat <<EOF > main.c diff --git a/t/utils.subr b/t/utils.subr @@ -0,0 +1,24 @@ +. t/libtap.subr + +set -o nounset +export CITRUN_TOOLS="`pwd`/src" + +function strip_preamble +{ + file="${1}" + tail -n +25 $file.citrun > $file.citrun_nohdr +} + +function strip_log +{ + sed -e "s,^.*: ,," \ + -e "s,'.*',''," \ + -e "s,(.*),()," \ + -e "/Milliseconds/d" \ + < ${1} > ${1}.stripped +} + +function strip_millis +{ + ok "stripping milliseconds" sed -i -e "/Milliseconds spent/d" $1 +} diff --git a/t/wrap_badarg.sh b/t/wrap_badarg.sh @@ -1,6 +1,6 @@ #!/bin/sh -. tlib/utils.sh +. t/utils.subr plan 1 output_good="usage: citrun-wrap <build cmd>" diff --git a/t/wrap_exitcode.sh b/t/wrap_exitcode.sh @@ -2,7 +2,7 @@ # # Make sure that citrun-wrap exits with the same code as the native build. # -. tlib/utils.sh +. t/utils.subr plan 1 output_good="ls: asdfasdfsaf: No such file or directory" diff --git a/tlib/utils.sh b/tlib/utils.sh @@ -1,24 +0,0 @@ -. tlib/libtap.sh - -set -o nounset -export CITRUN_TOOLS="`pwd`/src" - -function strip_preamble -{ - file="${1}" - tail -n +25 $file.citrun > $file.citrun_nohdr -} - -function strip_log -{ - sed -e "s,^.*: ,," \ - -e "s,'.*',''," \ - -e "s,(.*),()," \ - -e "/Milliseconds/d" \ - < ${1} > ${1}.stripped -} - -function strip_millis -{ - ok "stripping milliseconds" sed -i -e "/Milliseconds spent/d" $1 -} diff --git a/tt/package.subr b/tt/package.subr @@ -1,5 +1,5 @@ -# exports CITRUN_TOOLS and sources libtap.sh. -. tlib/utils.sh +# exports CITRUN_TOOLS and sources libtap.subr +. t/utils.subr function pkg_set {