Simplifying Makefiles in test and examples #3594
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow up to #3578. The
test.mk
makefile now "knows" about extraction, building executables, running them, getting output (both error output and program output) and comparing to.expected
files. Previously we had rules for this scattered everywhere.The key points are:
FSTAR_ROOT
and inclued mk/test.mk. This will already cause that runningmake
here verifies every file in dependency order.SUBDIRS+=
to add list them. They will be recursively built (but without imposing any order, maybe we could change this if we want to build modules or components separately).EXTRACT
,BUILD
, andRUN
, we can state that some files are meant to be extracted (to OCaml), built (as an exe from a single ml file), or ran to check that they don't crash. Running generates a.out
file with the output..extracted
files anywhere are automatically picked up and added to the default rule. So, ifX.fst
andX.ml.expected
exists, runningmake
will extractX.fst
and check that it matches exactly (modulo some whitespace) the contents ofX.ml.expected
..expected
suffix works for most other rules. CreatingX.out.expected
will trigger extracting + building + running ofX.fst
and compare the output ofX.exe
to the file.accept
target sets all existing.expected
files to their actual result. Agit diff
can be used to review and maybe commit the difference.tests/bug-reports
is now a lot simpler in that it has aclosed
subdir with closed issues which is checked (some files are ran too, exactly like now, but the makefile is much simpler) and anopen
directory that is unchecked. There's no need to update lists of files any more, just drop an fst where appropriate.