1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-05-02 00:59:37 +03:00
inform7/inform7/Tests/inform7.intest

681 lines
22 KiB
Plaintext

-set extensions_testing_area 'inform7/Tests/Test Extensions'
-set hash_cache 'inform7/Tests/hashes.intest'
-set CCOMPILER 'set-me-to-some-c-compiler-please'
-set CLINKER 'set-me-to-some-c-linker-please'
-set EXESUFFIX ''
-set MAKEFLAGS '-s'
-set LINKFLAGS ''
-if MacOS -set CCOMPILER 'clang -g -std=c11 -ferror-limit=10000 -Wno-unused-value -c'
-if MacOS -set CLINKER 'clang -g -ferror-limit=10000'
-if Windows -set CCOMPILER 'x86_64-w64-mingw32-clang -g -std=c11 -ferror-limit=10000 -Wno-unused-value -c'
-if Windows -set CLINKER 'x86_64-w64-mingw32-clang -g -ferror-limit=10000'
-if Windows -set EXESUFFIX '.exe'
-if Windows -set MAKEFLAGS '-s --no-print-directory'
-if linux -set CCOMPILER 'gcc -g -std=c11 -fmax-errors=10000 -c'
-if linux -set CLINKER 'gcc -g'
-if linux -set LINKFLAGS '-lm -pthread'
-if linux -set MAKEFLAGS '-s --no-print-directory'
-case [Diagnostics] 'inform7/Tests/GenerateDiagnostics-G.txt'
-cases [Main] 'inform7/Tests/Test Cases'
-if macos -cases [Release] 'inform7/Tests/Test Releases'
-cases [Basic] 'inform7/Tests/Test Basic'
-cases [Internal] 'inform7/Tests/Test Internals'
-cases [Make] 'inform7/Tests/Test Makes'
-cases [Filing] 'inform7/Tests/Test Filings'
-extension [Main] 'inform7/Internal/Extensions/Emily Short/Complex Listing.i7x'
-extension [Main] 'inform7/Internal/Extensions/Emily Short/Inanimate Listeners.i7x'
-extension [Main] 'inform7/Internal/Extensions/Emily Short/Locksmith.i7x'
-extension [Main] 'inform7/Internal/Extensions/Emily Short/Punctuation Removal.i7x'
-extension [Main] 'inform7/Internal/Extensions/Emily Short/Skeleton Keys.i7x'
-extensions [Main] 'inform7/Internal/Extensions/Graham Nelson'
-examples [Main] resources/Documentation/Examples
-problems [Main] 'inform7/Tests/Test Problems'
-singular temp
-singular temp-G
-singular GenerateDiagnostics-G
-groups 'inform7/Tests/Groups'
-recipe [Main]
set: $I6 = inform6/Tangled/inform6
set: $I7 = inform7/Tangled/inform7
set: $INTERNAL = inform7/Internal
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
if: $CASE %c*-C
set: $VM = G
set: $TOC = YES
endif
if: $CASE %c*Metric%c*Units%c*
set: $VM = G
endif
! On the basis of which:
if: $VM G
set: $FORMAT = Inform6/32
set: $EXT = ulx
set: $I6OPTIONS = -E2SDwGx
set: $INT = $GINT
set: $INTNAME = dumb-glulxe
set: $INTOPTIONS = -u -q
else
set: $FORMAT = Inform6/16
set: $EXT = z8
set: $I6OPTIONS = -E2SDwv8x
set: $INT = $ZINT
set: $INTNAME = dumb-frotz
set: $INTOPTIONS = -w 1000
endif
! Now we extract the source text from whatever file originated the test
! case: this is a non-trivial operation when the file is an Extension or
! an example, but is a simple copy operation otherwise.
extract: $WORK/Example.inform/Source/story.ni $VM
! Test cases from map indexing problem messages require ni to get as far as
! indexing, so the -no-index option mustn't be used in this case.
mkdir: $WORK/Transient
step: find $WORK/Transient -mindepth 1 -delete
mkdir: $PATH/_Results_Actual
mkdir: $PATH/_Results_Ideal
if: $CASE PM_Map%c*
set: $I7OPTIONS = -format=$FORMAT -no-progress -no-resource-checking -fixtime -rng -sigils -log nothing -external inform7/Tests -transient $WORK/Transient -no-census-update -internal $INTERNAL
else
set: $I7OPTIONS = -format=$FORMAT -no-progress -no-resource-checking -fixtime -rng -sigils -log nothing -external inform7/Tests -transient $WORK/Transient -no-index -internal $INTERNAL
endif
set: $PIPELINE =
! First, problem message cases, where we require ni to fail and with the
! correct output.
if: $TYPE problem
set: $A = $PATH/_Results_Actual/$CASE.txt
set: $I = $PATH/_Results_Ideal/$CASE.txt
debugger: lldb -f $I7 -- `$I7OPTIONS -require-problem $CASE -project $WORK/Example.inform $PIPELINE -crash-all
fail step: $I7 `$I7OPTIONS -require-problem $CASE -project $WORK/Example.inform $PIPELINE >$A 2>&1
or: 'failed to produce its namesake Problem message' $A
show: $A
exists: $I
or: 'produced Problem(s), but no ideal transcript existed'
match problem: $A $I
or: 'produced the wrong Problem message(s)'
pass: 'passed'
endif
step: rm -f notebook.glkdata prefs.glkdata barbara.glkdata
! And then the general case.
set: $I7CONSOLE = $WORK/Example.inform/Build/i7_output.txt
if: $TOC YES
mkdir: $PATH/_Textual
mkdir: $PATH/_C
set: $I7CLIB = inform7/Internal/Miscellany
set: $TOUT = $PATH/_Textual/$CASE.intert
set: $COUT = $PATH/_C/$CASE.c
set: $OFILE = $WORK/Example.inform/Build/$CASE.o
step: $I7 -fixtime -rng -sigils -format=C $WORK/Example.inform/Source/story.ni -variable *tout=$TOUT -o $COUT `$PIPELINE >$I7CONSOLE 2>&1
or: 'failed with Problem message(s)' $I7CONSOLE
set: $CCCONSOLE = $WORK/Example.inform/Build/cc_output.txt
set: $LINKCONSOLE = $WORK/Example.inform/Build/link_output.txt
set: $STORYFILE = $WORK/Example.inform/Build/final$$EXESUFFIX
step: `$$CCOMPILER -o $OFILE $COUT -I $I7CLIB >$CCCONSOLE 2>&1
or: 'failed to compile C' $CCCONSOLE
step: `$$CLINKER -o $STORYFILE $OFILE `$$LINKFLAGS >$LINKCONSOLE 2>&1
or: 'failed to link C' $LINKCONSOLE
set: $A = $PATH/_Results_Actual/$CASE.txt
set: $I = $PATH/_Results_Ideal/$CASE.txt
step: $STORYFILE <$SCRIPT >$A 2>&1
or: 'failed to run C program' $A
show: $A
match text: $A $I
or: 'C program misbehaved'
step: rm -f notebook.glkdata prefs.glkdata barbara.glkdata
pass: 'passed'
else
debugger: lldb -f $I7 -- `$I7OPTIONS -format=$FORMAT -project $WORK/Example.inform $PIPELINE -crash-all
step: $I7 `$I7OPTIONS -format=$FORMAT -project $WORK/Example.inform $PIPELINE >$I7CONSOLE 2>&1
or: 'failed with Problem message(s)' $I7CONSOLE
show: $I7CONSOLE
set: $I6SOURCE = $WORK/Example.inform/Build/auto.inf
hash: $I6SOURCE $WORK/Example.inform/Build/checksum.txt
or: 'passed (matching cached I6 known to work)'
set: $I6CONSOLE = $WORK/Example.inform/Build/i6_output.txt
set: $STORYFILE = $WORK/Example.inform/Build/output.$EXT
step: $I6 `$I6OPTIONS $I6SOURCE $STORYFILE >$I6CONSOLE 2>&1
or: 'failed to pass through Inform 6' $I6CONSOLE
show i6: $I6CONSOLE
set: $A = $PATH/_Results_Actual/$CASE.txt
set: $I = $PATH/_Results_Ideal/$CASE.txt
step: $INT `$INTOPTIONS $STORYFILE <$SCRIPT >$A 2>&1
or: 'unable to run $INTNAME (do you need to make interpreters?)'
exists: $I
or: 'translated successfully but no ideal transcript existed'
if: $VM G
match glulxe transcript: $A $I
or: 'played incorrectly'
else
match frotz transcript: $A $I
or: 'played incorrectly'
endif
step: rm -f notebook.glkdata prefs.glkdata barbara.glkdata
pass: 'passed'
endif
-end
-recipe [Basic]
set: $I6 = inform6/Tangled/inform6
set: $I7 = inform7/Tangled/inform7
set: $INTERNAL = inform7/Internal
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
if: $CASE %c*-C
set: $VM = G
set: $TOC = YES
endif
if: $CASE %c*Metric%c*Units%c*
set: $VM = G
endif
! On the basis of which:
if: $VM G
set: $FORMAT = Inform6/32
set: $EXT = ulx
set: $I6OPTIONS = -E2SDwGx
set: $INT = $GINT
set: $INTNAME = dumb-glulxe
set: $INTOPTIONS = -u -q
else
set: $FORMAT = Inform6/16
set: $EXT = z8
set: $I6OPTIONS = -E2SDwv8x
set: $INT = $ZINT
set: $INTNAME = dumb-frotz
set: $INTOPTIONS = -w 1000
endif
! Now we extract the source text from whatever file originated the test
! case: this is a non-trivial operation when the file is an Extension or
! an example, but is a simple copy operation otherwise.
extract: $WORK/Example.inform/Source/story.ni $VM
! Test cases from map indexing problem messages require ni to get as far as
! indexing, so the -no-index option mustn't be used in this case.
mkdir: $WORK/Transient
step: find $WORK/Transient -mindepth 1 -delete
mkdir: $PATH/_Results_Actual
mkdir: $PATH/_Results_Ideal
if: $CASE PM_Map%c*
set: $I7OPTIONS = -basic -format=$FORMAT -no-progress -no-resource-checking -fixtime -rng -sigils -log nothing -external inform7/Tests -transient $WORK/Transient -internal $INTERNAL
else
set: $I7OPTIONS = -basic -format=$FORMAT -no-progress -no-resource-checking -fixtime -rng -sigils -log nothing -external inform7/Tests -transient $WORK/Transient -no-index -internal $INTERNAL
endif
set: $PIPELINE =
if: $TOC YES
if: $CASE Red-%c*
set: $PIPELINE = -pipeline compile-reduced
endif
endif
! First, problem message cases, where we require ni to fail and with the
! correct output.
if: $TYPE problem
set: $A = $PATH/_Results_Actual/$CASE.txt
set: $I = $PATH/_Results_Ideal/$CASE.txt
debugger: lldb -f $I7 -- `$I7OPTIONS -require-problem $CASE -project $WORK/Example.inform $PIPELINE -crash-all
fail step: $I7 `$I7OPTIONS -require-problem $CASE -project $WORK/Example.inform $PIPELINE >$A 2>&1
or: 'failed to produce its namesake Problem message' $A
show: $A
exists: $I
or: 'produced Problem(s), but no ideal transcript existed'
match problem: $A $I
or: 'produced the wrong Problem message(s)'
pass: 'passed'
endif
if: $TOC YES
mkdir: $PATH/_Textual
mkdir: $PATH/_C
set: $I7OPTIONS = -basic -format=$FORMAT -no-progress -no-resource-checking -fixtime -rng -sigils -log nothing -external inform7/Tests -transient $WORK/Transient -no-index -internal $INTERNAL
set: $I7CLIB = inform7/Internal/Miscellany
set: $I7CONSOLE = $WORK/Example.inform/Build/i7_output.txt
set: $TOUT = $PATH/_Textual/$CASE.intert
set: $COUT = $PATH/_C/$CASE.c
set: $OFILE = $WORK/Example.inform/Build/$CASE.o
step: $I7 -fixtime -rng -sigils -basic -format=C $WORK/Example.inform/Source/story.ni -variable *tout=$TOUT -o $COUT `$PIPELINE >$I7CONSOLE 2>&1
or: 'failed with Problem message(s)' $I7CONSOLE
set: $CCCONSOLE = $WORK/Example.inform/Build/cc_output.txt
set: $LINKCONSOLE = $WORK/Example.inform/Build/link_output.txt
set: $STORYFILE = $WORK/Example.inform/Build/final$$EXESUFFIX
step: `$$CCOMPILER -o $OFILE $COUT -I $I7CLIB >$CCCONSOLE 2>&1
or: 'failed to compile C' $CCCONSOLE
step: `$$CLINKER -o $STORYFILE $OFILE `$$LINKFLAGS >$LINKCONSOLE 2>&1
or: 'failed to link C' $LINKCONSOLE
set: $A = $PATH/_Results_Actual/$CASE.txt
set: $I = $PATH/_Results_Ideal/$CASE.txt
step: $STORYFILE >$A 2>&1
or: 'failed to run C program' $A
show: $A
match text: $A $I
or: 'C program misbehaved'
pass: 'passed'
else
! And then the general case.
set: $I7CONSOLE = $WORK/Example.inform/Build/i7_output.txt
debugger: lldb -f $I7 -- `$I7OPTIONS -format=$FORMAT -project $WORK/Example.inform $PIPELINE -crash-all
step: $I7 `$I7OPTIONS -format=$FORMAT -project $WORK/Example.inform $PIPELINE >$I7CONSOLE 2>&1
or: 'failed with Problem message(s)' $I7CONSOLE
show: $I7CONSOLE
set: $I6SOURCE = $WORK/Example.inform/Build/auto.inf
hash: $I6SOURCE $WORK/Example.inform/Build/checksum.txt
or: 'passed (matching cached I6 known to work)'
set: $I6CONSOLE = $WORK/Example.inform/Build/i6_output.txt
set: $STORYFILE = $WORK/Example.inform/Build/output.$EXT
step: $I6 `$I6OPTIONS $I6SOURCE $STORYFILE >$I6CONSOLE 2>&1
or: 'failed to pass through Inform 6' $I6CONSOLE
show i6: $I6CONSOLE
set: $A = $PATH/_Results_Actual/$CASE.txt
set: $I = $PATH/_Results_Ideal/$CASE.txt
step: $INT `$INTOPTIONS $STORYFILE >$A 2>&1
or: 'unable to run $INTNAME (do you need to make interpreters?)'
show transcript: $A
exists: $I
or: 'translated successfully but no ideal transcript existed'
if: $VM G
match glulxe transcript: $A $I
or: 'played incorrectly'
else
match frotz transcript: $A $I
or: 'played incorrectly'
endif
pass: 'passed'
endif
-end
-recipe [Filing]
set: $I6 = inform6/Tangled/inform6
set: $I7 = inform7/Tangled/inform7
set: $INTERNAL = inform7/Internal
set: $WORKSPACE = intest/Workspace
set: $GINT = inform6/Tests/Assistants/dumb-glulx/glulxe/glulxe
set: $TOC = NO
set: $VM = G
if: $CASE %c*-C
set: $TOC = YES
endif
set: $FORMAT = Inform6/32
set: $EXT = ulx
set: $I6OPTIONS = -E2SDwGx
set: $INT = $GINT
set: $INTNAME = dumb-glulxe
set: $INTOPTIONS = -u -q
set: $SETTINGS = $PATH/_Settings/$CASE.txt
if exists: $SETTINGS
set: $INTOPTIONS = -u -q `$[`$SETTINGS$]
endif
! Now we extract the source text from whatever file originated the test
! case: this is a non-trivial operation when the file is an Extension or
! an example, but is a simple copy operation otherwise.
extract: $WORK/Example.inform/Source/story.ni $VM
! Test cases from map indexing problem messages require ni to get as far as
! indexing, so the -no-index option mustn't be used in this case.
mkdir: $WORK/Transient
step: find $WORK/Transient -mindepth 1 -delete
mkdir: $PATH/_Results_Actual
mkdir: $PATH/_Results_Ideal
set: $I7OPTIONS = -basic -format=$FORMAT -no-progress -no-resource-checking -fixtime -rng -sigils -log nothing -external inform7/Tests -transient $WORK/Transient -no-index -internal $INTERNAL
set: $PIPELINE =
if: $TOC YES
mkdir: $PATH/_Textual
mkdir: $PATH/_C
set: $I7OPTIONS = -basic -format=$FORMAT -no-progress -no-resource-checking -fixtime -rng -sigils -log nothing -external inform7/Tests -transient $WORK/Transient -no-index -internal $INTERNAL
set: $I7CLIB = inform7/Internal/Miscellany
set: $I7CONSOLE = $WORK/Example.inform/Build/i7_output.txt
set: $TOUT = $PATH/_Textual/$CASE.intert
set: $COUT = $PATH/_C/$CASE.c
set: $OFILE = $WORK/Example.inform/Build/$CASE.o
step: $I7 -fixtime -rng -sigils -basic -format=C $WORK/Example.inform/Source/story.ni -variable *tout=$TOUT -o $COUT `$PIPELINE >$I7CONSOLE 2>&1
or: 'failed with Problem message(s)' $I7CONSOLE
set: $CCCONSOLE = $WORK/Example.inform/Build/cc_output.txt
set: $LINKCONSOLE = $WORK/Example.inform/Build/link_output.txt
set: $STORYFILE = $WORK/Example.inform/Build/final$$EXESUFFIX
step: `$$CCOMPILER -o $OFILE $COUT -I $I7CLIB >$CCCONSOLE 2>&1
or: 'failed to compile C' $CCCONSOLE
step: `$$CLINKER -o $STORYFILE $OFILE `$$LINKFLAGS >$LINKCONSOLE 2>&1
or: 'failed to link C' $LINKCONSOLE
set: $A = $PATH/_Results_Actual/$CASE.txt
set: $I = $PATH/_Results_Ideal/$CASE.txt
step: $STORYFILE >$A 2>&1
or: 'failed to run C program' $A
show: $A
match text: $A $I
or: 'C program misbehaved'
pass: 'passed'
else
! And then the general case.
set: $I7CONSOLE = $WORK/Example.inform/Build/i7_output.txt
debugger: lldb -f $I7 -- `$I7OPTIONS -format=$FORMAT -project $WORK/Example.inform $PIPELINE -crash-all
step: $I7 `$I7OPTIONS -format=$FORMAT -project $WORK/Example.inform $PIPELINE >$I7CONSOLE 2>&1
or: 'failed with Problem message(s)' $I7CONSOLE
show: $I7CONSOLE
set: $I6SOURCE = $WORK/Example.inform/Build/auto.inf
hash: $I6SOURCE $WORK/Example.inform/Build/checksum.txt
or: 'passed (matching cached I6 known to work)'
set: $I6CONSOLE = $WORK/Example.inform/Build/i6_output.txt
set: $STORYFILE = $WORK/Example.inform/Build/output.$EXT
step: $I6 `$I6OPTIONS $I6SOURCE $STORYFILE >$I6CONSOLE 2>&1
or: 'failed to pass through Inform 6' $I6CONSOLE
show i6: $I6CONSOLE
set: $A = $PATH/_Results_Actual/$CASE.txt
set: $I = $PATH/_Results_Ideal/$CASE.txt
step: $INT `$INTOPTIONS $STORYFILE >$A 2>&1
or: 'unable to run $INTNAME (do you need to make interpreters?)'
show transcript: $A
exists: $I
or: 'translated successfully but no ideal transcript existed'
match glulxe transcript: $A $I
or: 'played incorrectly'
pass: 'passed'
endif
-end
-recipe [Internal]
set: $I6 = inform6/Tangled/inform6
set: $I7 = inform7/Tangled/inform7
set: $INTERNAL = inform7/Internal
set: $WORKSPACE = intest/Workspace
! First we decide whether to compile it for the Z-machine or Glulx.
set: $VM = Z
if: $CASE %c*-G
set: $VM = G
endif
if: $CASE %c*Metric%c*Units%c*
set: $VM = G
endif
! On the basis of which:
if: $VM G
set: $FORMAT = Inform6/32
set: $EXT = ulx
else
set: $FORMAT = Inform6/16
set: $EXT = z8
endif
! Now we extract the source text from whatever file originated the test
! case: this is a non-trivial operation when the file is an Extension or
! an example, but is a simple copy operation otherwise.
extract: $WORK/Example.inform/Source/story.ni $VM
mkdir: $PATH/_Results_Actual
mkdir: $PATH/_Results_Ideal
set: $PIPELINE =
if: $CASE %c*-BIP
set: $I7OPTIONS = -basic -format=$FORMAT -no-progress -no-resource-checking -fixtime -rng -sigils -log nothing -external inform7/Tests -transient $WORK/Transient -no-index -internal $INTERNAL
else
set: $I7OPTIONS = -format=$FORMAT -no-progress -no-resource-checking -fixtime -rng -sigils -log nothing -external inform7/Tests -transient $WORK/Transient -no-index -internal $INTERNAL
endif
set: $A = $PATH/_Results_Actual/$CASE.txt
set: $I = $PATH/_Results_Ideal/$CASE.txt
set: $I7CONSOLE = $WORK/Example.inform/Build/i7_output.txt
debugger: lldb -f $I7 -- `$I7OPTIONS -format=$FORMAT -project $WORK/Example.inform $PIPELINE -crash-all -test-output $A
step: $I7 `$I7OPTIONS -format=$FORMAT -project $WORK/Example.inform $PIPELINE -test-output $A >$I7CONSOLE 2>&1
or: 'failed with Problem message(s)' $I7CONSOLE
show: $A
exists: $I
or: 'ran without crashing but no ideal results existed'
match text: $A $I
or: 'results incorrect'
pass: 'passed'
-end
-recipe [Release]
set: $I7 = inform7/Tangled/inform7
set: $INTERNAL = inform7/Internal
set: $WORKSPACE = ../intest/Workspace
set: $VM = G
if: $CASE %c*-Z
set: $VM = Z
endif
if: $VM G
set: $FORMAT = Inform6/32
set: $EXT = ulx
else
set: $FORMAT = Inform6/16
set: $EXT = z8
endif
extract: $WORK/Example.inform/Source/story.ni $VM
if: $CASE Audiovisual
copy: $WORKSPACE/Samples/Cover.png $WORK/Example.materials/Cover.png
copy: '$WORKSPACE/Samples/Small Cover.png' '$WORK/Example.materials/Small Cover.png'
mkdir: $WORK/Example.materials
mkdir: $WORK/Example.materials/Figures
copy: $WORKSPACE/Samples/Shuttle.jpg $WORK/Example.materials/Figures/Shuttle.jpg
copy: $WORKSPACE/Samples/Triangle.png $WORK/Example.materials/Figures/Triangle.png
mkdir: $WORK/Example.materials/Sounds
copy: $WORKSPACE/Samples/Bach.ogg $WORK/Example.materials/Sounds/Bach.ogg
copy: $WORKSPACE/Samples/Passacaglia.mid $WORK/Example.materials/Sounds/Passacaglia.mid
copy: $WORKSPACE/Samples/Powermac.aiff $WORK/Example.materials/Sounds/Powermac.aiff
endif
set: $I7OPTIONS = -fixtime -format=$FORMAT -no-progress -no-resource-checking -rng -sigils -log nothing -external inform7/Tests -transient $WORK/Transient -no-index -internal $INTERNAL -release
mkdir: $WORK/Transient
step: find $WORK/Transient -mindepth 1 -delete
set: $I7CONSOLE = $WORK/Example.inform/Build/i7_output.txt
step: $I7 `$I7OPTIONS -project $WORK/Example.inform >$I7CONSOLE 2>&1
or: 'failed with Problem message(s)' $I7CONSOLE
match text: $WORK/Example.inform/Release.blurb $PATH/_Blurb_Ideal/$CASE.blurb
or: 'produced the wrong release blurb'
show: $WORK/Example.inform/Release.blurb
match text: $WORK/Example.inform/Metadata.iFiction $PATH/_Metadata_Ideal/$CASE.iFiction
or: 'produced the wrong iFiction metadata'
show: $WORK/Example.inform/Metadata.iFiction
pass: 'passed'
-end
-recipe [Diagnostics]
set: $I7 = inform7/Tangled/inform7
set: $INTERNAL = inform7/Internal
set: $WORKSPACE = intest/Workspace
! First we decide whether to compile it for the Z-machine or Glulx.
set: $VM = Z
if: $CASE %c*-G
set: $VM = G
endif
if: $CASE %c*Metric%c*Units%c*
set: $VM = G
endif
! On the basis of which:
if: $VM G
set: $FORMAT = Inform6/32
set: $EXT = ulx
else
set: $FORMAT = Inform6/16
set: $EXT = z8
endif
set: $I7OPTIONS = -format=$FORMAT -no-progress -no-resource-checking -fixtime -rng -sigils -log nothing -external inform7/Tests -transient $WORK/Transient -no-index -internal $INTERNAL
! Now we extract the source text from whatever file originated the test
! case: this is a non-trivial operation when the file is an Extension or
! an example, but is a simple copy operation otherwise.
extract: $WORK/Example.inform/Source/story.ni $VM
mkdir: $WORK/Transient
step: find $WORK/Transient -mindepth 1 -delete
set: $PIPELINE =
set: $DIAGS = inform7/Figures
set: $I7CONSOLE = $WORK/Example.inform/Build/i7_output.txt
debugger: lldb -f $I7 -- `$I7OPTIONS -format=$FORMAT -project $WORK/Example.inform $PIPELINE -diagnostics $DIAGS -crash-all
step: $I7 `$I7OPTIONS -format=$FORMAT -project $WORK/Example.inform $PIPELINE -diagnostics $DIAGS >$I7CONSOLE 2>&1
or: 'failed with Problem message(s)' $I7CONSOLE
show: $I7CONSOLE
pass: 'passed'
-end
-recipe [Make]
set: $MAKERSPACE = $PATH/$CASE
set: $INWEB = ../inweb/Tangled/inweb
set: $LOG = $MAKERSPACE/build_log.txt
set: $RLOG = $MAKERSPACE/actual_output.txt
set: $ILOG = $MAKERSPACE/ideal_output.txt
set: $INWEBOUTPUT = $MAKERSPACE/inweb_output.txt
step: $INWEB -prototype $MAKERSPACE/$CASE.mkscript -makefile $MAKERSPACE/makefile >$INWEBOUTPUT
or: 'failed to construct a makefile using inweb'
step: make -C $MAKERSPACE -s clean
or: 'failed to clean example make'
step: make -C $MAKERSPACE >$LOG 2>&1
or: 'failed to build example make' $LOG
step: make -C $MAKERSPACE `$$MAKEFLAGS run >$RLOG 2>&1
or: 'failed to run example make' $RLOG
match text: $RLOG $ILOG
or: 'made, but produced the wrong output'
show: $RLOG
step: make -C $MAKERSPACE -s clean
or: 'failed to clean example make'
pass: 'passed'
-end