Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

run performance tests on travisci

  • Loading branch information...
commit 5fa1e22db6fabbfabc88f371f6929cd8167fe21c 1 parent 5a65714
@mwotton authored
Showing with 18 additions and 18 deletions.
  1. +1 −1  .travis.yml
  2. +17 −17 spec/hubris_spec.rb
View
2  .travis.yml
@@ -8,5 +8,5 @@ before_script:
- cabal update
- bundle exec rake
script:
- - PATH=$HOME/.cabal/bin:$PATH bundle exec rspec spec/hubris_spec.rb
+ - PERF_TEST=1 PATH=$HOME/.cabal/bin:$PATH bundle exec rspec spec/hubris_spec.rb
env: HUBRIS_DIR=/tmp/hubris
View
34 spec/hubris_spec.rb
@@ -412,26 +412,26 @@ class Second
it "behaves concurrently" do
# create a bunch of ruby threads which all call a given Haskell function
# repeatedly. Checks that we get the right result, and that we don't crash.
- pending "Don't wanna run this every time"
- no_threads = 10
- reps=1000
- class ConcTest
- hubris :inline => "sumInts :: Int -> Int; sumInts n = sum [0..n]"
- end
- t = ConcTest.new
+ if ENV['PERFORMANCE_TEST']
+ no_threads = 10
+ reps=1000
+ class ConcTest
+ hubris :inline => "sumInts :: Int -> Int; sumInts n = sum [0..n]"
+ end
+ t = ConcTest.new
- res = (0..no_threads).map { |n| (0..n).inject { |sum,n| sum+n } }
- threads = []
- lambda {
- (0..no_threads).each { |n|
- threads << Thread.start(n) { |x|
- reps.times { t.sumInts(x).should eql(res[x]) }
+ res = (0..no_threads).map { |n| (0..n).inject { |sum,n| sum+n } }
+ threads = []
+ lambda {
+ (0..no_threads).each { |n|
+ threads << Thread.start(n) { |x|
+ reps.times { t.sumInts(x).should eql(res[x]) }
+ }
}
- }
- threads.each { |t| t.join }
- }.should_not raise_error
+ threads.each { |t| t.join }
+ }.should_not raise_error
+ end
end
-
end
describe "IO" do
Please sign in to comment.
Something went wrong with that request. Please try again.