Skip to content

Instantly share code, notes, and snippets.

@davedevelopment
Created March 6, 2013 13:31
Show Gist options
  • Save davedevelopment/5099311 to your computer and use it in GitHub Desktop.
Save davedevelopment/5099311 to your computer and use it in GitHub Desktop.
Attempt at a little test runner for silex
#!/bin/zsh
autoload colors
colors
function test_version() {
echo "Attempting to test against Symfony $1"
git reset HEAD --hard
rm -r ./vendor
sed -i "s/>=2.1,<2.3-dev/$1/g" composer.json
cat composer.json
composer update --dev --prefer-dist
if (( $? != 0 ))
then
return 1
fi
phpunit
res=$?
git reset HEAD --hard
return $res
}
if (( $# == 0 ))
then
print -P "$fg[yellow]%BWARNING:%b running against all known versions, writing output to silex_tests.log$reset_color"
echo > silex_tests.log
for v in 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.2.0
do
echo -n "$v: "
test_version $v >> silex_tests.log
if (( $? == 0 ))
then
print -P "%B$fg[green]PASSED$reset_color%b"
else
print -P "%B$fg[red]FAILED$reset_color%b"
fi
done
return
fi
test_version $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment