From 72075b8430b826d7dd489765c1004e4161479fa2 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Tue, 13 Oct 2015 10:26:06 +0000 Subject: move all tests under a t/ directory --- t/test_pbuilder-satisfydepends-checkparams | 51 ++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 t/test_pbuilder-satisfydepends-checkparams (limited to 't/test_pbuilder-satisfydepends-checkparams') diff --git a/t/test_pbuilder-satisfydepends-checkparams b/t/test_pbuilder-satisfydepends-checkparams new file mode 100755 index 0000000..ccb044d --- /dev/null +++ b/t/test_pbuilder-satisfydepends-checkparams @@ -0,0 +1,51 @@ +#!/bin/bash + +TD="$(dirname "$0")" +if [ -n "$PBUILDER_CHECKOUT" ]; then + . "$TD/testlib.sh" + PBUILDER_SATISFYDEPENDS_CHECKPARAMS="$PBUILDER_CHECKOUT/pbuilder-satisfydepends-checkparams" +else + . "$TD/testlib.sh" + PBUILDER_SATISFYDEPENDS_CHECKPARAMS="$PBUILDER_TEST_PKGLIBDIR/pbuilder-satisfydepends-checkparams" +fi + +# testsuite to test pbuilder-satisfydepends-checkparams. + +# mock function +checkbuilddep_internal() { + : # do nothing function +} + +test_chrootexec2() { + set -- --internal-chrootexec 'chroot /tmp-hoge ' --chroot /tmp + . "$PBUILDER_SATISFYDEPENDS_CHECKPARAMS" +} +expect_fail test_chrootexec2 + +test_chrootexec1() { + set -- --chroot /tmp --internal-chrootexec 'chroot /tmp-hoge ' + . "$PBUILDER_SATISFYDEPENDS_CHECKPARAMS" +} +expect_success test_chrootexec1 + +test_chrootexec_echo() { + set -- --echo --chroot /tmp + . "$PBUILDER_SATISFYDEPENDS_CHECKPARAMS" +} +expect_fail test_chrootexec_echo + +test_chrootexec_echo2() { + set -- --chroot /tmp --echo + . "$PBUILDER_SATISFYDEPENDS_CHECKPARAMS" + echo $CHROOTEXEC +} +expect_output "echo chroot /tmp" test_chrootexec_echo2 + +test_chrootexec_expect() { + set -- --chroot /tmp --internal-chrootexec 'chroot /tmp-hoge ' + . "$PBUILDER_SATISFYDEPENDS_CHECKPARAMS" + echo $CHROOTEXEC +} +expect_output "chroot /tmp-hoge" test_chrootexec_expect + +testlib_summary -- cgit v1.2.3