Skip to content

Commit

Permalink
Refactor tests so we can run individually
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Dec 22, 2014
1 parent eed605c commit 7406f6e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 41 deletions.
59 changes: 39 additions & 20 deletions test/devel/test-inline-modules.t
Expand Up @@ -22,58 +22,58 @@ source "$dir/test-module.sh"
)
}

t() {
cpp() {
local test_branch=cpp
test_module
};t
}

t() {
dz() {
local test_branch=dzil
local test_test_run=('dzil test')
local test_make_distdir=('dzil build')
test_module
};t
}

t() {
eumm() {
local test_branch=eumm
test_module
};t
}

t() {
ext() {
local test_branch=ext
test_module
};t
}

t() {
m-b() {
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
}

t() {
m-i() {
local test_branch='m-i'
test_module
};t
}

t() {
xs() {
local test_branch='xs'
local test_prove_run=('perl Makefile.PL' 'make' 'prove -blv t/')
local test_inline_build_dir=
local test_dist=Acme-Math-XS
test_module
};t
}

t() {
zd() {
local test_branch='zild'
local test_inline_build_dir=blib/Inline
local test_prove_run=('prove -lv test/')
local test_test_run=('zild make test')
local test_make_distdir=('zild make distdir')
test_module
};t
}

t() {
m-p-fs() {
local test_dir=Math-Prime-FastSieve
local test_repo_url=$TEST_HOME/../Math-Prime-FastSieve/.git
local test_dist=Alt-$test_dir
Expand All @@ -84,9 +84,9 @@ t() {
inc/Math/Prime/FastSieve/Inline.pm
)
test_module
};t
}

t() {
d-g-xs() {
local test_dir=Devel-GlobalDestruction-XS
local test_repo_url=$TEST_HOME/../Devel-GlobalDestruction-XS/.git
local test_dist=Alt-$test_dir
Expand All @@ -97,7 +97,26 @@ t() {
inc/Devel/GlobalDestruction/XS/Inline.pm
)
test_module
};t
}

# You can run specific tests like this:
# prove -v test/devel/test-inline-modules.t :: dz cpp d-g-xs
if [ $# -gt 0 ]; then
for t in "$@"; do
$t
done
else
cpp
dz
eumm
ext
m-b
m-i
xs
zd
m-p-fs
d-g-xs
fi

done_testing;
teardown
Expand Down
32 changes: 11 additions & 21 deletions test/devel/test-module.sh
Expand Up @@ -54,28 +54,18 @@ test_module() {
"$dd/$file exists"
done
fi
(
cd $dd
if [ -e Build.PL ]; then
perl Build.PL &>>../out
./Build test &>>../out
else
perl Makefile.PL &>>../out
make test &>>../out
fi
)
pass "$dd passes its tests"
}

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 7406f6e

Please sign in to comment.