Skip to content

Commit

Permalink
Showing 2 changed files with 45 additions and 2 deletions.
40 changes: 40 additions & 0 deletions test/truffle/run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,47 @@
#!/bin/bash

PORT=8080

function wait_until_port_open {
until lsof -i :$PORT
do
sleep 1
done
sleep 1
}

echo "Building..."
mvn install -Pbootstrap

echo "Array#pack with real usage..."
bin/jruby -X+T test/truffle/pack-real-usage.rb

echo "Simple web server..."
bin/jruby -X+T test/truffle/simple-server.rb &
wait_until_port_open
curl http://localhost:$PORT/
kill -9 $!
wait

echo "Simple Webrick web server..."
bin/jruby -X+T test/truffle/simple-webrick-server.rb &
wait_until_port_open
curl http://localhost:$PORT/
kill -9 $!
wait

echo "Simple Rack web server..."
bin/jruby bin/gem install rack
bin/jruby -X+T -Ilib/ruby/gems/shared/gems/rack-1.6.1/lib test/truffle/simple-webrick-server.rb &
wait_until_port_open
curl http://localhost:$PORT/
kill -9 $!
wait

echo "Simple Sinatra web server..."
bin/jruby bin/gem install sinatra
bin/jruby -X+T -Ilib/ruby/gems/shared/gems/rack-1.6.1/lib -Ilib/ruby/gems/shared/gems/tilt-2.0.1/lib -Ilib/ruby/gems/shared/gems/rack-protection-1.5.3/lib -Ilib/ruby/gems/shared/gems/sinatra-1.4.6/lib test/truffle/simple-sinatra-server.rb &
wait_until_port_open
curl http://localhost:$PORT/
kill -9 $!
wait
7 changes: 5 additions & 2 deletions test/truffle/simple-sinatra-server.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
require 'sinatra'

# bin/jruby bin/gem install sinatra
# jt run -Ilib/ruby/gems/shared/gems/rack-1.6.1/lib -Ilib/ruby/gems/shared/gems/rack-protection-1.5.3/lib -Ilib/ruby/gems/shared/gems/sinatra-1.4.6/lib test/truffle/simple-sinatra-server.rb
get '/hello' do
# jt run -Ilib/ruby/gems/shared/gems/rack-1.6.1/lib -Ilib/ruby/gems/shared/gems/tilt-2.0.1/lib -Ilib/ruby/gems/shared/gems/rack-protection-1.5.3/lib -Ilib/ruby/gems/shared/gems/sinatra-1.4.6/lib test/truffle/simple-sinatra-server.rb

set :port, 8080

get '/' do
"Hello Sinatra!"
end

0 comments on commit db1d4b9

Please sign in to comment.