Skip to content

Commit

Permalink
test/devel/test-acme-math-xs.t supports all variants
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Dec 22, 2014
1 parent 43cf473 commit 4f274bb
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 21 deletions.
55 changes: 34 additions & 21 deletions test/devel/test-acme-math-xs.t
@@ -1,34 +1,47 @@
#!/usr/bin/env bash

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

git clone $TEST_HOME/../acme-math-xs-pm/.git -b eumm
cd acme-math-xs-pm
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

{
prove -lv t &> out
pass "Acme::Math::XS passes its tests"
}
test_branch=cpp
test_module

{
perl Makefile.PL
ok "`[ -f Makefile ]`" "The Makefile exists after 'perl Makefile.PL'"
}
test_branch=dzil
test_make_distdir=('dzil build')
test_module

{
make
ok "`[ -d blib ]`" "The 'blib' dir exists after 'make'"
}
test_branch=eumm
test_make_distdir=('perl Makefile.PL' 'make manifest distdir')
test_module

{
make manifest distdir
dd=( Alt-Acme-Math-XS-EUMM-* )
ok "`[ -e "$dd/MANIFEST" ]`" "$dd/MANIFEST exists"
ok "`[ -e "$dd/inc/Acme/Math/XS/Inline.pm" ]`" \
"$dd/inc/Acme/Math/XS/Inline.pm exists"
}
test_branch='m-b'
test_make_distdir=('perl Build.PL' './Build manifest' './Build distdir')
test_module

test_branch='m-i'
test_make_distdir=('perl Makefile.PL' 'make manifest distdir')
test_module

test_branch='xs'
test_test_runner=('perl Makefile.PL' 'make' 'prove -blv t/')
test_inline_build_dir=
test_module

test_branch='zild'
test_inline_build_dir=blib/Inline
test_test_runner=('prove -lv test/')
test_make_distdir=('zild make distdir')
test_module

done_testing;
teardown

# vim: set ft=sh:
68 changes: 68 additions & 0 deletions test/devel/test-module.sh
@@ -0,0 +1,68 @@
#!/usr/bin/env bash

test_module() {
[ -n "$test_dir" ] || die
[ -e "$test_dir" ] ||
git clone $test_repo_url &>/dev/null
[ -e "$test_dir" ] || die
local test_home="$(pwd)"
if [ -n "$test_inline_build_dir" ]; then
inline_module=true
else
inline_module=false
fi

note "Testing '$test_dir' branch '$test_branch'"
cd "$test_dir"
git clean -dxf &>/dev/null
git checkout "$test_branch" &>/dev/null

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

{
for cmd in "${test_make_distdir[@]}"; do
$cmd &>>out
done
shopt -s nullglob
dd=( Alt-Acme-Math-XS-* Acme-Math-XS-* )
ok "`[ -e "$dd/MANIFEST" ]`" "$dd/MANIFEST exists"
ok "`[ ! -e "$dd/MANIFEST.SKIP" ]`" \
"$dd has no MANIFEST.SKIP"
if $inline_module; then
ok "`[ -e "$dd/inc/Acme/Math/XS/Inline.pm" ]`" \
"$dd/inc/Acme/Math/XS/Inline.pm exists"
fi
}

cd "$test_home"
}

# {
# perl Makefile.PL &>out
# ok "`[ -f Makefile ]`" "The Makefile exists after 'perl Makefile.PL'"
# }
#
# {
# make &>out
# ok "`[ -d blib ]`" "The 'blib' dir exists after 'make'"
# }
#
# git clean -dxf &>/dev/null
# git checkout dzil &>/dev/null
#
# {
# dzil test &>out
# pass "Alt::Acme::Math::XS::DistZilla passes its tests"
# }
#
# git clean -dxf &>/dev/null
# git checkout dzil &>/dev/null

0 comments on commit 4f274bb

Please sign in to comment.