[m-rev.] for review: rewrite rest of options_file.m

Julien Fischer jfischer at opturion.com
Tue Jun 9 10:33:31 AEST 2020


On Mon, 8 Jun 2020, Zoltan Somogyi wrote:

> On Mon, 8 Jun 2020 15:50:34 +1000 (AEST), Julien Fischer <jfischer at opturion.com> wrote:

>>> I couldn't find any. I do think there should be some, but I am not sure
>>> whether these should go in e.g. tests/hard_coded, or in a new subdirectory
>>> of tests dedicated to tests of option file handling.
>>
>> It should be a new subdirectory; there's enough complication in
>> hard_coded as it is.
>
> Agreed. However, we will need tests for both (a) correct options files,
> and (b) incorrect options files. I think these belong in two separate
> directories. Does anyone object to naming these "options_file"
> and "invalid_options_file" respectively?

Not from me.

>> (Incidentally, running the test suite directly, by doing "mmake
>> runtests" in the top-level tests directory, no longer works due to your
>> changes back in April.  Is that intentional?)
>
> No, it is not intentional. I can't recall when I last used "mmake runtests",
> but it was almost certainly more than a decade ago, so I have forgotten
> it existed :-(

While it is more usual to run the test via the bootcheck script, there
are a couple use cases for being able to run them directly:

1. Where the compiler cannot be bootstrapped in the grade you are
testing.  That's not currently much of an issue, but it has been
in the past and may be again in the future.

2. Where you want to test an installed (i.e. not stage 2) compiler.

> Do you know *which* changes in April?

I think the commit that broke it was either afe2887 or 520ce39 since
they are the ones that changed the value of TEST_DIRS to hardcode it
to '..'.

The problem being that when you now do "mmake runtests" in the tests
directory itself, it looks for various files in the top-level of
the the source tree, rather than in the tests directory itself,
e.g.

     Mmake.common:82: ../DEFNS_FOR_TESTS: No such file or directory mercury_compile:
     cannot open ../TESTS_FLAGS: can't open input file: No such file or directory
     mercury_compile: cannot open ../TESTS_FLAGS: can't open input file: No such file or directory
     gmake: *** No rule to make target `../DEFNS_FOR_TESTS'.  Stop.

Julien.


More information about the reviews mailing list