Closed mshinwell closed 3 months ago
One other change here that I forgot about: this builds ocamltest
as part of make hacking
, which makes it much easier to work on (e.g. merlin works). It's very fast to build so I don't think this should be problematic.
The main change is to add a "does this action do something?" flag to all actions defined by ocamltest for the use of test scripts. Then it is enforced that all branches of a test must do something. This should avoid what's happening at the moment, which is that a chunk of tests aren't running at all, because of stanzas like:
In the absence of any other explicit directives like
bytecode;
ornative;
this actually removes the default bytecode/native compile+run actions, and just leaves a predicate test and nothing else. The test therefore does nothing.It is terrible that we only discovered this because of a locals bug (https://github.com/ocaml-flambda/flambda-backend/pull/2736). There, a new test case could not be made to fail even with a syntax error, which was because in fact the test directives did not describe anything substantive to do.
The "does this action do something?" logic isn't perfect; for example if you are going to compile then run, then arguably the compilation step should not "do something". However this is already much better than what we have, and I think will catch the fundamental errors.
Two other improvements are included, which can be split into separate PRs if necessary:
n/a
lines where test directives are skipped because of a previous predicate which was false.Finally there are fixes to various tests to make them actually run. Two of the
runtime_events
ones fail (one because of some build failure wherestubs.c
is apparently not being linked, and another because of something semantic in the test itself) but I've disabled these for now, since we're not using that library. The fixes for statmemprof tests are from @stedolan with thanks.