commit dd94119b9a2139d38413d37535c013daa72ca432
parent 0e1cf16dfcd4304ab13f020a42ca0e9814078c7f
Author: kyle <kyle@0x30.net>
Date: Sat, 12 Nov 2016 12:00:31 -0700
tt: move package functions to tt/
Diffstat:
10 files changed, 68 insertions(+), 68 deletions(-)
diff --git a/tlib/package.sh b/tlib/package.sh
@@ -1,60 +0,0 @@
-# exports CITRUN_TOOLS and sources libtap.sh.
-. tlib/utils.sh
-
-function pkg_set
-{
- port="/usr/ports/$1"
- wrkdist=`make -C $port show=WRKDIST`
-
- export TEST_PORT="$port"
- export TEST_WRKDIST="$wrkdist"
-}
-
-function pkg_check_deps
-{
- make -C $TEST_PORT full-build-depends > deps
- make -C $TEST_PORT full-test-depends >> deps
- sort deps | uniq > deps.uniq
- pkg_info -q > installed
- comm -2 -3 deps.uniq installed > deps_needed
-
- ok "build and test dependencies" diff -u /dev/null deps_needed
-}
-
-function pkg_build
-{
- ok "port build" make -C $TEST_PORT PORTPATH="$CITRUN_TOOLS:\${WRKDIR}/bin:$PATH" build
-}
-
-function pkg_test
-{
- #make -C $TEST_PORT PORTPATH="$CITRUN_TOOLS:\${WRKDIR}/bin:$PATH" test || true
-}
-
-function pkg_check
-{
- $CITRUN_TOOLS/citrun-check -o check.out $TEST_WRKDIST
- strip_millis check.out
- ok "citrun-check output diff" diff -u check.good check.out
-}
-
-function pkg_clean
-{
- ok "port clean" make -C $TEST_PORT clean=all
-}
-
-function pkg_write_tus
-{
- cat <<'EOF' > tu_printer.pl
-use strict;
-use warnings;
-use tlib::shm;
-
-open(my $out, '>', 'filelist.out') or die $!;
-my $shm = tlib::shm->new();
-
-select $out;
-$shm->print_tus();
-EOF
- ok "is tu printer exit code 0" perl -I $CITRUN_TOOLS/.. tu_printer.pl
-}
diff --git a/tt/bash.sh b/tt/bash.sh
@@ -2,7 +2,7 @@
#
# Check that Bash can be instrumented and still works after.
#
-. tlib/package.sh
+. tt/package.subr
plan 5
pkg_set "shells/bash"
diff --git a/tt/ccitrunrun.sh b/tt/ccitrunrun.sh
@@ -2,7 +2,7 @@
#
# Test that citrun run on itself works and the resulting binaries run.
#
-. tlib/package.sh
+. tt/package.subr
rm -rf /usr/ports/devel/ccitrunrun
# Port contains some.. "customizations"
diff --git a/tt/git.sh b/tt/git.sh
@@ -3,7 +3,7 @@
# Instruments git, checks logs, and makes sure the resulting program still
# works.
#
-. tlib/package.sh
+. tt/package.subr
plan 8
pkg_set "devel/git"
diff --git a/tt/mutt.sh b/tt/mutt.sh
@@ -2,7 +2,7 @@
#
# Test that building Mutt works.
#
-. tlib/package.sh
+. tt/package.subr
plan 5
pkg_set "mail/mutt"
diff --git a/tt/nmap.sh b/tt/nmap.sh
@@ -2,7 +2,7 @@
#
# Instruments Nmap and checks that the instrumented program still runs.
#
-. tlib/package.sh
+. tt/package.subr
plan 8
pkg_set "net/nmap"
diff --git a/tt/nvi.sh b/tt/nvi.sh
@@ -2,7 +2,7 @@
#
# Tests that nvi works with C It Run.
#
-. tlib/package.sh
+. tt/package.subr
plan 10
pkg_set "editors/nvi"
diff --git a/tt/openssl.sh b/tt/openssl.sh
@@ -3,7 +3,7 @@
# Instrument openssl, run its testsuite, check the logs and do a quick runtime
# sanity test on it.
#
-. tlib/package.sh
+. tt/package.subr
plan 8
pkg_set "security/openssl"
diff --git a/tt/package.subr b/tt/package.subr
@@ -0,0 +1,60 @@
+# exports CITRUN_TOOLS and sources libtap.sh.
+. tlib/utils.sh
+
+function pkg_set
+{
+ port="/usr/ports/$1"
+ wrkdist=`make -C $port show=WRKDIST`
+
+ export TEST_PORT="$port"
+ export TEST_WRKDIST="$wrkdist"
+}
+
+function pkg_check_deps
+{
+ make -C $TEST_PORT full-build-depends > deps
+ make -C $TEST_PORT full-test-depends >> deps
+ sort deps | uniq > deps.uniq
+ pkg_info -q > installed
+ comm -2 -3 deps.uniq installed > deps_needed
+
+ ok "build and test dependencies" diff -u /dev/null deps_needed
+}
+
+function pkg_build
+{
+ ok "port build" make -C $TEST_PORT PORTPATH="$CITRUN_TOOLS:\${WRKDIR}/bin:$PATH" build
+}
+
+function pkg_test
+{
+ #make -C $TEST_PORT PORTPATH="$CITRUN_TOOLS:\${WRKDIR}/bin:$PATH" test || true
+}
+
+function pkg_check
+{
+ $CITRUN_TOOLS/citrun-check -o check.out $TEST_WRKDIST
+ strip_millis check.out
+ ok "citrun-check output diff" diff -u check.good check.out
+}
+
+function pkg_clean
+{
+ ok "port clean" make -C $TEST_PORT clean=all
+}
+
+function pkg_write_tus
+{
+ cat <<'EOF' > tu_printer.pl
+use strict;
+use warnings;
+use t::shm;
+
+open(my $out, '>', 'filelist.out') or die $!;
+my $shm = t::shm->new();
+
+select $out;
+$shm->print_tus();
+EOF
+ ok "is tu printer exit code 0" perl -I $CITRUN_TOOLS/.. tu_printer.pl
+}
diff --git a/tt/spidermonkey.sh b/tt/spidermonkey.sh
@@ -2,7 +2,7 @@
#
# Try and instrument spidermonkey.
#
-. tlib/package.sh
+. tt/package.subr
plan 6
pkg_set "devel/spidermonkey"