Commit Graph

12 Commits

Author SHA1 Message Date
Zoltan Somogyi
9e975dbad7 Use "MCFLAGS-X += <values>" in tests/*/Mercury.options.
Replace "=" with "+=" in these files, because this eliminates the chance
that one such rule will override another.
2024-07-29 18:01:17 +02:00
Zoltan Somogyi
a0d6710407 Use "ts=4 sw=4 expandtab" as modeline ...
... in Mercury.options files.
2023-09-16 19:12:52 +10:00
Zoltan Somogyi
ecb5e4a9e6 Update the style of many test cases.
tests/declarative_debugger/*.m:
tests/exceptions/*.m:
tests/general/*.m:
tests/grade_subdirs/*.m:
tests/purity/*.m:
tests/submodules/*.m:
tests/typeclasses/*.m:
    Update programming style.

tests/declarative_debugger/*.inp:
    Update line numbers in breakpoint commands.
tests/declarative_debugger/*.exp:
    Update expected line numbers.

tests/exceptions/Mercury.options:
tests/general/Mercury.options:
    Disable some warnings that are irrelevant to the test.
2021-07-25 23:26:17 +10:00
Zoltan Somogyi
1f45f91886 Make "mmake runtests" work again.
My commit afe2887882 broke the ability
to run the test suite outside of a bootcheck by executing "mmake runtests"
in the tests directory. This diff fixes that.

tests/Mmake.common:
    Don't define "TESTS_DIR = ..". While every single tests/*/Mmakefile
    defined it as such, I overlooked the fact that tests/Mmakefile itself
    defined it ".", referring to the same directory from a different starting
    point. Document this easily-overlooked fact.

    Rename the old runtests target, which after afe2887 runs the tests
    in a single directory, as runtests_dir, to leave the target name
    "runtests" itself free for tests/Mmakefile to use.

tests/Mmakefile:
    Define "TESTS_DIR = .", and add a target "runtests" which invokes
    "mmake runtests_dir" in each test directory.

tools/bootcheck:
    Invoke "mmake runtests_dir" instead of "mmake runtests" in each
    test directory.

    Initialize a variable just before it is used.

tests/*/Mmakefile:
    Add back the definition "TESTS_DIR = .."
2020-06-10 01:05:15 +10:00
Zoltan Somogyi
afe2887882 Remove stale references to test subdirs.
A long time ago, test directories such as hard_coded had subdirectories
such as hard_coded/typeclasses. These have since been flattened out
(e.g. hard_coded/typeclasses is now just typeclasses), but there were
still remnants of the old approach. This diff deletes those remnants.

tests/*/Mmakefile:
    Delete the TESTS_DIR and the SUBDIRS mmake variables; TESTS_DIR
    was always set to "..", and SUBDIRS to the empty string.

    Delete any references to the make variable NOT_WORKING, since
    it is never used.

tests/Mmake.common:
    Document that Mmakefiles in test directories don't have to set
    TESTS_DIR and SUBDIRS anymore. Fix the formatting of the documentation
    of the make variables they do still have to set.

    Delete the targets and actions for handling subdirectories of
    test directories, since there aren't any.

tests/Mmakefile:
    Simplify some code.
2020-04-14 11:23:12 +10:00
Paul Bone
fc4b3ff196 Remove .cvsignore files
Remove old .cvsignore files, moving their contents to .gitignore files.
There are now no .cvsignore files in the repository.

I've also sorted some .gitignore files and avoided repeating a pattern in a
subdirectory's .gitignore file when it is already mentioned in the parent
.gitignore file.
2017-04-04 12:05:56 +10:00
Julien Fischer
1ab13edca6 Switch over unary and binary ops in Java and C# code generators.
Fix more failing test cases in the non-C grades.

compiler/mlds_to_java.m:
compiler/mlds_to_cs.m:
    Always switch over unary and binary ops.  The existing code predates
    the addition of multi-arm switches to the language and was intended to
    the code duplication that would result in the absence of that feature.
    Since we now have multi-arm switches it is by far preferable to use
    a switch in these places.

    XXX for binary ops the above change replicates what the existing code
    did; I think it should actually abort in some cases.

    Fix spelling.

    Delete trailing whitespace.

compiler/java_util.m:
    Delete this module, it isn't used anymore.

compiler/ml_backend.m:
    Delete the include of the java_util module.

compiler/c_util.m:
    Update a comment.

tests/exceptions/Mmakefile:
    Fix the failure of 'test_uncaught_exception' in the java grade by
    filtering out the stack trace generated by the JVM.

tests/hard_coded/float_reg.exp4:
    Alternative expected output for this due to the way floats are
    printed.

tests/invalid_purity/purity.m:
tests/invalid_purity/purity.err_exp:
    Add C# and Java foreign_procs and updated the expected output.

tests/warnings/Mmakefile:
    Fix my previous change, which broke things in non-Erlang grades.
2016-02-07 22:38:16 +11:00
Zoltan Somogyi
8a764392d9 Avoid warnings from make in test directories.
tests/Mmake.common:
    Don't invoke any actions in the clean_local and realclean_local
    targets, since if using mmc --make, the builtin mmake rules
    have actions for those targets as well, and make can't handle
    more than one action for a target having actions. Replace those
    actions with dependencies on other, unique targets that have
    the actions instead.

tests/*/Mmakefile:
    Avoid actions in clean_local and realclean_local targets the same way.

    Sort the test names in some directories that didn't already do so.

    Delete some obsolete comments.

    Fix style.

tests/valid/Mmake.valid.common:
    As for the Mmakefiles above, and also move the definition of a make
    variable before it is needed.
2015-09-08 05:57:53 +10:00
Zoltan Somogyi
73f0a36719 Allow the use of -jN in many test directories.
tests/Mmake.common:
    Replace the -j1 in the runtests_local target used by all the test
    directories with $(MAYBE_J1).

tests/*/Mmakefile:
    Define MAYBE_J1 it as the empty string in test directories in which
    different tests don't share source files.

    Define MAYBE_J1 as -j1 in test directories in which
    different tests do share source files.

tests/submodules/sub2_a.m:
    Add this copy of sub_a.m to allow tests in the submodules directory
    to be done in parallel.

tests/submodules/accessibility2.m:
    Import sub2_a.m instead of sub_a.m.

tests/warnings/ambig_types_high_level.m:
    Add this copy of ambig_types.m to allow tests in the warnings directory
    to be done in parallel.

tests/warnings/ambig_high_level.m:
    Import ambig_types_high_level.m instead of ambig_types.m.
2015-02-19 06:02:45 +11:00
Zoltan Somogyi
33eb3028f5 Clean up the tests in half the test directories.
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
    Make these tests use four-space indentation, and ensure that
    each module is imported on its own line. (I intend to use the latter
    to figure out which subdirectories' tests can be executed in parallel.)

    These changes usually move code to different lines. For the debugger tests,
    specify the new line numbers in .inp files and expect them in .exp files.
2015-02-14 20:14:03 +11:00
Zoltan Somogyi
de2f7b2a0c Flatten the test directories, step 2.
Specifically, rename the following subdirectories of the test directory:

    old dir name                new dir name

    analysis/ext                analysis_external
    analysis/ctgc               analysis_ctgc
    analysis/excp               analysis_excp
    analysis/table              analysis_table
    analysis/trail              analysis_trail
    invalid/purity              invalid_purity
    analysis/sharing            analysis_sharing
    hard_coded/purity           purity
    general/accumulator         accumulator
    analysis/unused_args        analysis_unused_args
    debugger/declarative        declarative_debugger
    hard_coded/exceptions       exceptions
    general/string_format       string_format
    hard_coded/sub-modules      submodules
    hard_coded/typeclasses      typeclasses
    general/structure_reuse     structure_reuse

Some subdirectories are still there, to wit, the subdirs of the inactive
test directory stm, each of which (if I remember correctly) holds only one
test case.

The general/structure_reuse directory previously wasn't enabled; I think
this was a bug.

tests/Mmakefile:
tools/bootcheck:
    List the new test directories.

tests/Mmake.common:
    The analysis_* directories each need to know whether the workspace
    uses subdirs. This used to be controlled from one place,
    analysis/Mmakefile, but since analysis_* are not subdirs of analysis,
    we need a new central place to find this out.

tests/analysis/common.sh:
    Update documentation for the move.

tests/OLDDIRS/Mmakefile:
    Set the subdir list to empty.

tests/NEWDIRS/Mmakefile:
    Update the "this" directory's name, as well as TESTS_DIR.

    In analysis_*/Mmakefile, use the new mechanism for detecting the presence
    of subdirs.
2015-02-10 00:44:14 +11:00
Zoltan Somogyi
d9a1050af6 Flatten the test directories, step 1.
Specifically, rename the following subdirectories of the test directory:

    old dir name                new dir name

    analysis/ext                analysis_external
    analysis/ctgc               analysis_ctgc
    analysis/excp               analysis_excp
    analysis/table              analysis_table
    analysis/trail              analysis_trail
    invalid/purity              invalid_purity
    analysis/sharing            analysis_sharing
    hard_coded/purity           purity
    general/accumulator         accumulator
    analysis/unused_args        analysis_unused_args
    debugger/declarative        declarative_debugger
    hard_coded/exceptions       exceptions
    general/string_format       string_format
    hard_coded/sub-modules      submodules
    hard_coded/typeclasses      typeclasses
    general/structure_reuse     structure_reuse

Some subdirectories are still there, to wit, the subdirs of the inactive
test directory stm, each of which (if I remember correctly) holds only one
test case.

The general/structure_reuse directory previously wasn't enabled; I think
this was a bug.

tests/Mmakefile:
tools/bootcheck:
    List the new test directories.

tests/Mmake.common:
    The analysis_* directories each need to know whether the workspace
    uses subdirs. This used to be controlled from one place,
    analysis/Mmakefile, but since analysis_* are not subdirs of analysis,
    we need a new central place to find this out.

tests/analysis/common.sh:
    Update documentation for the move.

tests/OLDDIRS/Mmakefile:
    Set the subdir list to empty.

tests/NEWDIRS/Mmakefile:
    Update the "this" directory's name, as well as TESTS_DIR.

    In analysis_*/Mmakefile, use the new mechanism for detecting the presence
    of subdirs.
2015-02-10 00:43:02 +11:00