1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-08 10:04:21 +03:00
inform7/inform6/Tests/inform6.intest
2022-03-03 23:39:59 +00:00

94 lines
2.4 KiB
Plaintext

-cases [Main] 'inform6/Tests/Test Cases'
-problems [Main] 'inform6/Tests/Test Errors'
-groups 'inform6/Tests/Groups'
-recipe [Main]
set: $I6 = inform6/Tangled/inform6
set: $WORKSPACE = intest/Workspace
set: $ZINT = inform6/Tests/Assistants/dumb-frotz/dumb-frotz
set: $GINT = inform6/Tests/Assistants/dumb-glulx/glulxe/glulxe
set: $TOC = NO
! First we decide whether to compile it for the Z-machine or Glulx.
set: $VM = Z
if: $CASE %c*-G
set: $VM = G
endif
! On the basis of which:
if: $VM G
set: $EXT = ulx
set: $I6OPTIONS = -G
set: $INT = $GINT
set: $INTNAME = dumb-glulxe
set: $INTOPTIONS = -u -q
else
set: $EXT = z8
set: $I6OPTIONS =
set: $INT = $ZINT
set: $INTNAME = dumb-frotz
set: $INTOPTIONS = -w 1000
endif
set: $SETTINGS = $PATH/Settings/$CASE.txt
if exists: $SETTINGS
set: $I6OPTIONS = `$[`$SETTINGS$]
endif
mkdir: $PATH/_Transcript_Actual
mkdir: $PATH/_Transcript_Ideal
mkdir: $PATH/_Story_File_Actual
mkdir: $PATH/_Console_Actual
set: $I6CONSOLE = $PATH/_Console_Actual/$CASE.txt
set: $A = $PATH/_Transcript_Actual/$CASE.txt
set: $I = $PATH/_Transcript_Ideal/$CASE.txt
set: $IC = $PATH/_Console_Ideal/$CASE.txt
set: $I6SOURCE = $PATH/$CASE.inf
set: $STORYFILE = $PATH/_Story_File_Actual/$CASE.$EXT
! First, error message cases, where we require inform6 to fail and with the
! correct error messages.
if: $TYPE problem
debugger: lldb -f $I6 -- `$I6OPTIONS $I6SOURCE $STORYFILE
fail step: $I6 `$I6OPTIONS $I6SOURCE $STORYFILE >$I6CONSOLE 2>&1
or: 'failed to produce error messages' $I6CONSOLE
show: $I6CONSOLE
exists: $IC
or: 'produced error(s), but no ideal transcript existed'
match problem: $I6CONSOLE $IC
or: 'produced the wrong error(s)'
pass: 'passed'
endif
! And then the general case.
debugger: lldb -f $I6 -- `$I6OPTIONS $I6SOURCE $STORYFILE
step: $I6 `$I6OPTIONS $I6SOURCE $STORYFILE >$I6CONSOLE 2>&1
show: $I6CONSOLE
exists: $IC
or: 'compiled, but no ideal console output existed'
match problem: $I6CONSOLE $IC
or: 'compiled, but produced the wrong console output'
step: $INT `$INTOPTIONS $STORYFILE >$A 2>&1
or: 'compiled, but was unable to run $INTNAME (do you need to make interpreters?)'
exists: $I
or: 'compiled, but no ideal transcript existed'
if: $VM G
match glulxe transcript: $A $I
or: 'compiled, but played incorrectly'
else
match frotz transcript: $A $I
or: 'compiled, but played incorrectly'
endif
pass: 'passed'
-end