summaryrefslogtreecommitdiff
path: root/debian/tests
diff options
context:
space:
mode:
Diffstat (limited to 'debian/tests')
-rwxr-xr-xdebian/tests/bundled-gems14
-rw-r--r--debian/tests/control2
-rw-r--r--debian/tests/known-failures.txt30
-rwxr-xr-xdebian/tests/run-all65
4 files changed, 111 insertions, 0 deletions
diff --git a/debian/tests/bundled-gems b/debian/tests/bundled-gems
new file mode 100755
index 0000000..35d0be3
--- /dev/null
+++ b/debian/tests/bundled-gems
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+rc=0
+while read gem version; do
+ if ruby2.3 -e "gem '${gem}', '>= ${version}'"; then
+ echo "${gem} (>= ${version}) OK"
+ else
+ rc=$(($rc + 1))
+ fi
+done < gems/bundled_gems
+
+exit $rc
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..20c9386
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,2 @@
+Tests: run-all bundled-gems
+Depends: @
diff --git a/debian/tests/known-failures.txt b/debian/tests/known-failures.txt
new file mode 100644
index 0000000..81e81e2
--- /dev/null
+++ b/debian/tests/known-failures.txt
@@ -0,0 +1,30 @@
+test/erb/test_erb_command.rb
+test/mkmf/test_config.rb
+test/mkmf/test_constant.rb
+test/mkmf/test_convertible.rb
+test/mkmf/test_find_executable.rb
+test/mkmf/test_flags.rb
+test/mkmf/test_framework.rb
+test/mkmf/test_have_func.rb
+test/mkmf/test_have_library.rb
+test/mkmf/test_have_macro.rb
+test/mkmf/test_libs.rb
+test/mkmf/test_signedness.rb
+test/mkmf/test_sizeof.rb
+test/rubygems/test_gem_commands_cert_command.rb
+test/rubygems/test_gem_commands_environment_command.rb
+test/rubygems/test_gem_commands_uninstall_command.rb
+test/rubygems/test_gem_commands_update_command.rb
+test/rubygems/test_gem_ext_rake_builder.rb
+test/rubygems/test_gem_installer.rb
+test/rubygems/test_gem_package.rb
+test/rubygems/test_gem_package_tar_writer.rb
+test/rubygems/test_gem.rb
+test/rubygems/test_gem_request.rb
+test/rubygems/test_gem_security_policy.rb
+test/rubygems/test_gem_security.rb
+test/rubygems/test_gem_security_signer.rb
+test/rubygems/test_gem_security_trust_dir.rb
+test/rubygems/test_gem_specification.rb
+test/ruby/test_fiber.rb
+test/ruby/test_io.rb
diff --git a/debian/tests/run-all b/debian/tests/run-all
new file mode 100755
index 0000000..db7f84a
--- /dev/null
+++ b/debian/tests/run-all
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+exec 2>&1
+set -e
+#set -x
+
+KNOW_FAILURES=$(dirname $(readlink -f $0))/known-failures.txt
+
+tests="$@"
+
+cleanup() {
+ rm -rf "$ADTTMP"
+}
+if [ -z "$ADTTMP" ]; then
+ ADTTMP=$(mktemp -d)
+ trap cleanup INT TERM EXIT
+fi
+
+cp -r 'test/' $ADTTMP
+cd $ADTTMP
+
+if [ -z "$tests" ]; then
+ # FIXME for now, we are excluding the tests for C extensions; couldn't figure
+ # out how to properly build them without building everything else
+ tests=$(find 'test/' -name 'test_*.rb' -and -not -path '*-ext-*' | sort)
+fi
+
+pass=0
+fail=0
+fail_expected=0
+total=0
+
+for t in $tests; do
+ if ruby2.3 test/runner.rb $t >log 2>&1; then
+ echo "PASS $t"
+ pass=$(($pass + 1))
+ else
+ if grep "^$t$" $KNOW_FAILURES; then
+ fail_expected=$(($fail_expected + 1))
+ echo "FAIL (EXPECTED) $t"
+ echo "FAIL (EXPECTED) $t" | sed -e 's/./-/g'
+ else
+ fail=$(($fail + 1))
+ echo "FAIL $t"
+ echo "FAIL $t" | sed -e 's/./-/g'
+ fi
+ echo
+ cat log
+ fi
+ total=$(($total + 1))
+done
+rm -f log
+
+echo
+echo "Finished"
+echo '--------'
+echo " Tests executed: $(($total))"
+echo " PASS: $pass"
+echo " FAIL: $fail"
+echo "EXPECTED FAILURES: $fail_expected"
+echo
+
+if [ $fail -gt 0 ]; then
+ exit 1
+fi