diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2015-10-13 10:26:06 +0000 |
---|---|---|
committer | Mattia Rizzolo <mattia@mapreri.org> | 2015-10-13 10:26:06 +0000 |
commit | 72075b8430b826d7dd489765c1004e4161479fa2 (patch) | |
tree | 682a8d69bcc478082f1805859eb72445e8b6cf42 /t/test_pbuilder-modules | |
parent | 524cde2e544f40dc2056d2a4c4265ddc4160784d (diff) | |
download | pbuilder-72075b8430b826d7dd489765c1004e4161479fa2.tar pbuilder-72075b8430b826d7dd489765c1004e4161479fa2.tar.gz |
move all tests under a t/ directory
Diffstat (limited to 't/test_pbuilder-modules')
-rwxr-xr-x | t/test_pbuilder-modules | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/t/test_pbuilder-modules b/t/test_pbuilder-modules new file mode 100755 index 0000000..9e1f6e0 --- /dev/null +++ b/t/test_pbuilder-modules @@ -0,0 +1,44 @@ +#!/bin/bash + +TD="$(dirname "$0")" +if [ -n "$PBUILDER_CHECKOUT" ]; then + . "$TD/testlib.sh" + . "$PBUILDER_CHECKOUT/pbuilder-modules" +else + . "$TD/testlib.sh" + . "$PBUILDER_TEST_PKGLIBDIR/pbuilder-modules" +fi + +function test_information() { + log "I: test" + log "W: warning" + log "E: error" +} +expect_output "I: test +W: warning +E: error" test_information + +# test the non-copy case +function test_conditional_cp_a() { + ( + TEMPDIR=$(mktemp -d) + cd "${TEMPDIR}" + touch "hoge" + outdir=$(readlink -f "${TEMPDIR}/..") + conditional_cp_a "hoge" "${outdir}" echo + ) +} +expect_output "I: file hoge is already in target, not copying." \ + test_conditional_cp_a + +# test the copy case. +function test_conditional_cp_a_copy() { + ( + cd /tmp + outdir=/something-else + conditional_cp_a "hoge" "${outdir}" echo + ) +} +expect_output "-a hoge /something-else" test_conditional_cp_a_copy + +testlib_summary |