Skip to content

Commit

Permalink
More devel tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Dec 22, 2014
1 parent 7fb6261 commit eed605c
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 17 deletions.
50 changes: 35 additions & 15 deletions test/devel/test-inline-modules.t
@@ -1,22 +1,26 @@
#!/usr/bin/env bash

source "`dirname $0`/test-module.sh"
source "`dirname $0`/setup"
dir="$PWD/`dirname $0`"
source "$dir/setup"
use Test::More
BAIL_ON_FAIL
source "$dir/test-module.sh"

# Default testing values:
test_dir=acme-math-xs-pm
test_repo_url=$TEST_HOME/../acme-math-xs-pm/.git
test_test_runner=('prove -lv t/')
test_make_distdir=('perl Makefile.PL' 'make manifest distdir')
test_inline_build_dir=blib/Inline
test_dist=Alt-Acme-Math-XS
test_dist_files=(
MANIFEST
lib/Acme/Math/XS.pm
inc/Acme/Math/XS/Inline.pm
)
{
test_dir=acme-math-xs-pm
test_repo_url=$TEST_HOME/../acme-math-xs-pm/.git
test_prove_run=('prove -lv t/')
test_test_run=('perl Makefile.PL' 'make test')
test_make_distdir=('perl Makefile.PL' 'make manifest distdir')
test_inline_build_dir=blib/Inline
test_dist=Alt-Acme-Math-XS
test_dist_files=(
MANIFEST
lib/Acme/Math/XS.pm
inc/Acme/Math/XS/Inline.pm
)
}

t() {
local test_branch=cpp
Expand All @@ -25,6 +29,7 @@ t() {

t() {
local test_branch=dzil
local test_test_run=('dzil test')
local test_make_distdir=('dzil build')
test_module
};t
Expand All @@ -41,6 +46,7 @@ t() {

t() {
local test_branch='m-b'
local test_test_run=('perl Build.PL' './Build test')
local test_make_distdir=('perl Build.PL' './Build manifest' './Build distdir')
test_module
};t
Expand All @@ -52,7 +58,7 @@ t() {

t() {
local test_branch='xs'
local test_test_runner=('perl Makefile.PL' 'make' 'prove -blv t/')
local test_prove_run=('perl Makefile.PL' 'make' 'prove -blv t/')
local test_inline_build_dir=
local test_dist=Acme-Math-XS
test_module
Expand All @@ -61,7 +67,8 @@ t() {
t() {
local test_branch='zild'
local test_inline_build_dir=blib/Inline
local test_test_runner=('prove -lv test/')
local test_prove_run=('prove -lv test/')
local test_test_run=('zild make test')
local test_make_distdir=('zild make distdir')
test_module
};t
Expand All @@ -79,6 +86,19 @@ t() {
test_module
};t

t() {
local test_dir=Devel-GlobalDestruction-XS
local test_repo_url=$TEST_HOME/../Devel-GlobalDestruction-XS/.git
local test_dist=Alt-$test_dir
local test_branch='alt-inline'
local test_dist_files=(
MANIFEST
lib/Devel/GlobalDestruction/XS.pm
inc/Devel/GlobalDestruction/XS/Inline.pm
)
test_module
};t

done_testing;
teardown

Expand Down
15 changes: 13 additions & 2 deletions test/devel/test-module.sh
Expand Up @@ -18,17 +18,28 @@ test_module() {
git checkout "$test_branch" &>/dev/null

{
for cmd in "${test_test_runner[@]}"; do
for cmd in "${test_prove_run[@]}"; do
$cmd &>>out
done
pass "Acme::Math::XS ($test_branch) passes its tests"
pass "Acme::Math::XS ($test_branch) passes its tests w/ prove"
if $inline_module; then
ok "`[ -e "$test_inline_build_dir" ]`" \
"$test_inline_build_dir exists after testing"
fi
}

{
git clean -dxf &>/dev/null
if [ -n "$test_test_run" ]; then
for cmd in "${test_test_run[@]}"; do
$cmd &>>out
done
pass "Acme::Math::XS ($test_branch) passes its test runner"
fi
}

{
git clean -dxf &>/dev/null
for cmd in "${test_make_distdir[@]}"; do
$cmd &>>out
done
Expand Down

0 comments on commit eed605c

Please sign in to comment.