Commit Graph

17 Commits

Author SHA1 Message Date
Julien Fischer
d9b282d6f7 Fix a failing test on MinGW64/UCRT64.
tests/declarative_debugger/Mmakefile:
     Avoid hardcoding a memory address in the expected output for
     the declarative_debugger/condition_bug test case.
2023-08-20 14:47:24 +10:00
Julien Fischer
9656e13e73 Fix some declarative debugger test on Windows.
tests/declarative_debugger/Mmakefile:
    Filter memory addresses and error codes from the output of the
    condition_bug and sort tests.

tests/declarative_debugger/sort.exp:
    Conform to the above change.

tests/Mmake.common:
    Shut up an error from grep when a directory does not contain
    a FAILED_TESTS file.
2023-07-30 13:33:46 +10:00
Julien Fischer
02a5945b77 Fix the failure of declarative_debugger/io_stream_test ...
... in debug grades on Windows.

tests/declarative_debugger/Mmakefile:
     Account for the fact that Windows prints pointers differently.
2023-07-28 20:10:10 +10:00
Peter Wang
bd51bb4163 Skip debugging tests in parallel grades.
Since commit f380d2c36, the compiler refuses to allow debugging in
parallel grades.

tests/debugger/Mmakefile:
tests/declarative_debugger/Mmakefile:
    Skip debugging tests in parallel grades.
2022-11-21 13:48:47 +11:00
Zoltan Somogyi
56509009dd Fix some test failures in debug grades.
browser/declarative_oracle.m:
    The code that checks whether the declarative debugger should trust
    a module because it is a standard library module was apparently written
    before any of module in the standard library had submodules, because
    it checked the unqualified name of the module in question against
    the *qualified* module names returned by the mercury_std_library_module
    predicate.

    For a long time after we had submodules such as thread.mvar.m in the
    standard library, this caused no test failures, because our tests
    did not execute code in those submodules. This changed with the breakup
    of io.m. The move of the output_stream_2 predicate from io.m, which
    this code recognized as trusted, to io.stream_ops.m, which it did not,
    caused the declarative debugger to ask questions about the validity
    of calls to it, which the caused the failure of the declarative_debugger/
    all_trusted test case, due to its .inp file containing something other
    than the corresponding answers.

    Fix this for the case of module names of the forms a.b and a.b.c.

library/library.m:
    Add a note to the mercury_std_library_module predicate to update
    the code in declarative_oracle.m if we ever add a library module
    whose fully qualified name has the form a.b.c.d.

tests/debugger/user_event_shallow.exp:
    Update the expected output of this test for some ancient change.

tests/debugger/Mercury.options:
    Specify the optimization level for the user_event_shallow test,
    which eliminates one source of variability in the output.
    Another source is intermodule optimization, which this diff does *not*
    eliminate.

tests/debugger/all_solutions.exp:
tests/debugger/all_solutions.exp2:
tests/debugger/all_solutions.exp3:
tests/debugger/all_solutions.exp4:
tests/debugger/all_solutions.m:
    The output of this test case in debug grades with intermodule optimization
    did not match any of the .exp* files, though it differed from .exp2 only
    in the text of an error message. (The difference was not a bug.)

    Instead of adding this expected output as .exp5, use it to replace
    the .exp3 file. This expected output file could not have been matched
    in the last seven years, because it expects main/2 to be on line 16,
    and that predicate's context has been line 20 since 2015.

    Document the fact that .exp3 is the expected output for debug grade
    bootchecks with intermodule optimization. This documentation changes
    line numbers yet again, so update the line numbers in all the *other*
    .exp* files as well.

tests/declarative_debugger/Mmakefile:
    Fix indentation.
2022-06-26 10:09:48 +10:00
Peter Wang
524f4d72e2 Delete references to Erlang backend in makefiles.
Mmake.workspace:
Mmakefile:
*/Mmakefile:
tests/*/Mmakefile:
tests/valid/Mmake.valid.common:
trace/Mmakefile:
    As above.
2020-10-27 11:10:11 +11: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
Julien Fischer
7a18139c56 Fix another failing decldebug test case.
tests/declarative_debugger/Mmakefile:
tests/declarative_debugger/condition_bug.exp:
    Filter contexts and memory addresses from the output.

    Conform to changes to the io module.
2018-07-15 02:09:55 +10:00
Julien Fischer
9835778f64 Fix a test case failure in debug grades.
Fix the failure of declarative_debugger/io_stream_test in debug grades.
This has been broken since the commit d8c59a8, which changed the way the io
module reads characters.

tests/declarative_debugger/Mmakefile:
    Pipe the output of this test through sed to avoid machine
    specific memory addresses occurring in the output.

tests/declarative_debugger/io_stream_test.exp2:
    Update this expected output.
2018-06-07 22:29:48 +10:00
Julien Fischer
af693fd4c6 Fix failure of declarative_debugger/typed_unify.
tests/declarative_debugger/Mmakefile:
tests/declarative_debugger/typed_unify.exp:
     Do not hardcode line numbers from the standard library.
2017-09-11 20:28:53 -04:00
Julien Fischer
01995716e9 More test suite cleanups.
tests/benchmarks/Mmakefile:
    Delete variables only used with the IL or GCC back-ends.

tests/debugger/Mmakefile:
tests/declarative_debugger/Mmakefile:
tests/par_conj/Mmakefile:
    Delete references to the IL backend.

tests/par_conj/dep_par_10.m:
    Add missing C# and Java foreign procs.

tests/dppd/Mmakefile:
    Run these tests in the Java grade.

tests/general/Mmakefile:
    Delete a workaround for OSF/1 -- we no longer support it.

tests/hard_coded/Mmakefile:
    Delete the unused list of tests that will pass in the Java grade.

    Delete a reference to the IL backend.
2016-01-02 02:18:04 +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
c34f6dd4e8 Let the compiler bootstrap in decldebug grades again.
The big diff that replaced the item list with proper parse trees included code
that the compiler couldn't handle in decldebug grades, aborting with a message
about liveness mismatch between different switch arms. The problem occurred
when compiling this code in generate_missing_start_section_warning_int,
which is one arm of a switch on !.MissingStartSectionWarning:

    !.MissingStartSectionWarning =
        have_not_given_missing_section_start_warning,
    !:MissingStartSectionWarning =
        have_given_missing_section_start_warning,
    Pieces = [invis_order_default_start(1), ...],
    _Spec = error_spec(severity_error, phase_term_to_parse_tree,
        [simple_msg(Context, [always(Pieces)])])

The problem was liveness.m's handling of the from_ground_term_construct
scope that is generated for the assigmnet of the ground term to Pieces.

compiler/liveness.m:
    During the first pass through the procedure body, the liveness pass,
    replace with the empty conjunction any from_ground_term_construct scopes
    that construct terms to assign to dead variables. This prevents the
    second pass, the deadness pass, from including the dead variable
    (Pieces in the above example, after the assignment to _Spec was
    optimized away by earlier passes) in the set of variables that
    have been seen, since obviously, they won't be seen in the other arms.
    This inclusion was the cause of the assertion failure that led to
    the compiler abort.

    Improve the existing debugging infrastructure to help find bugs like this,
    by printing out what the selected procedure's body looks like before
    as well as after the initial requantification.

compiler/quantification.m:
    Replace from_ground_term_construct scopes whose ground term is assigned
    to a dead variable with empty conjunctions, so that the compiler passes
    between the first quantification after mode checking and the liveness
    pass also see a smaller HLDS.

    Implement an unrelated improvement whose possibility I discovered when
    investigating why a version of the test case *without* the from_ground_term
    scope wasn't getting the abort. When processing unifications, build up the
    set of variables in the unification directly, not by recording a bunch
    of maybe(somethings)s and then processing the somethings, if they existed,
    later. This yields code that is shorter, simpler *and* faster.

tests/valid/liveness_disagree.m:
    A new test case for this bug. It is a cut-down version of
    generate_missing_start_section_warning_int.

tests/valid/Mmakefile:
tests/valid/Mercury.options:
    Enable the new test case, and try to compile it in a declarative debugging
    grade.

compiler/assertion.m:
compiler/deep_profiling.m:
compiler/lookup_switch.m:
compiler/par_loop_control.m:
    Add module qualifications in several places. I found the need for these
    when I temporarily redefined the set_of_var type to use sets instead of
    sparse_bitsets, to make debugging the bug in liveness.m easier; without
    them, I got errors about excessive overloading.

    Do some other cleanups as well.

tests/debugger/all_solutions.exp4:
tests/debugger/exception_cmd.exp3:
tests/debugger/loopcheck.exp3:
tests/debugger/uci_index.exp2:
tests/declarative_debugger/Mmakefile:
tests/declarative_debugger/builtin_call_rep.exp:
tests/declarative_debugger/catch_retry.exp:
tests/declarative_debugger/condition_bug.exp:
tests/declarative_debugger/find_origin.exp3:
tests/declarative_debugger/lpe_example.exp3:
tests/declarative_debugger/priv_builtin_bug.exp:
tests/declarative_debugger/solns.exp3:
tests/declarative_debugger/sort.exp:
tests/declarative_debugger/track_through_catch.exp:
tests/declarative_debugger/typed_unify.exp:
    Update all these expected outputs for the changes in line numbers
    caused by my cleanups of the test cases early in 2015.

    For the declarative_debugger/{condition_bug,sort} test cases, also
    update them for the change to print the types and values of foreign types.

tests/hard_coded/type_qual.{m,exp}:
    This test case failed for an earlier version of this diff, so add some
    context to its outputs, to make such failures easier to debug.
    To make *that* easier, bring it to date in programming style.
2015-08-29 13:07:01 +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
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