# file      : tests/test/script/runner/status.testscript
# license   : MIT; see accompanying LICENSE file

.include ../common.testscript

b += --no-column

: eq
:
{
  : true
  :
  $c <'$* == 0' && $b

  : false
  :
  $c <'$* -s 1 == 0' && $b 2>>/~%EOE%d != 0
  %testscript:1: error: ../../../../driver(.exe)? exit code 1 != 0%
    info: test id: 1
  EOE
}

: ne
:
{
  : true
  :
  $c <'$* -s 1 != 0' && $b

  : false
  :
  $c <'$* -s 1 != 1' && $b 2>>/~%EOE% != 0
  %testscript:1: error: ../../../../driver(.exe)? exit code 1 == 1%
    info: test id: 1
  EOE
}

: error
:
$c <'$* -s 1 -e "Error"' && $b 2>>/~%EOE% != 0
%testscript:1: error: ../../../driver(.exe)? exited with code 1%
  info: stderr: test/1/stderr
Error
  info: test id: 1
EOE

: error-check
:
$c <'$* -s 1 -e "Error" == 0' && $b 2>>/~%EOE% != 0
%testscript:1: error: ../../../driver(.exe)? exit code 1 != 0%
  info: stderr: test/1/stderr
Error
  info: test id: 1
EOE

#\
: segmentation-fault
:
: Can pop up dialog boxes on Windows or produce coredump on POSIX. Note that
: under Wine some extra info is printed to STDOUT.
:
$c <'$* -t m' && $b 2>>/~%EOE% != 0
%wine: .+%?
%testscript:1: error: ../../../driver(.exe)? terminated abnormally%d
%  info: .+%
%  info: stdout: test\\1\\stdout%?
EOE
#\