benchcc 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac43c2d0f69a588cc946b3b4694369b8557e6d2b
4
- data.tar.gz: 0ffb3562be2ed2a3376c5b595c8df9bf726142d3
3
+ metadata.gz: e1265188ac7addbc5b64c2333c04a01188169fd1
4
+ data.tar.gz: a4c62779f8f2cbe87e18de0dd3bf9ac3f965be3b
5
5
  SHA512:
6
- metadata.gz: 9d10754cb8c6c499c9125b8e015e6baebc7edbd9cd9a68bb9eacbd369cbd0e1d954756ad27f6cb6b55c099ec3fc1dc9b1daad85cdc96b94b97aee995cc3b4cf4
7
- data.tar.gz: 93bb0a5d5d111dc4ff88e9689a71f89556986b880eeb2a3608c46783bffc8761b46eede21fe0d6284df13e0d5d489c8a9a875f90a9dbcd3325e7c3f1b264552d
6
+ metadata.gz: 82fb539a1f350af27c819e0fc6446b7b45a49e4a8e0e3cf5a5ba349ccf60981c97d3c9ffcdd7812b209f757f7f08da458d461f6d86731da136dcedd5e53fc4b9
7
+ data.tar.gz: 8c5e23eeb3468af278b08a88d3454123ea96b9f477d211b2ab11fe993c7ccb010abcac750e7837f66406a3c1448a5741e344652278b4a94dce808f0783194385
@@ -24,20 +24,12 @@ module Benchcc
24
24
  ) do
25
25
  def to_s
26
26
  <<-EOS
27
- command line: #{command_line}
28
- compilation time: #{wall_time}
29
- peak memory usage: #{peak_memusg}
30
- #{'=' * 30} [begin code] #{'=' * 30}
31
- #{code}
32
- #{'=' * 30} [end code] #{'=' * 30}
33
-
34
- #{'=' * 30} [begin stdout] #{'=' * 30}
35
- #{stdout}
36
- #{'=' * 30} [end stdout] #{'=' * 30}
37
-
38
- #{'=' * 30} [begin stderr] #{'=' * 30}
27
+ > #{command_line}
39
28
  #{stderr}
40
- #{'=' * 30} [end stderr] #{'=' * 30}
29
+
30
+ [compiling:
31
+ #{code}
32
+ ]
41
33
  EOS
42
34
  end
43
35
  end
@@ -110,7 +102,23 @@ EOS
110
102
  raise CompilationError.new(result) unless status.success?
111
103
 
112
104
  result.peak_memusg = stderr.match(/(\d+)\s+maximum/)[1].to_i
113
- result.wall_time = stderr.match(/.+Total/).to_s.split[-3].to_f
105
+
106
+ section = -> (title) {
107
+ title.gsub!(' ', '\s')
108
+ /(
109
+ ===-+===\n
110
+ .*#{title}.*\n
111
+ ===-+===\n
112
+ (.|\n)+?(?====)
113
+ )|(
114
+ ===-+===\n
115
+ .*#{title}.*\n
116
+ ===-+===\n
117
+ (.|\n)+
118
+ )/x
119
+ }
120
+ result.wall_time = stderr.match(section["Miscellaneous Ungrouped Timers"])
121
+ .to_s.match(/(\d+\.?\d+).+?Total/)[1]
114
122
  return result
115
123
  end
116
124
 
@@ -1,3 +1,3 @@
1
1
  module Benchcc
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -30,16 +30,22 @@ describe Benchcc::Compiler do
30
30
 
31
31
  describe :guess_from_binary do
32
32
  it('can guess clang') {
33
- expect(Benchcc::Compiler.guess_from_binary(`which clang`.strip)).to be_instance_of(Benchcc::Clang)
33
+ expect(
34
+ Benchcc::Compiler.guess_from_binary(`which clang`.strip)
35
+ ).to be_instance_of(Benchcc::Clang)
34
36
  }
35
37
 
36
38
  # GCC is aliased to clang on OSX, so this test fails.
37
39
  # it('can guess gcc') {
38
- # expect(Benchcc::Compiler.guess_from_binary(`which gcc`.strip)).to be_instance_of(Benchcc::GCC)
40
+ # expect(
41
+ # Benchcc::Compiler.guess_from_binary(`which gcc`.strip)
42
+ # ).to be_instance_of(Benchcc::GCC)
39
43
  # }
40
44
 
41
45
  it('fails otherwise') {
42
- expect { Benchcc::Compiler.guess_from_binary('not_a_compiler') }.to raise_error
46
+ expect {
47
+ Benchcc::Compiler.guess_from_binary('not_a_compiler')
48
+ }.to raise_error
43
49
  }
44
50
  end
45
51
  end
@@ -60,7 +66,9 @@ end
60
66
  }
61
67
 
62
68
  it('returns statistics on valid input') {
63
- expect(@cc.compile_file(@valid, '-o /dev/null')).to be_instance_of(Benchcc::CompilationResult)
69
+ expect(
70
+ @cc.compile_file(@valid, '-o /dev/null')
71
+ ).to be_instance_of(Benchcc::CompilationResult)
64
72
  }
65
73
  end
66
74
  end
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.6
4
+ version: 0.0.7
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-07-24 00:00:00.000000000 Z
11
+ date: 2014-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gnuplot