Commit Graph

50 Commits

Author SHA1 Message Date
Zoltan Somogyi
a0d6710407 Use "ts=4 sw=4 expandtab" as modeline ...
... in Mercury.options files.
2023-09-16 19:12:52 +10:00
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
b3b9b87696 Speed up trust tests in the declarative debugger.
browser/declarative_oracle.m:
    Optimize table lookups when checking whether a procedure is trusted.
    Instead of doing three separate lookups to test

    - whether the module in which the procedure is in is trusted,
    - whether the Mercury standard library is trusted, and this module
      is in the Mercury standard library, and
    - whether the predicate or function the procedure is in is trusted,

    look up the module the procedure is in just once, then

    - replace both of the first two lookups above with testing a single flag
      each, and then
    - look up the procedure in a map of trusted predicate or function names.

    The last test should be faster than its old equivalent, because the map
    it searches will be local to the module, whereas it used to be global.

    Print the list of trusted entities (which this module calls trusted
    "objects") in the same order regardless of whether we are printing
    for users or as commands. The order will be the order in which they were
    trusted.

    Undo an unnecessary capitalization in the list of trusted objects.

browser/declarative_debugger.m:
    Improve the style of some related code.

tests/debugger/save.exp:
tests/declarative_debugger/skip.exp:
tests/declarative_debugger/trust.exp:
    Expect the changes described above in the list of trusted objects.
2022-06-28 23:35:41 +10: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
Zoltan Somogyi
80507b2505 Update an expected output for a change on mar 15. 2022-06-25 20:43:48 +10:00
Julien Fischer
132630ab1c Fix failure of tests/declarative_debugger/sort.
tests/declarative_debugger/sort.exp:
    Update this expected output to conform to changes introduced
    in commit e163ea9.
2022-04-16 13:02:34 +10:00
Julien Fischer
f3a34e4651 Replace uses of __ as a module qualifier.
samples/muz.zbstract.m:
tests/*/*.m:
    As above.
2022-04-14 20:25:10 +10:00
Julien Fischer
5d0acda798 Delete obsolete predicates from builtin module.
library/builtin:
    Delete the promise_only_solution/1 and promise_only_solution_io/4. Both
    have have been marked as obsolete since 2015.

    Also delete the non-public impure versions of those, get_one_solution/1
    and get_one_solution_io/4. Implementing the pure versions was the only
    use of these.

compiler/hlds_goal.m:
    Delete a reference to promise_only_solution in a comment.

tests/declarative_debugger/trust.exp:
tests/declarative_debugger/trust.inp:
tests/declarative_debugger/trust_1.m:
     Replace a call to promise_only_solution/1; this does simplify this test
     a little, but does not affect what the trust_1 module was testing, namely
     the user-defined comparison on the type exported by that module.

tests/declarative_debugger/exceptions.m:
tests/hard_coded/myset.m:
tests/hard_coded/user_compare.m:
tests/valid_seq/intermod_nested_module_bug2.m:
extras/curs/samples/nibbles.m:
     Replace calls to the now deleted predicates.
2022-04-13 15:09:21 +10:00
Julien Fischer
fe42c8ba70 Fix the failure of declarative_debugger/throw.
tests/declarative_debugger/throw.exp2:
    Update this expected output, context line numbers have been off
    since some additional comments were added to the head of the test.

tests/declarative_debugger/throw.m:
    Document what the .exp2 file is for.
2022-01-27 03:20:18 +11:00
Zoltan Somogyi
7ba33a69cf Update some missed line numbers. 2022-01-09 08:29:56 +11:00
Zoltan Somogyi
ad1be2b355 Add tests/declarative_debugger/throw.exp4, ...
record what circumstance it is for, and update line numbers in all the other
expected output files.
2022-01-08 08:52:55 +11:00
Zoltan Somogyi
a8e77272ea Fix "failure" of declarative_debugger/throw with -O5.
The compiler has optimizations that try to push the creation of variables
holding constants (specifically, HeadVar__1 = 1 in the q predicate)
to just before the first use of each such variable. The goal paths printed
by the test case depend on whether this has been done. The .exp test case
is the expected output without such optimization, and the test case was
recorded as a failure because there we no .exp* file containing the
expected output with such optimization.

tests/declarative_debugger/throw.exp3:
    Make this .exp3 file contain that expected output.

    The old contents of this file couldn't have been matched since 2005,
    when Ian changed the Mmakefile to execute this test with $(MDB_STD)
    instead of $(MDB).

tests/declarative_debugger/throw.m:
    Record in what circumstances we expect to match the .exp3 file.
2021-08-07 01:29:53 +10:00
Zoltan Somogyi
d361034483 Update expected line numbers after recent diff. 2021-08-02 19:07:03 +10:00
Zoltan Somogyi
cb8c73c592 Fix test failures in trail grades.
tests/declarative_debugger/catch.exp2:
tests/declarative_debugger/catch.exp3:
tests/declarative_debugger/find_origin.exp2:
tests/declarative_debugger/func_call.exp2:
tests/declarative_debugger/gcf.exp2:
tests/declarative_debugger/ho5.exp2:
tests/declarative_debugger/neg_conj.exp2:
tests/declarative_debugger/solns.exp2:
tests/declarative_debugger/throw.exp2:
    Update .exp2 files for line number changes after recent updates
    to source files.

    For the catch test case, swap the .exp2 and .exp3 files first,
    because it looks like the old .exp2, which is the new .exp3,
    is so old that it is probably not an expected output for any
    grade/options combination, and thus should be a candidate for deletion.

tests/declarative_debugger/find_origin.m:
    Improve a comment,

tests/declarative_debugger/catch.m:
    Delete blank last line.
2021-07-30 16:25:26 +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
Peter Wang
96ad867424 Fix declarative_debugger/typed_unify test case.
tests/declarative_debugger/typed_unify.exp:
    A recent change altered the amount of trailing whitespace in the
    output; update.
2021-06-01 16:04:46 +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
Peter Wang
89e59e7cc8 Delete support for browsing terms as XML.
The 'browse --xml' command has not worked with current versions of
xsltproc for quite some time, but we have not received any bug reports,
nor has anyone tried to fix it. We have a method for interactively
exploring a term in 'browse --web' so IMHO there is no need to keep
support for 'browse --xml'.

browser/browse.m:
browser/browser_info.m:
browser/declarative_user.m:
trace/mercury_trace_browse.c:
trace/mercury_trace_browse.h:
trace/mercury_trace_cmd_browsing.c:
trace/mercury_trace_cmd_parameter.c:
trace/mercury_trace_cmd_parameter.h:
trace/mercury_trace_internal.c:
    Delete code.

doc/mdb_categories:
doc/user_guide.texi:
    Delete documentation.

configure.ac:
    Don't search for a XUL browser and xsltproc.

scripts/mdbrc.in:
    Delete 'xml_browser_cmd' and 'xml_tmp_filename' lines.

scripts/xul_tree.xsl:
    Delete now unused file.

scripts/Mmakefile:
    Conform to deletions.

tests/debugger/Mmakefile:
tests/debugger/browser_test.exp:
tests/debugger/browser_test.exp3:
tests/debugger/browser_test.inp:
tests/debugger/mdb_command_test.inp:
tests/debugger/save.exp2:
tests/declarative_debugger/browse_arg.exp:
tests/declarative_debugger/browse_arg.inp:
    Don't test 'browse --xml' any longer.

extras/xml_stylesheets/README:
    Delete reference to 'browse --xml' command.

NEWS:
    Announce change.
2020-10-14 17:41:54 +11:00
Zoltan Somogyi
9cacd33f47 Remove "is" as a synonym for "=", step 1.
This first step deals with the consequences of such removal.
The removal itself will happen in stage 2. That step will
add "is" to the prolog module in the library.

compiler/add_pred.m:
    Prepare for "is" being in the prolog module.

compiler/options.m:
    Add a way to test whether the change to add_pred.m is in the
    installed compiler.

tests/accumulator/base.m:
tests/accumulator/call_in_base.m:
tests/accumulator/chain.m:
tests/accumulator/commutative.m:
tests/accumulator/construct_test.m:
tests/accumulator/dcg.m:
tests/accumulator/deconstruct_test.m:
tests/accumulator/disj.m:
tests/accumulator/func.m:
tests/accumulator/heuristic.m:
tests/accumulator/highorder.m:
tests/accumulator/identity.m:
tests/accumulator/inter.m:
tests/accumulator/nonrec.m:
tests/accumulator/out_to_in.m:
tests/accumulator/qsort.m:
tests/accumulator/simple.m:
tests/accumulator/split.m:
tests/accumulator/swap.m:
tests/benchmarks/cqueens.m:
tests/benchmarks/crypt.m:
tests/benchmarks/deriv.m:
tests/benchmarks/deriv2.m:
tests/benchmarks/nrev.m:
tests/benchmarks/poly.m:
tests/benchmarks/primes.m:
tests/benchmarks/qsort.m:
tests/benchmarks/query.m:
tests/benchmarks/tak.m:
tests/debugger/interactive.m:
tests/declarative_debugger/Mercury.options:
tests/declarative_debugger/io_read_bug.m:
tests/declarative_debugger/queens.exp:
tests/declarative_debugger/queens.m:
tests/dppd/imperative_solve_impl.m:
tests/dppd/map_impl.m:
tests/dppd/max_length_impl.m:
tests/dppd/sum.m:
tests/dppd/upto_sum_impl.m:
tests/par_conj/dep_par_21.m:
tests/tabling/seq.m:
tests/term/dds3_14.m:
tests/term/mmatrix.m:
tests/term/money.m:
tests/term/occur.m:
tests/term/pl4_5_2.m:
tests/term/queens.m:
tests/typeclasses/inference_test.m:
tests/typeclasses/inference_test_2.m:
tests/valid/lazy_list.m:
tests/warnings/duplicate_const.m:
    Replace calls to "is" with unifications. In many places,
    bring programming style up to date.
2020-08-21 10:42:37 +10:00
Zoltan Somogyi
23b446d228 Update line numbers after a recent change. 2020-08-19 01:35:19 +10:00
Zoltan Somogyi
58ea6ffff2 Delete old obsolete predicates and functions.
library/*.m:
    Specifically, delete any predicates and functions whose `pragma obsolete'
    dates from 2018 or before. Keep the ones that were obsoleted
    only this year or last year.

NEWS:
    Announce the changes.

tests/debugger/io_tab_goto.m:
tests/debugger/tabled_read.m:
tests/declarative_debugger/io_stream_test.m:
tests/declarative_debugger/tabled_read_decl.m:
tests/declarative_debugger/tabled_read_decl_goto.m:
tests/general/array_test.m:
tests/hard_coded/mutable_init_impure.m:
tests/hard_coded/remove_file.m:
tests/tabling/mercury_java_parser_dead_proc_elim_bug.m:
tests/tabling/mercury_java_parser_dead_proc_elim_bug2.m:
tests/valid/mercury_java_parser_follow_code_bug.m:
    Replace references to predicates and functions that this diff deletes
    with their suggested replacements.

    In several test cases, bring the programming style up to date.

tests/hard_coded/shift_test.{m,exp}:
    Most of this test case tested the now-deleted legacy shift operations.
    Replace these with tests of their non-legacy versions, including
    testing for the expected exceptions.

tests/hard_coded/shift_test.{m,exp}:
    Don't pass --no-warn-obsolete when compiling shift_test.m anymore.
2020-08-18 11:57:47 +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
Julien Fischer
36a617290c Fix a failing test case.
tests/declarative_debugger/io_stream_test.exp2:
   Update this expected output to conform to the recent addition
   of a distinguishing prefix to the functors of the type io.result_code/0.
2019-01-24 04:25:26 +00:00
Peter Wang
ac1dc91a87 Fix declarative_debugger/named_fields test case.
tests/declarative_debugger/named_fields.inp:
tests/declarative_debugger/named_fields.exp
    Disambiguate break command after introduction of 'array.swap'
    predicate.
2018-12-01 15:47:19 +11:00
Julien Fischer
5deda81dd0 Fix another test a failure in the decldebug grades
tests/declarative_debugger/solns.exp3:
    Conform to changes to the standard library (a while ago)
    that have altered the event numbering here.
2018-07-17 00:05:54 -04:00
Julien Fischer
1f60b62e8b Add character escapes in string_to_doc/1.
library/string.m:
    In addition to surrounding the argument of string_to_doc/1 with double
    quotes, also add the usual character escapes.

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

NEWS:
    Announce this change.
2018-07-17 13:46:35 +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
527edede57 Fix a test case failure in decldebug grades.
tests/declarative_debugger/sort.inp:
tests/declarative_debugger/sort.exp:
   Update the expected output to conform to changes to the io module from a
   while ago; increase the limit on the number of I/O actions printed by the
   declarative debugger, as the changes mean that we now exceed the default
   limit.
2018-07-15 01:55:34 +10:00
Julien Fischer
ca13b54a40 Fix an XXX: escape characters returned by deconstruct.functor/4.
runtime/mercury_ml_expand_body.h:
    Fix an XXX: escape characters in functors.

library/rtti_implementation.m:
    Do the same for the C# and Java backends.

tests/hard_coded/deconstruct_arg.{m,exp}:
    Extend this test to cover the above.

tests/declarative_debugger/io_stream_test.exp2:
    Update this expected output: one of the I/O actions contains
    a newline character and previously the lack of a character escape
    meant that it was split across two lines.
2018-06-09 05:48:46 +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
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
Zoltan Somogyi
53b573692a Convert C code to use // style comments.
runtime/*.[ch]:
trace/*.[chyl]:
    As above. In some places, improve comments, e.g. by expanding contractions
    such as "we've". Add #ifndef guards against double inclusion around
    the trace/*.h files that did not already have them.

tools/*:
    Make the corresponding changes in shell scripts that generate .[ch] files
    in the runtime.

tests/*:
    Conform to a slight change in the text of a message.
2016-07-14 13:57:35 +02:00
Zoltan Somogyi
9727debaaf Update another expected output affected by solutions. 2016-07-09 11:48:40 +02:00
Zoltan Somogyi
a0760327b6 Do stricter checking of mode and determinism declarations.
Specifically, we now do three new checks:

BAD_DETISM: We now generate error messages for predicate declarations
that specify a determinism without also specifying argument modes.

BAD_PREDMODE: We now generate error messages for standalone mode declarations
for predicates whose predicate declaration includes modes for the arguments.

BAD_MODE_SECTION: We now generate error messages for standalone mode
declarations that are not in the same section as the predicate's (or
function's) type declaration.

compiler/hlds_pred.m:
    Add a slot to the pred_sub_info. If the predicate is explicitly defined by
    the user in the current module, this contains the id of the section that
    contains its predicate declaration (for the BAD_MODE_SECTION check)
    and whether that predicate declaration also had modes for the arguments
    (for the BAD_PREDMODE check).

compiler/add_pred.m:
    When adding adding new predicate declarations, perform the BAD_DETISM
    check, and record the info needed for the BAD_PREDMODE and BAD_MODE_SECTION
    checks.

    When adding adding new mode declarations, perform the BAD_PREDMODE
    and BAD_MODE_SECTION checks.

compiler/add_class.m:
compiler/add_mutable_aux_preds.m:
compiler/add_pragma_tabling.m:
compiler/add_pragma_type_spec.m:
compiler/add_solver.m:
compiler/add_special_pred.m:
compiler/check_typeclass.m:
compiler/dep_par_conj.m:
compiler/higher_order.m:
compiler/make_hlds_passes.m:
compiler/table_gen.m:
compiler/unused_args.m:
    Conform to the changes above.

mdbcomp/builtin_modules.m:
    Add a utility predicate for use by new code in add_pred.m.

compiler/comp_unit_interface.m:
compiler/goal_util.m:
compiler/prog_rename.m:
compiler/quantification.m:
deep_profiler/program_representation_utils.m:
library/calendar.m:
library/mutvar.m:
library/pretty_printer.m:
library/random.m:
library/set_ctree234.m:
library/solutions.m:
library/stream.string_writer.m:
profiler/globals.m:
tests/accumulator/nonrec.m:
tests/accumulator/out_to_in.m:
tests/declarative_debugging/library_forwarding.m:
tests/dppd/applast_impl.m:
tests/dppd/grammar_impl.m:
tests/dppd/regexp.m:
tests/dppd/transpose_impl.m:
tests/hard_coded/copy_pred.m:
tests/hard_coded/ho_func_default_inst.m:
tests/recompilation/unchanged_pred_nr_2.m.1:
tests/recompilation/unchanged_pred_nr_2.m.2:
tests/valid/det_switch.m:
tests/valid/inlining_bug.m:
    Delete determinism declarations from predicate and function declarations
    that have no argument mode information, since the BAD_DETISM check
    now makes these errors.

tests/valid/two_pragma_c_codes.m:
    Move some mode declarations to the right section, since the
    BAD_MODE_SECTION check now generates an error for the old code.

tests/invalid/typeclass_bad_method_mode.{m,err_exp}:
    New test case to test for the BAD_PREDMODE check.

tests/invalid/mode_decl_in_wrong_section.{m,err_exp}:
    New test case to test for the BAD_MODE_SECTION check.

tests/invalid/bad_detism.err_exp:
    Add an expected output for this old, but never enabled test case,
    which tests for new check BAD_DETISM.

tests/invalid/Mmakefile:
    Enable the new test cases.

tests/invalid/typeclass_dup_method_mode.m:
    This test case used to have two bugs. One is now by itself in the new
    typeclass_bad_method_mode.m test case, so modify it to contain only
    the other (indistinguishable modes).

tests/invalid/func_errors.err_exp:
tests/invalid/tc_err1.err_exp:
tests/invalid/undef_lambda_mode.err_exp:
tests/invalid/undef_type_mode_qual.err_exp:
    Expect an extra error message from the BAD_DETISM check.
2016-01-13 02:03:16 +11: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
Paul Bone
c654bd1166 Update .gitignore files
tests/.gitignore:
    Ignore *.dep_err

tests/declarative_debugger/.gitignore:
    Ignore dice.pass
2015-11-27 17:10: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
16b30fd239 Fix bootcheck failures in debug grades.
compiler/structure_sharing.analysis.m:
    Fix the failures in tests/structure_reuse.

    This pass invokes liveness, which requires that the arg_info slots
    in pred_infos should be filled in. Invoke generate_arg_info to fill
    them in. (I don't know why they happened to be already filled in
    in non-debug grades.)

tests/declarative_debugger/ignore.{inp2,exp2}:
    Update the line numbers in these files. I updated ignore.{inp,exp}
    when I cleaned up ignore.m, but didn't update these, which are the
    input and expected output for debug grades.
2015-08-16 03:34:12 +10:00
Zoltan Somogyi
4c5ed2890a Update expected output for my recent change. 2015-02-23 14:33:24 +11:00
Zoltan Somogyi
aa2c89d12e Update expected outputs for --debug bootchecks. 2015-02-19 13:46:52 +11: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