Turn non-automated tests into Cargo examples #24
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "cargo-examples_on_main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Some of the Cargo tests on the main branch are designed to print output for human inspection, not to verify computations automatically. The incoming branch turns these tests into Cargo examples. It also makes two organizational changes in pursuit of this goal:
engine::irisawa
module. This code is shared by a test and an example. Compilation is controlled by thedev
feature, which is turned on by default in development mode.I've verified that printed output of the examples hasn't changed between the head (
848f7d6
) and base (e917272
) of the incoming branch.This all looks good, just one minor organizational thing. The file
examples/run-examples
has no extension, and no hash-bang first line, so it does not self-document how it can be used; nor does the README file or any other documentation mention it, so far as I can see. It is executable, so that is a hint one can try to execute it; and it does work, but as per this SO question, first answer it's not considered best practice to rely on the convention that executable text files will be interpreted by the shell. So please either:sh run-examples.sh
add the.sh
extension to the filename; if it prefers a different shell like bash add the.bash
extension to invitebash run-examples.bash
. In this case, don't make the file executable, as you wouldn't be inviting that it be executed directly.One of the above needs to be done. You are also encouraged either in the README to acknowledge app-proto and quickly mention how to run the prototype app (some hints on how to install trunk, then
cd app-proto
andtrunk serve
) and how to run the examples, or to start some other appropriate documentation file with this info, likely with a pointer in the README.Thanks so much! We should be able to merge this shortly.
Done (in commit
dc5020752b
).