Do you want to have a side-discussion about how the tests and dgt could work together better? Either a seperate discussion here, or as a dgt issue (https://github.com/hlship/dialog-tool/issues)?
Issue submitted. If I can get a game into this year’s IFComp, I’m going to try to do it with dgt.
Please check back on the issue; I’ve created a decision matrix to consider the best way(s) forward. https://docs.google.com/spreadsheets/d/1j6se5PC74cIYe_AGcXLS64obKHJevw3JquRjjOr4zP0/edit?gid=0#gid=0
Getting very close to the 2.0 release here; just fixing up some documentation, and chasing down some possible bugs.
Aha! There is a workaround:
(test *(this kind of test $))
(test *(that kind of test $))
(set up $Test)
(this kind of test $Test)
%% will only set up the kind of test we're expecting
(clean up (this kind of test $))
%% or use this pattern
#my-test
(this kind of test *)
(run *)
%% test all the things
I’ll add that to the manual, possibly in a separate PR from the one that I’m finishing now.
For that matter, if we introduced .dgt as a new extension for tests, it would be easy to approximate dgt’s behaviour with dgdebug -u *.dgt *.dg unit.dg stdlib.dg and dialogc -t aa *.dg stdlib.dg. Mashing everything together like that is still error-prone for compilation order, and mashing all of the tests together doesn’t make it obvious which test file you need to investigate when one fails, but it’s simple and works now.
Any objections to making *.dgt (or *-tests.dgt if you want to be extra explicit) the new convention for test files? (The fact that “Dialog test” and dialog-tool both give you dgt is a coincidence. And *.dg for source files is just a convention, and not anything that’s hard-coded into the compiler or debugger.)
…and if we really wanted to be controversial, there’s nothing stopping us from unit.dgl, stddebug.dgl, and stdlib.dgl. Then you wouldn’t even need separate directories in dgt, and dgdebug -u *.dgt *.dg *.dgl and dialogc -t z8 *.dg *.dgl would just work.
By happy accident, stdlib sorts alphabetically after stddebug; if we renamed unit.dg to run-tests.dgl, we’d get the three libraries to show up in the desired order.
I think the alternate file extension is a great idea, one that hadn’t occurred to me.
However, long experience with working by an implied convention makes me suspicious of the approach of putting everything in one directory. They are separated out now because we want to avoid including debug-only code in release builds. Given the inherent conflict between unit.dg and stdlib.dg (both provide (program entry point)), keeping test distinct from debug continues to be important.
This sounds a lot like what I mentioned earlier with a “curse this node” action which marks it as “triaged and known incorrect” for handling later. Cursed nodes that change show as erroneous as if they were blessed, but they aren’t blessed by “bless to here”. Instead, they’d need to be blessed individually.
The compiler test suite uses .dglib for libraries, so that *.dg finds exactly the list of test cases.
There’s two issues that need resolving here:
- How to find all test source files when testing.
- Using :test source category
- Via *.dgt extension (dialog test)
- Isolation needed for tests
- Can tests sources be merged with main, debug, library?
- If not, how do *.dgt test files identify dependencies on other main, test, and library sources?
- Do tests sources need to be isolated from each other?
The answers to that are informed by the answer to the following: what is dgt for? What’s it meant to be?
- An easy way for non-technical beginners to have one-command builds for the typical case of a game contained in one file, possibly with a few extensions added?
- A skein test runner that includes some build features in order to have something to test?
- A bespoke build system for the Dialog language that’s meant to be the standard way to build and test Dialog games?
I think you get a different answer on what dgt needs to include if it’s that third thing, rather than one of the previous two (or some fourth thing that I haven’t thought of).
Another question: what’s a “library?”
- One of the threeish standard library files distributed with Dialog (or user-hacked variants thereof)?
- The above, plus third party extensions brought in from elsewhere, which aren’t part of the main story code, other than being used by it?
I see dgt as the optional but preferred way to build, test and package Dialog games for deployment.
In terms of testing, I would like confirmation that all tests will be run in a single execution, and must be able to work with other tests and main source code. In this respect, I’d like it to be like the tests I run for my corporate work, where tests dependencies are at the project, not the source file, level, and any or all tests can run at any time.
I’m tracking down a bug where “Replay All” doesn’t catch all the changes to transcripts. Not quite sure why.
I have a project I started years ago that’s currently regression-tested via:
regress: $(FILES)
dgdebug -qD -s 1234 platform_debug.dg $(OPTIONS_DBG) $(FILES) <regress.in >regress.out
meld regress.out regress.gold
What’s the best way to update this to use dgt? Is there a straightforward way to convert my regress.in to a Skein file, or do I have to re-type every command manually? (I’m not worried about the output; randomness shouldn’t affect it significantly, so just converting the input to a Skein and running Replay All should be enough.)
I’ve had the idea of importing a transcript and converting it to a skein (with a single path), but haven’t had time to implement it. I start my new job at Ladder tomorrow, so I suspect I’ll be busy.
I’ve just released 2.0-rc-3.
Please see the above comments for the installation details.
This fixes a bug with the Replay All action that prevented output changes in the project from being picked up (Replay worked, Replay All did not).
Please give this a try; if there are no further problems I will release a 2.0 (final) release in a few days.
I think we may want a separate way of dealing with “incomplete” knots; there’s no reason we can’t have additional flags or properties on knots exposed through the Skein, and a way of quickly finding such knots.
So the workflow would be:
- Create temporary Dialog code for rooms (objects, puzzles, etc.)
- Where provisional text is present, bless such knots (to identify behavior reversions)
- Mark the knots as “provisional” (or whatever terminology we come up with)
- Later:
- Modify the provisional text to releasable
- Replay All, bless knots
- Remove the provisional flag
- Profit!
I think we would want some more refinement on what kind of flags, tags, or properties can be stored with knots and how we can quickly find them, and if there should be any special decoration for the knots (in the transcript and/or in the navigation graph).
I don’t see this as a deal breaker for a 2.0 release, but will be a nice 2.1 improvement.
I tried to install via the .deb (very convenient!), but it did not put a dgt executable in my $PATH. It looks like it installed to /opt/dgt, but did not make a $PATH entry.
I put a symlink in my $PATH and that worked, but I don’t know if most users will know how to locate the installed files and do that.
I’m also getting a crash when I try to run dgt with this dialog.edn file:
{
:name "[TITLE]"
:target :aa
:build {
:aa {:options [
"--word-seps" "^⸗=.,;\"()*"
"--resources" "resources"
]}
:dgdebug {:options [
"--word-seps" "^=.,;\"()*"
]}
}
:sources {
:main [
"src/act1.dg"
]
:library [
"src/actions.dg"
"src/interface.dg"
"src/automap.dg"
"src/draclib.dg"
"src/parser.dg"
"src/worldmodel.dg"
]
}
}
Result:
Exception in thread "main" clojure.lang.ArityException: Wrong number of args (0) passed to: clojure.core/max
at clojure.lang.AFn.throwArity(AFn.java:429)
at clojure.lang.RestFn.invoke(RestFn.java:402)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.RestFn.applyTo(RestFn.java:135)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$apply.invoke(core.clj:662)
at dialog_tool.commands$sources.invokeStatic(commands.clj:156)
at dialog_tool.commands$sources.doInvoke(commands.clj:142)
at clojure.lang.RestFn.invoke(RestFn.java:400)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.RestFn.applyTo(RestFn.java:135)
at clojure.lang.Var.applyTo(Var.java:707)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$apply.invoke(core.clj:662)
at net.lewisship.cli_tools.impl$dispatch$fn__3330$invoke_command__3331.invoke(impl.clj:960)
at net.lewisship.cli_tools.impl$dispatch$fn__3330.invoke(impl.clj:969)
at net.lewisship.cli_tools.impl$dispatch.invokeStatic(impl.clj:907)
at net.lewisship.cli_tools.impl$dispatch.invoke(impl.clj:905)
at net.lewisship.cli_tools$dispatch_STAR_.invokeStatic(cli_tools.clj:221)
at net.lewisship.cli_tools$dispatch_STAR_.invoke(cli_tools.clj:214)
at net.lewisship.cli_tools$dispatch$callback__3441.invoke(cli_tools.clj:317)
at dialog_tool.main$option_handler.invokeStatic(main.clj:14)
at dialog_tool.main$option_handler.invoke(main.clj:6)
at net.lewisship.cli_tools$dispatch$fn__3443.invoke(cli_tools.clj:331)
at net.lewisship.cli_tools$color_wrapper.invokeStatic(cli_tools.clj:238)
at net.lewisship.cli_tools$color_wrapper.invoke(cli_tools.clj:233)
at net.lewisship.cli_tools$dispatch.invokeStatic(cli_tools.clj:320)
at net.lewisship.cli_tools$dispatch.invoke(cli_tools.clj:245)
at dialog_tool.main$_main.invokeStatic(main.clj:18)
at dialog_tool.main$_main.doInvoke(main.clj:16)
at clojure.lang.RestFn.applyTo(RestFn.java:140)
at dialog_tool.main.main(Unknown Source)
I’m assuming I have something wrong in my EDN, but from the crash log I’m not sure what—it passes an online validator, at least.