File testruby.sh.in of Package rubyspec
#!/bin/bash
TESTROOT=$(mktemp -d)
if [$? -ne 0 ]; then
echo "Could not create temporary directory"
exit 1
else
echo "Using temporary test directory $TESTROOT"
fi
pushd "$TESTROOT"
echo "Basic ruby tests"
sed -e 's@\./miniruby@ruby@g' @DOCDIR@/ruby/examples/test.rb > test.rb
chmod a+x test.rb
./test.rb
rm test.rb
echo "Does the test unit framework function?"
ruby -C @DOCDIR@/ruby/examples/testunit ts_examples.rb
echo "Ruby internal test suite"
# Internal suite assumes it can write to the tests, or at least the directory
# Internal readline suite needs a plain (e.g. vt100) terminal to pass
cp -a @DOCDIR@/ruby-test-suite/test .
TERM=vt100 ruby ./test/runner.rb --basedir=./test --runner=console
rm -rf ./test
echo "rubyspec tests"
RB_VER=$(/usr/bin/ruby -e 'puts VERSION.sub(/\.\d$/, "")')
mspec -t r -V @DATADIR@/rubyspec/${RB_VER}/core
mspec -t r -V @DATADIR@/rubpspec/${RB_VER}/language
mspec -t r -V @DATADIR@/rubyspec/${RB_VER}/library
popd
rm -rf "$TESTROOT"