Skip to content

Commit

Permalink
Fixed tests to clone correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Feb 20, 2015
1 parent 1419022 commit 3641499
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
12 changes: 7 additions & 5 deletions test/devel/test-inline-modules.t
Expand Up @@ -76,6 +76,7 @@ zd() {

m-p-fs() {
local test_dir=Math-Prime-FastSieve
local test_author=daoswald
local test_repo_url=$TEST_HOME/../Math-Prime-FastSieve/.git
local test_dist=Alt-$test_dir
local test_branch='alt-inline'
Expand All @@ -95,21 +96,22 @@ d-g-xs() {
local test_dist_files=(
MANIFEST
lib/Devel/GlobalDestruction/XS.pm
inc/Devel/GlobalDestruction/XS/Inline.pm
)
# inc/Devel/GlobalDestruction/XS/Inline.pm
test_module
}

u-t() {
local test_dir=Unicode-Truncate
local test_author=hoytech
local test_repo_url=$TEST_HOME/../Unicode-Truncate/.git
local test_dist=$test_dir
local test_branch='master'
local test_dist_files=(
MANIFEST
lib/Unicode/Truncate.pm
inc/Unicode/Truncate/Inline.pm
)
# inc/Unicode/Truncate/Inline.pm
local test_no_bundle=true
test_module
}
Expand All @@ -124,9 +126,9 @@ s-s() {
lib/String/Slice.pm
inc/String/Slice/Inline.pm
)
test_prove_run=('prove -lv test/')
test_test_run=('zild disttest')
test_make_distdir=('zild distdir')
local test_prove_run=('prove -lv test/')
local test_test_run=('zild disttest')
local test_make_distdir=('zild distdir')
test_module
}

Expand Down
24 changes: 18 additions & 6 deletions test/devel/test-module.sh
Expand Up @@ -20,9 +20,21 @@ or rerun this command with the env var:
...
exit 1
fi
git clone "$github_repo" "$test_repo"
git clone "$github_repo" "$test_repo" &>out || die "$(cat out)"
# Get all remote branches:
(
cd "$test_repo"
git branch -a |
cut -c3- |
grep ^remotes/ |
cut -d' ' -f1 |
cut -d/ -f3- |
grep -v HEAD |
xargs -n1 git checkout -q
git checkout -q master
)
fi
git clone $test_repo_url &>/dev/null
git clone $test_repo_url &>out || die "$(cat out)"
fi
[ -e "$test_dir" ] || die "'$test_dir' does not exist"
local test_home="$(pwd)"
Expand All @@ -34,8 +46,8 @@ or rerun this command with the env var:

note "Testing '$test_dir' branch '$test_branch'"
cd "$test_dir"
git clean -dxf &>/dev/null
git checkout "$test_branch" &>/dev/null
git clean -dxf &>out || die "$(cat out)"
git checkout "$test_branch" &>out || die "$(cat out)"

{
for cmd in "${test_prove_run[@]}"; do
Expand All @@ -49,7 +61,7 @@ or rerun this command with the env var:
}

{
git clean -dxf &>/dev/null
git clean -dxf &>out || die "$(cat out)"
if [ -n "$test_test_run" ]; then
for cmd in "${test_test_run[@]}"; do
$cmd &>>out || die "$(cat out)"
Expand All @@ -59,7 +71,7 @@ or rerun this command with the env var:
}

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

0 comments on commit 3641499

Please sign in to comment.