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
  <<-EOS
command line: #{command_line}
compilation time: #{wall_time}
peak memory usage: #{peak_memusg}
#{'=' * 30} [begin code] #{'=' * 30}
#{code}
#{'=' * 30} [end code] #{'=' * 30}

#{'=' * 30} [begin stdout] #{'=' * 30}
#{stdout}
#{'=' * 30} [end stdout] #{'=' * 30}

#{'=' * 30} [begin stderr] #{'=' * 30}
#{stderr}
#{'=' * 30} [end stderr] #{'=' * 30}
EOS
end