mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-05-01 17:24:34 +00:00
Estimated hours taken: 8 Branches: main Factor out the common Mmake code to set up the mmc, mgnuc and ml flags when building the Mercury compiler and libraries. Use options, not environment variables. This will make it simpler to use `mmc --make' to compile the compiler. Mmake.workspace: Similar to tools/lmc. Sets up Mmake variables to use the library files in a workspace rather than an installed library. configure.in: Check for the `--no-mercury-stdlib-dir' mmc option. Bootstrap CVS tag: bootstrap_20020429_stdlib_dir Mmake.common.in: */Mmakefile: Move common code into Mmake.workspace. browser/Mmakefile: library/Mmakefile: Avoid invoking the linker explicitly when creating libraries of Mercury code. That won't work well with `mmc --make'. tools/bootcheck: tests/Mmake.common: Use Mmake.workspace instead of setting up environment variables in bootcheck. scripts/Mmake.vars.in: mmc compiles split C files to object code itself, so pass `--cflags "$(ALL_CFLAGS)"' to mmc when compiling with `--split-c-files'. browser/interactive_query.m: Use `mmc --make' when compiling the query. This is needed to make tests/debugger/interactive_query.m work when linking against a workspace using options rather than environment variables. This also fixes a bug -- mmc options were being passed to ml. Clean up after the query. tests/debugger/Mmakefile: tests/debugger/interactive.inp: tests/debugger/interactive.inp.subdirs: tests/debugger/interactive.inp.nosubdirs: tests/debugger/interactive.exp: tests/debugger/interactive.exp2: Generate the input file to this test so that MCFLAGS and MC_MAKE_FLAGS (from Mmake.workspace) are used when compiling queries. tests/debugger/Mmakefile now sets SHELL to /usr/local/bash to allow the use of $(...) style command substitution (`...` style command substitution can't be nested). tests/warnings/Mmakefile: tests/dppd/Mmakefile: Include tests/Mmake.common. tools/*: scripts/c2init.in: scripts/ml.in: Update the lists of files containing the library names.
The Mercury test suite is (dis)organized into a directory hierarchy. Each subdirectory has a script named "runtests" that runs the tests in that subdirectory; these indicate the presence of any errors by returning a nonzero exit status. The runtests script in each directory invokes the runtests scripts in all subdirectories, and propagates any nonzero exit status upwards. Both the bootcheck script and the nightly script use the main runtests script to run all the tests. benchmarks This directory contains Mercury versions of the benchmarks. These tests work by comparing the output of the Mercury and the NU-Prolog versions. debugger This directory is for testing mdb, the Mercury debugger. Programs are compiled with deep tracing turned on. The tests in this directory are not performed if the base grade is `jump' or `fast'. debugger/declarative This directory is for testing the declarative debugging features of mdb. general This directory is for general test cases. (It might be a good idea to split this into tests of particular features and regression tests that check for old bugs. But for the moment, just about everything goes in here.) These tests work by comparing the output of the Mercury and the NU-Prolog versions. hard_coded This directory is for tests of features that don't work in NU-Prolog. The expected output of the program has to be hard-coded in a hand-written `.exp' file, rather having the `.exp' file be generated automatically using NU-Prolog. recompilation This directory contains tests of the smart recompilation system. valid This directory is for test cases that are not complete programs. We just check that the files compile. invalid This directory is for test cases that are invalid programs. We check that the files do *not* compile. warnings This directory is for tests of compiler warnings. These work by comparing the warnings emitted by the compiler with those given in the hand-written `.exp' file. To regenerate the expected output files for the benchmark and general directories, execute the "generate_exp" script in this directory.