Files
mercury/tests/debugger/user_event_shallow.exp
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

67 lines
2.0 KiB
Plaintext

E1: C1 CALL pred user_event_shallow.main/2-0 (cc_multi) user_event_shallow.m:20
mdb> echo on
Command echo enabled.
mdb> register --quiet
mdb> user
E2: C2 USER <safe_test> pred user_event_shallow.queen/2-0 (nondet) c3; user_event_shallow.m:36
mdb> retry
Cannot perform retry because information about the input arguments is not available.
mdb> print *
test_list (attr 0, Out) [1, 2, 3, 4, 5]
Data (arg 1) [1, 2, 3, 4, 5]
mdb> browse !test_list
browser> p
[1, 2, 3, 4, 5]
browser> ^2^1
browser> p
2
browser> quit
mdb> user_event_context proc
User events will get only procedure contexts printed.
mdb> user
E3: C3 USER <nodiag_fail> pred user_event_shallow.nodiag/3-0 (semidet) s2-2;c4;t;c2;
mdb> user_event_context none
User events will get no contexts printed.
mdb> current
E3: C3 USER <nodiag_fail>
mdb> user_event_context
User events get no contexts printed.
mdb> user_event_context full
User events will get full contexts printed.
mdb> current
E3: C3 USER <nodiag_fail> pred user_event_shallow.nodiag/3-0 (semidet) s2-2;c4;t;c2; user_event_shallow.m:71
mdb> user_event_context file
User events will get only file contexts printed.
mdb> current
E3: C3 USER <nodiag_fail> user_event_shallow.m:71
mdb> vars
1 test_failed (attr 0)
2 arg_b (attr 1, B)
3 arg_d (attr 2, N)
4 arg_list (attr 3, HeadVar__3)
5 B (arg 1)
6 D (arg 2)
7 HeadVar__3
8 BmN
9 L
10 N
11 NmB
mdb> print *
test_failed (attr 0) "N - B"
arg_b (attr 1, B) 1
arg_d (attr 2, N) 2
arg_list (attr 3, HeadVar__3) [2, 3, 4, 5]
D (arg 2) 1
BmN -1
L [3, 4, 5]
NmB 1
mdb> print !arg_b
arg_b (attr 1, B) 1
mdb> user
E4: C2 USER <safe_test> user_event_shallow.m:36
mdb> print *
test_list (attr 0, Out) [1, 2, 3, 5, 4]
Data (arg 1) [1, 2, 3, 4, 5]
mdb> continue
[1, 3, 5, 2, 4]