benchcc 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b18fb775fea70370faf90356bb9647e81a0d819
4
- data.tar.gz: 584a94fea80bbfce44779943ebe21c764a988c25
3
+ metadata.gz: c7748c9c22e06d6b849fe2b2bcbfb0b656da2d86
4
+ data.tar.gz: f16027a06f20dd5f994c5c64935c2acdc4dae328
5
5
  SHA512:
6
- metadata.gz: ae28ec0d16ad7e686ee70f6d5bc4ec63fb5f8691b8ccde7fc7598f9115595af01dfac12dd524d31067e33e000cb3d46e5722d99372d4b1207a1b095fc7f22fbd
7
- data.tar.gz: e1941930207bdc7cf46cbcb81f8e1b8773febe8a9b9f39aa48cd826c3c61fc8300d713c32aa6fa2a1305c7d386786f620bf74e171785a9b9cd9c7ce81c59128e
6
+ metadata.gz: cf8617a11e5eae06eefa8f77579373d74edb09fa34a5a8d2d481edc41da1c75e2db5077ab35c384b51460bbb84ccccfbfaff2bc10f887c8380982e80fbbf7dca
7
+ data.tar.gz: c3cbc63365ebfe9b75b7a9169f99fdbb4eb332dc3328bc597c27c2289d051d36a80fc03371f4b2c62213d51c4f04f191e62ac0ef2794ad20ea23188539e3c3f8
@@ -76,12 +76,12 @@ module Benchcc
76
76
  end
77
77
 
78
78
  if features.include?(:execution_time)
79
- command = "/usr/bin/time #{tmp_dir}/a.out"
79
+ command = "#{tmp_dir}/a.out"
80
80
  stdout, stderr, status = Timeout::timeout(execution_timeout) {
81
81
  Open3.capture3(command)
82
82
  }
83
83
  if status.success?
84
- time = stderr.match(/(\d+\.?\d*)\s+real/)[1]
84
+ time = stdout.match(/execution time: (\d+\.?\d*)/)[1]
85
85
  stats.merge!({execution_time: time})
86
86
  else
87
87
  raise ExecutionError.new(<<-EOS.strip_heredoc
data/lib/benchcc/plot.rb CHANGED
@@ -20,7 +20,7 @@ module Benchcc
20
20
 
21
21
  execution_time: -> (plot) {
22
22
  plot.ylabel 'Execution time'
23
- plot.format 'y \'%.2g s\''
23
+ plot.format 'y \'%.0f µs\''
24
24
  }
25
25
  }
26
26
 
@@ -1,3 +1,3 @@
1
1
  module Benchcc
2
- VERSION = "0.0.15"
2
+ VERSION = "0.0.16"
3
3
  end
@@ -45,7 +45,7 @@ require 'rspec'
45
45
  input_file: @valid,
46
46
  features: [:execution_time, :compilation_time, :memory_usage],
47
47
  compiler_executable: executable,
48
- compiler_options: ['-o/dev/null'],
48
+ compiler_options: [],
49
49
  compilation_timeout: 10,
50
50
  execution_timeout: 10
51
51
  )
data/spec/src/valid.cpp CHANGED
@@ -1,7 +1,6 @@
1
- #include <chrono>
2
- #include <thread>
1
+ #include <iostream>
3
2
 
4
3
 
5
4
  int main() {
6
- std::this_thread::sleep_for(std::chrono::milliseconds(1));
5
+ std::cout << "execution time: 3.1" << std::endl;
7
6
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benchcc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Louis Dionne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-26 00:00:00.000000000 Z
11
+ date: 2014-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gnuplot