Przeglądaj źródła

Initial script for testing ruby and jruby

Joe Ferguson 11 lat temu
rodzic
commit
db878afed6
3 zmienionych plików z 127 dodań i 0 usunięć
  1. 4 0
      test/.config.sh
  2. 104 0
      test/tests/ruby-artifacts/stdlibs.rb
  3. 19 0
      test/tests/ruby.sh

+ 4 - 0
test/.config.sh

@@ -7,12 +7,16 @@ globalTests=(
 
 declare -A testAlias=(
 	[pypy]='python'
+	[jruby]='ruby'
 )
 
 declare -A imageTests=(
 	[python]='
 		python
 	'
+	[ruby]='
+		ruby
+	'
 # example onbuild
 #	[python:onbuild]='
 #		py-onbuild

+ 104 - 0
test/tests/ruby-artifacts/stdlibs.rb

@@ -0,0 +1,104 @@
+stdlib = [
+	'abbrev',
+	'base64',
+	'benchmark',
+	'bigdecimal',
+	'cgi',
+	'cmath',
+	'coverage',
+	'csv',
+	'date',
+	'dbm',
+	'delegate',
+	'digest',
+	'drb',
+	'e2mmap',
+	'erb',
+	'etc',
+	'expect',
+	'fcntl',
+	'fiddle',
+	'fileutils',
+	'find',
+	'forwardable',
+	'gdbm',
+	'getoptlong',
+	'io/console',
+	'io/nonblock',
+	'io/wait',
+	'ipaddr',
+	'irb',
+	'json',
+	'logger',
+	'mathn',
+	'matrix',
+	'mkmf',
+	'monitor',
+	'mutex_m',
+	'net/ftp',
+	'net/http',
+	'net/imap',
+	'net/pop',
+	'net/smtp',
+	'net/telnet',
+	'nkf',
+	'objspace',
+	'observer',
+	'open-uri',
+	'open3',
+	'openssl',
+	'optparse',
+	'ostruct',
+	'pathname',
+	'pp',
+	'prettyprint',
+	'prime',
+# prints all sorts of info to stderr, not easy to test right now
+#	'profile',
+	'profiler',
+	'pstore',
+	'psych',
+	'pty',
+	'rake',
+	'rdoc',
+	'readline',
+	'resolv',
+	'resolv-replace',
+	'ripper',
+	'rss',
+	'rubygems',
+	'scanf',
+	'sdbm',
+	'securerandom',
+	'set',
+	'shell',
+	'shellwords',
+	'singleton',
+	'socket',
+	'stringio',
+	'strscan',
+	'sync',
+	'syslog',
+	'tempfile',
+	'thread',
+	'thwait',
+	'time',
+	'timeout',
+	'tmpdir',
+	'tracer',
+	'tsort',
+	'un',
+	'uri',
+	'weakref',
+	'webrick',
+	'xmlrpc',
+	'yaml',
+	'zlib'
+]
+
+stdlib.each do |lib|
+	#puts "Testing #{lib}"
+	require lib
+end
+
+puts 'ok'

+ 19 - 0
test/tests/ruby.sh

@@ -0,0 +1,19 @@
+#!/bin/bash
+set -e
+
+for artifact in "$(dirname "$(readlink -f "$BASH_SOURCE")")"/ruby-artifacts/*; do
+	inContainerPath="/tmp/$(basename "$artifact")"
+	case "$artifact" in
+		*.rb) cmd=( ruby "$inContainerPath" ) ;;
+		*.sh) cmd=( "$inContainerPath" ) ;;
+		*)    continue ;;
+	esac
+	if ! ret="$(docker run --rm -v "$artifact":"$inContainerPath":ro "$1" "${cmd[@]}")"; then
+		echo >&2 "error: '$artifact' failed! got $ret"
+		exit 1
+	fi
+	if [ "$ret" != "ok" ]; then
+		echo >&2 "error: expected 'ok', got '$ret'"
+		exit 1
+	fi
+done