1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-06-26 04:00:43 +03:00

Added -log-to-project switch to inform7

This commit is contained in:
Graham Nelson 2023-08-08 13:34:10 +01:00
parent 180b5af03b
commit e7933968cd
10 changed files with 102 additions and 22 deletions

View file

@ -1,6 +1,6 @@
# Inform 7
[Version](notes/versioning.md): 10.2.0-beta+6W97 'Krypton' (5 August 2023)
[Version](notes/versioning.md): 10.2.0-beta+6W98 'Krypton' (8 August 2023)
## About Inform

View file

@ -1,3 +1,3 @@
Prerelease: beta
Build Date: 5 August 2023
Build Number: 6W97
Build Date: 8 August 2023
Build Number: 6W98

View file

@ -30,6 +30,7 @@ equivalent of unlocking the doors and turning the lights on in the morning.
int silence_is_golden = FALSE;
int index_explicitly_set = FALSE, problems_explicitly_set = FALSE;
pathname *diagnostics_path = NULL;
text_stream *log_to_project = NULL;
int Main::deputy(int argc, char *argv[]) {
@<Start up@>;
@ -132,6 +133,9 @@ but we won't assume that. Remember, //supervisor// knows best.
for (int i=0; i<argc; i++) LOG(" %s", argv[i]);
LOG("\n");
CommandLine::play_back_log();
if (Str::len(log_to_project) > 0)
if (Log::set_aspect_from_command_line(log_to_project, FALSE) == FALSE)
Problems::fatal("Unknown -log-to-project setting");
}
if (proj) {
if (Task::problems_enabled()) {
@ -288,6 +292,7 @@ compiler via Delia scripts in |intest|.
@e CHECK_RESOURCES_CLSW
@e INBUILD_VERBOSE_CLSW
@e INBUILD_VERBOSITY_CLSW
@e LOG_TO_PROJECT_CLSW
@<Register command-line arguments@> =
CommandLine::begin_group(INFORM_TESTING_CLSG, I"for testing and debugging inform7");
@ -309,6 +314,8 @@ compiler via Delia scripts in |intest|.
L"if no problems occur, write diagnostics files to directory X", FALSE);
CommandLine::declare_switch(REQUIRE_PROBLEM_CLSW, L"require-problem", 2,
L"return 0 unless exactly this Problem message is generated");
CommandLine::declare_switch(LOG_TO_PROJECT_CLSW, L"log-to-project", 2,
L"like -log X, but writing the debugging log into the project");
CommandLine::declare_switch(TEST_OUTPUT_CLSW, L"test-output", 2,
L"write output of internal tests to file X");
CommandLine::declare_boolean_switch(SILENCE_CLSW, L"silence", 1,
@ -343,6 +350,7 @@ void Main::switch(int id, int val, text_stream *arg, void *state) {
case DIAGNOSTICS_CLSW: diagnostics_path = Pathnames::from_text(arg); break;
case CHECK_RESOURCES_CLSW: ResourceFinder::set_mode(val); break;
case TEST_OUTPUT_CLSW: InternalTests::set_file(Filenames::from_text(arg)); break;
case LOG_TO_PROJECT_CLSW: log_to_project = Str::duplicate(arg); break;
case SILENCE_CLSW: silence_is_golden = TRUE; break;
case INBUILD_VERBOSE_CLSW: Supervisor::set_verbosity(1); break;
case INBUILD_VERBOSITY_CLSW: Supervisor::set_verbosity(val); break;

View file

@ -8,24 +8,53 @@ default: $INTERNAL = inform7/Internal
default: $TESTRELEASEMETADATA = No
default: $SCRIPT =
default: $LANGUAGE = Inform
default: $FOR = Glulx
default: $COMPATIBLEWITH = all
! (1) Set $FORMAT to the full description of the language we will transpile
! to, and extract the source text for the case, writing it to the given file:
if compatible: inform6/32 `$COMPATIBLEWITH
default: $FOR = Glulx
else
if compatible: C `$COMPATIBLEWITH
default: $FOR = Glulx
else
default: $FOR = Z-Machine
endif
endif
if: $FOR C
default: $FORMAT = C
extract: $WORK/Example.inform/Source/story.ni G
else
if: $FOR Glulx
default: $FORMAT = Inform6/32
extract: $WORK/Example.inform/Source/story.ni G
else
default: $FORMAT = Inform6/16
extract: $WORK/Example.inform/Source/story.ni Z
if: $FOR Z-Machine
default: $FORMAT = Inform6/16
else
if format valid: $FORMAT
default: $FORMAT = $FOR
else
set: $ERROR = 'The format $FORMAT is not something I can test'
fail: `$ERROR
endif
endif
endif
endif
show: source $WORK/Example.inform/Source/story.ni
if compatible: $FORMAT `$COMPATIBLEWITH
else
set: $ERROR = 'The test format $FORMAT is not compatible with $COMPATIBLEWITH'
fail: `$ERROR
endif
set: $SOURCE = $WORK/Example.inform/Source/story.ni
if compatible: $FORMAT Glulx
extract: $SOURCE G
else
extract: $SOURCE Z
endif
show: source $SOURCE
! (2) Almost all tests produce actual textual output, which we put in $A,
! and ideal or blessed textual output, which is in $I: the test will end up
@ -53,6 +82,17 @@ else
set: $I7OPTIONS = `$I7OPTIONS -external $NEST
endif
endif
if showing: log
ifdef: $$LOG
set: $I7OPTIONS = `$I7OPTIONS -log-to-project $$LOG
endif
else
set: $I7OPTIONS = `$I7OPTIONS -log nothing
endif
if showing: inter
set: $INTER = $WORK/Example.inform/Build/inter.txt
set: $I7OPTIONS = `$I7OPTIONS -variable *tout=$INTER
endif
if: $LANGUAGE Basic
set: $I7OPTIONS = -basic `$I7OPTIONS
endif
@ -73,6 +113,7 @@ endif
set: $I7 = inform7/Tangled/inform7
set: $I7CONSOLE = $WORK/Example.inform/Build/i7_output.txt
set: $I7LOG = '$WORK/Example.inform/Build/Debug log.txt'
! (6) Clearing any external files used by the test.
@ -95,7 +136,13 @@ endif
if: $TYPE problem
debugger: lldb -f $I7 -- `$I7OPTIONS -project $WORK/Example.inform -crash-all
fail step: $I7 `$I7OPTIONS -require-problem $CASE -project $WORK/Example.inform >$A 2>&1
or: 'failed to produce its namesake Problem message' $A
ifpass:
show: log $I7LOG
show: $A
show: i7 $A
fail: 'failed to produce its namesake Problem message' $A
endif
show: log $I7LOG
show: $A
show: i7 $A
exists: $I
@ -122,7 +169,13 @@ if: $TESTRELEASEMETADATA Yes
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
iffail:
show: log $I7LOG
show: i7 $I7CONSOLE
fail: 'failed with Problem message(s)' $I7CONSOLE
endif
show: log $I7LOG
show: i7 $I7CONSOLE
set: $ABLURB = $WORK/Example.inform/Release.blurb
set: $AIFICTION = $WORK/Example.inform/Metadata.iFiction
@ -144,10 +197,15 @@ else
if: $TESTCOMPILERINTERNALS Yes
debugger: lldb -f $I7 -- `$I7OPTIONS -project $WORK/Example.inform -test-output $A -crash-all
step: $I7 `$I7OPTIONS -project $WORK/Example.inform -test-output $A >$I7CONSOLE 2>&1
or: 'failed with Problem message(s)' $I7CONSOLE
iffail:
show: log $I7LOG
show: i7 $I7CONSOLE
fail: 'failed with Problem message(s)' $I7CONSOLE
endif
show: log $I7LOG
show: i7 $I7CONSOLE
show: $A
show: transcript $A
show: i7 $I7CONSOLE
exists: $I
or: 'ran without crashing but no ideal results existed'
match text: $A $I
@ -162,7 +220,13 @@ if: $FOR C
set: $COUT = $$workspace/Actuals/$CASE.c
set: $OFILE = $WORK/Example.inform/Build/$CASE.o
step: $I7 `$I7OPTIONS $WORK/Example.inform/Source/story.ni -o $COUT >$I7CONSOLE 2>&1
or: 'failed with Problem message(s)' $I7CONSOLE
iffail:
show: log $I7LOG
show: i7 $I7CONSOLE
fail: 'failed with Problem message(s)' $I7CONSOLE
endif
show: log $I7LOG
show: i7 $I7CONSOLE
show: c $COUT
@ -207,13 +271,21 @@ else
debugger: lldb -f $I7 -- `$I7OPTIONS -project $WORK/Example.inform -crash-all
step: $I7 `$I7OPTIONS -project $WORK/Example.inform >$I7CONSOLE 2>&1
or: 'failed with Problem message(s)' $I7CONSOLE
iffail:
show: log $I7LOG
show: i7 $I7CONSOLE
fail: 'failed with Problem message(s)' $I7CONSOLE
endif
set: $I6SOURCE = $WORK/Example.inform/Build/auto.inf
show: log $I7LOG
show: i7 $I7CONSOLE
show: inform6 $I6SOURCE
show: inter $INTER
if: $COMPILEONLY No
set: $I6 = inform6/Tangled/inform6
set: $I6SOURCE = $WORK/Example.inform/Build/auto.inf
hash: $I6SOURCE $WORK/Example.inform/Build/checksum.txt
or: 'passed (matching cached I6 known to work)'

View file

@ -2,7 +2,7 @@
"is": {
"type": "kit",
"title": "Architecture16Kit",
"version": "10.2.0-beta+6W97"
"version": "10.2.0-beta+6W98"
},
"compatibility": "16-bit",
"kit-details": {

View file

@ -2,7 +2,7 @@
"is": {
"type": "kit",
"title": "Architecture32Kit",
"version": "10.2.0-beta+6W97"
"version": "10.2.0-beta+6W98"
},
"compatibility": "32-bit",
"kit-details": {

View file

@ -2,7 +2,7 @@
"is": {
"type": "kit",
"title": "BasicInformKit",
"version": "10.2.0-beta+6W97"
"version": "10.2.0-beta+6W98"
},
"needs": [ {
"need": {

View file

@ -2,7 +2,7 @@
"is": {
"type": "kit",
"title": "CommandParserKit",
"version": "10.2.0-beta+6W97"
"version": "10.2.0-beta+6W98"
},
"needs": [ {
"need": {

View file

@ -2,7 +2,7 @@
"is": {
"type": "kit",
"title": "EnglishLanguageKit",
"version": "10.2.0-beta+6W97"
"version": "10.2.0-beta+6W98"
},
"needs": [ {
"need": {

View file

@ -2,7 +2,7 @@
"is": {
"type": "kit",
"title": "WorldModelKit",
"version": "10.2.0-beta+6W97"
"version": "10.2.0-beta+6W98"
},
"needs": [ {
"need": {