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-04 10:51:51 +00:00

113 lines
3 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
set: $EXECUTE = 1
! dumb-frotz crashes on this story file with "Fatal error: Text buffer overflow",
! but it is in fact correct
if: $CASE large_opcode_text_test
set: $EXECUTE = 0
endif
! similarly, glulxe does not like these: "This is neither a Glulx game file nor a Blorb file which contains one."
if: $CASE max_dynamic_strings_test_at63_mds_64-G
set: $EXECUTE = 0
endif
if: $CASE max_static_data_test_mqs_8001-G
set: $EXECUTE = 0
endif
if: $CASE max_dynamic_strings_test_str64_mds_65-G
set: $EXECUTE = 0
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'
if: $EXECUTE 1
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
endif
pass: 'passed'
-end