-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 mkdir: $PATH/_Story_File_Actual mkdir: $PATH/_Console_Actual set: $AC = $PATH/_Console_Actual/$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 >$AC 2>&1 or: 'failed to produce error messages' $AC show: $AC exists: $IC or: 'produced error(s), but no ideal transcript existed' match i6 transcript: $AC $IC or: 'produced the wrong error(s)' pass: 'passed' endif ! And then the general case. mkdir: $PATH/_Transcript_Actual mkdir: $PATH/_Transcript_Ideal mkdir: $PATH/_md5_Actual set: $AMD5 = $PATH/_md5_Actual/$CASE.txt set: $IMD5 = $PATH/_md5_Ideal/$CASE.txt set: $A = $PATH/_Transcript_Actual/$CASE.txt set: $I = $PATH/_Transcript_Ideal/$CASE.txt debugger: lldb -f $I6 -- `$I6OPTIONS $I6SOURCE $STORYFILE step: $I6 `$I6OPTIONS $I6SOURCE $STORYFILE >$AC 2>&1 show: $AC exists: $IC or: 'compiled, but no ideal console output existed' match i6 transcript: $AC $IC or: 'compiled, but produced the wrong console output' if: $VM G step: echo ${glulx:$STORYFILE$} >$AMD5 else step: echo ${zmachine:$STORYFILE$} >$AMD5 endif if exists: $IMD5 match text: $AMD5 $IMD5 or: 'compiled, but produced the wrong md5 checksum' pass: 'passed, no need to run because md5 correct' endif if: $EXECUTE 1 set: $SCRIPT = $PATH/_Scripts/$CASE.txt if exists: $SCRIPT step: $INT `$INTOPTIONS $STORYFILE <$SCRIPT >$A 2>&1 or: 'compiled, but was unable to run $INTNAME (do you need to make interpreters?)' else step: $INT `$INTOPTIONS $STORYFILE >$A 2>&1 or: 'compiled, but was unable to run $INTNAME (do you need to make interpreters?)' endif 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