Class: Benchcc::CompilationResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/benchcc/compiler.rb

Overview

Structure holding various information about the compilation of a file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeObject

Returns the value of attribute code

Returns:

  • (Object)

    the current value of code



11
12
13
# File 'lib/benchcc/compiler.rb', line 11

def code
  @code
end

#command_lineObject

Returns the value of attribute command_line

Returns:

  • (Object)

    the current value of command_line



11
12
13
# File 'lib/benchcc/compiler.rb', line 11

def command_line
  @command_line
end

#peak_memusgObject

Returns the value of attribute peak_memusg

Returns:

  • (Object)

    the current value of peak_memusg



11
12
13
# File 'lib/benchcc/compiler.rb', line 11

def peak_memusg
  @peak_memusg
end

#stderrObject

Returns the value of attribute stderr

Returns:

  • (Object)

    the current value of stderr



11
12
13
# File 'lib/benchcc/compiler.rb', line 11

def stderr
  @stderr
end

#stdoutObject

Returns the value of attribute stdout

Returns:

  • (Object)

    the current value of stdout



11
12
13
# File 'lib/benchcc/compiler.rb', line 11

def stdout
  @stdout
end

#wall_timeObject

Returns the value of attribute wall_time

Returns:

  • (Object)

    the current value of wall_time



11
12
13
# File 'lib/benchcc/compiler.rb', line 11

def wall_time
  @wall_time
end

Instance Method Details

#to_sObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/benchcc/compiler.rb', line 25

def to_s
  "command line: \#{command_line}\ncompilation time: \#{wall_time}\npeak memory usage: \#{peak_memusg}\n\#{'=' * 30} [begin code] \#{'=' * 30}\n\#{code}\n\#{'=' * 30} [end code] \#{'=' * 30}\n\n\#{'=' * 30} [begin stdout] \#{'=' * 30}\n\#{stdout}\n\#{'=' * 30} [end stdout] \#{'=' * 30}\n\n\#{'=' * 30} [begin stderr] \#{'=' * 30}\n\#{stderr}\n\#{'=' * 30} [end stderr] \#{'=' * 30}\n"
end