-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Disabled Lightning's dissembler on amd64
* Split specrunner into bin/mspec and a wrapper
- Loading branch information
Eero Saynatkari
committed
May 14, 2007
1 parent
3ed75ad
commit 34ad791
Showing
9 changed files
with
1,614 additions
and
1,858 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/usr/bin/env bash | ||
# Fear my elite bash skills | ||
|
||
__SR_GOODFILE="/tmp/mini_spec_specrunner.txt" | ||
__SR_ERRFILE="/tmp/mini_spec_specrunner_error.txt" | ||
|
||
__SR_GOODFIFO="/tmp/mini_spec_good_fifo" | ||
|
||
# Pre-cleanup | ||
rm $__SR_GOODFILE $__SR_ERRFILE $__SR_GOODFIFO 2>/dev/null | ||
|
||
|
||
# Target VM is MRI by default | ||
if [[ $SR_TARGET = "" ]]; then | ||
SR_TARGET=ruby | ||
fi | ||
|
||
# Files to run | ||
if [[ -d $1 ]]; then | ||
# Incompatible specs can only run under rubinius | ||
if [[ $SR_TARGET = "shotgun/rubinius" ]]; then | ||
__SR_SOURCE=`find $1 -name *_spec.rb | sort` | ||
else | ||
__SR_SOURCE=`find $1 -name *_spec.rb | grep -v 'incompatible' | sort` | ||
fi | ||
elif [[ -f $1 ]]; then | ||
__SR_SOURCE=$1 | ||
else | ||
echo "Usage: [__SR_TARGET=<vm>] specrunner <file|directory>" | ||
exit 1 | ||
fi | ||
|
||
__SR_TOTAL_SPECS="0" | ||
__SR_TOTAL_FAILS="0" | ||
|
||
# Dup some fds | ||
exec 3>&1 4>&2 | ||
|
||
# Need some fifos too, hooray | ||
mkfifo $__SR_GOODFIFO | ||
|
||
|
||
# Run the specs | ||
for i in $__SR_SOURCE; do | ||
# tee helps keep the screen updating snappily | ||
tee $__SR_GOODFILE < $__SR_GOODFIFO >&3 & | ||
__SR_TEE_PID=$? | ||
|
||
$SR_TARGET -rspec/mini_rspec.rb $i > $__SR_GOODFIFO 2> $__SR_ERRFILE | ||
|
||
if [[ -s $__SR_ERRFILE ]]; then | ||
echo "Errors:" | ||
cat $__SR_ERRFILE | ||
echo "" | ||
echo "" | ||
fi | ||
|
||
__SR_TOTAL_SPECS=$(($__SR_TOTAL_SPECS + $(cat $__SR_GOODFILE | grep "^ -" | wc -l))) | ||
__SR_TOTAL_FAILS=$(($__SR_TOTAL_FAILS + $(cat $__SR_GOODFILE | grep "FAILED" | wc -l))) | ||
|
||
rm $__SR_GOODFILE $__SR_ERRFILE 2>/dev/null | ||
kill -3 $__SR_TEE_PID | ||
done | ||
|
||
echo "" | ||
echo "$__SR_TOTAL_SPECS specifications, $__SR_TOTAL_FAILS failures" | ||
echo "" | ||
|
||
# Post-cleanup | ||
rm $__SR_GOODFILE $__SR_ERRFILE $__SR_GOODFIFO 2>/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,8 @@ | ||
#!/usr/bin/env bash | ||
# Fear my elite bash skills | ||
#! /usr/bin/env bash | ||
|
||
__SR_GOODFILE="/tmp/mini_spec_specrunner.txt" | ||
__SR_ERRFILE="/tmp/mini_spec_specrunner_error.txt" | ||
|
||
__SR_GOODFIFO="/tmp/mini_spec_good_fifo" | ||
|
||
# Pre-cleanup | ||
rm $__SR_GOODFILE $__SR_ERRFILE $__SR_GOODFIFO 2>/dev/null | ||
|
||
|
||
# Target VM | ||
# Switch to default rubinius | ||
if [[ $SR_TARGET = "" ]]; then | ||
SR_TARGET=shotgun/rubinius | ||
fi | ||
|
||
# Files to run | ||
if [[ -d $1 ]]; then | ||
# Incompatible specs can only run under rubinius | ||
if [[ $SR_TARGET = "shotgun/rubinius" ]]; then | ||
__SR_SOURCE=`find $1 -name *_spec.rb | sort` | ||
else | ||
__SR_SOURCE=`find $1 -name *_spec.rb | grep -v 'incompatible' | sort` | ||
fi | ||
elif [[ -f $1 ]]; then | ||
__SR_SOURCE=$1 | ||
SR_TARGET=./shotgun/rubinius exec ./bin/mspec $@ | ||
else | ||
echo "Usage: [__SR_TARGET=<vm>] specrunner <file|directory>" | ||
exit 1 | ||
exec ./bin/mspec $@ | ||
fi | ||
|
||
__SR_TOTAL_SPECS="0" | ||
__SR_TOTAL_FAILS="0" | ||
|
||
# Dup some fds | ||
exec 3>&1 4>&2 | ||
|
||
# Need some fifos too, hooray | ||
mkfifo $__SR_GOODFIFO | ||
|
||
|
||
# Run the specs | ||
for i in $__SR_SOURCE; do | ||
# tee helps keep the screen updating snappily | ||
tee $__SR_GOODFILE < $__SR_GOODFIFO >&3 & | ||
__SR_TEE_PID=$? | ||
|
||
$SR_TARGET -rspec/mini_rspec.rb $i > $__SR_GOODFIFO 2> $__SR_ERRFILE | ||
|
||
if [[ -s $__SR_ERRFILE ]]; then | ||
echo "Errors:" | ||
cat $__SR_ERRFILE | ||
echo "" | ||
echo "" | ||
fi | ||
|
||
__SR_TOTAL_SPECS=$(($__SR_TOTAL_SPECS + $(cat $__SR_GOODFILE | grep "^ -" | wc -l))) | ||
__SR_TOTAL_FAILS=$(($__SR_TOTAL_FAILS + $(cat $__SR_GOODFILE | grep "FAILED" | wc -l))) | ||
|
||
rm $__SR_GOODFILE $__SR_ERRFILE 2>/dev/null | ||
kill -3 $__SR_TEE_PID | ||
done | ||
|
||
echo "" | ||
echo "$__SR_TOTAL_SPECS examples, $__SR_TOTAL_FAILS failures" | ||
echo "" | ||
|
||
# Post-cleanup | ||
rm $__SR_GOODFILE $__SR_ERRFILE $__SR_GOODFIFO 2>/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.