Class: Lrun::Result

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

Overview

Result of run.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cputimeFloat

Returns CPU time consumed, in seconds

Returns:

  • (Float)

    CPU time consumed, in seconds


81
82
83
# File 'lib/lrun.rb', line 81

def cputime
  @cputime
end

#exceedSymbol

Returns what limit exceed, :time if time limit exceeded, :memory if memory limit exceeded, :output if output limit exceeded, or nil if no limit exceeded

Returns:

  • (Symbol)

    what limit exceed, :time if time limit exceeded, :memory if memory limit exceeded, :output if output limit exceeded, or nil if no limit exceeded


81
82
83
# File 'lib/lrun.rb', line 81

def exceed
  @exceed
end

#exitcodeInteger

Returns exit code

Returns:

  • (Integer)

    exit code


81
82
83
# File 'lib/lrun.rb', line 81

def exitcode
  @exitcode
end

#memoryInteger

Returns peak memory used, in bytes

Returns:

  • (Integer)

    peak memory used, in bytes


81
82
83
# File 'lib/lrun.rb', line 81

def memory
  @memory
end

#signalInteger

Returns signal number received, or nil if exited normally

Returns:

  • (Integer)

    signal number received, or nil if exited normally


81
82
83
# File 'lib/lrun.rb', line 81

def signal
  @signal
end

#stderrString

Returns standard error output, or nil if stderr is redirected in options

Returns:

  • (String)

    standard error output, or nil if stderr is redirected in options


81
82
83
# File 'lib/lrun.rb', line 81

def stderr
  @stderr
end

#stdoutString

Returns standard output, or nil if it is redirected in options

Returns:

  • (String)

    standard output, or nil if it is redirected in options


81
82
83
# File 'lib/lrun.rb', line 81

def stdout
  @stdout
end

Instance Method Details

#clean?Boolean

Returns whether the program exited without crash and has a zero exit code

Returns:

  • (Boolean)

    whether the program exited without crash and has a zero exit code


109
110
111
# File 'lib/lrun.rb', line 109

def clean?
  exitcode.to_i == 0 && !crashed?
end

#crashed?Boolean

Returns whether the program crashed (exited by signal)

Returns:

  • (Boolean)

    whether the program crashed (exited by signal)


114
115
116
# File 'lib/lrun.rb', line 114

def crashed?
  !signal.nil?
end