4 Commits

Author SHA1 Message Date
Zoltan Somogyi
ec97594862 Use test case numbers according to our conventions ...
... in some previously overlooked test cases.

tests/debugger/Mercury.options:
tests/debugger/Mmakefile:
tests/debugger/completion.completion_helper_1.m:
tests/debugger/completion.completion_helper_2.completion_helper_3.m:
tests/debugger/completion.completion_helper_2.m:
tests/debugger/completion.exp:
tests/debugger/completion.inp:
tests/debugger/completion.m:
    Rename completion.sub1.m to completion.completion_helper_1.m,
    rename completion.sub2.m to completion.completion_helper_2.m, and
    rename completion.sub2.sub3.m to
    completion.completion_helper_2.completion_helper_3.m.

tests/debugger/poly_io_retry_1.exp:
tests/debugger/poly_io_retry_1.inp:
tests/debugger/poly_io_retry_1.m:
tests/debugger/poly_io_retry_2.exp:
tests/debugger/poly_io_retry_2.inp:
tests/debugger/poly_io_retry_2.m:
    Rename poly_io_retry/poly_io_retry2 to poly_io_retry_[12].

tests/debugger/shallow.exp:
tests/debugger/shallow.m:
tests/debugger/shallow_helper_1.m:
    Rename shallow2.m to shallow_helper_1.m.

tests/debugger/user_event_1.exp:
tests/debugger/user_event_1.inp:
tests/debugger/user_event_1.m:
    Rename user_event to user_event_1, due to the existence of user_event_2.

tests/general/Mmakefile:
tests/general/det_complicated_unify_1.exp:
tests/general/det_complicated_unify_1.m:
tests/general/det_complicated_unify_2.exp:
tests/general/det_complicated_unify_2.m:
    Rename det_complicated_unify/det_complicated_unify2 to
    det_complicated_unify_[12]. Note: only det_complicated_unify_1
    is currently enabled.

tests/general/double_error_1.exp:
tests/general/double_error_1.m:
tests/general/double_error_2.exp:
tests/general/double_error_2.m:
    Rename double_error/double_error2 as double_error_[12].

tests/general/liveness_1.exp:
tests/general/liveness_1.m:
tests/general/liveness_2.exp:
tests/general/liveness_2.m:
    Rename liveness/liveness2 as liveness_[12].

tests/hard_coded/Mercury.options:
tests/hard_coded/Mmakefile:
tests/hard_coded/user_defined_equality_1.exp:
tests/hard_coded/user_defined_equality_1.m:
tests/hard_coded/user_defined_equality_2.exp:
tests/hard_coded/user_defined_equality_2.m:
    Rename user_defined_equality/user_defined_equality2 as
    user_defined_equality_[12].

tests/tabling/Mmakefile:
tests/tabling/expand_tuple_1.exp:
tests/tabling/expand_tuple_1.m:
tests/tabling/expand_tuple_2.exp:
tests/tabling/expand_tuple_2.m:
    Rename expand_tuple/expand_tuple2 as expand_tuple_[12].
2024-08-12 15:24:24 +02:00
Zoltan Somogyi
59b11f84ce Update the debugger test directory.
Replace __ with . as the module qualifier symbol.

Replace references to io.state with just io.

Replace DCGs with state variables.

Replace (C->T;E) syntax for if-then-elses with (if C then T else E) syntax.

Replace if-then-elses with switches when possible and where this does not
affect what is being tested.

Replace separate pred and mode declarations with predmode declarations.

Put predicate and function declarations just before the definition
of the predicate or function.

Delete unneeded module qualifications on predicate and function declarations
and definitions.

Update .exp files (and if needed, .inp files) for the line number changes
that result from the above.

For tests that have more than one .exp file and where one of those files
is affected by the above, add a section to the source file header that says
which .exp file is for what grade, with XXXs for the (as yet) unknown parts.
2018-08-28 21:20:59 +10: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
Simon Taylor
32051f5467 Add support for command line completion to mdb.
Estimated hours taken: 40
Branches: main

Add support for command line completion to mdb.

NEWS:
	Document the change.

trace/mercury_trace_completion.{c,h}:
	Define the framework for completion.
	Examine command lines to determine which completers to use.

trace/mercury_trace_alias.{c,h}:
trace/mercury_trace_help.{c,h}:
trace/mercury_trace_internal.{c,h}:
trace/mercury_trace_tables.{c,h}:
trace/mercury_trace_vars.{c,h}:
	Define context-specific completers.

trace/mercury_trace_help.c:
	Record all help topics in an array for use by the completer.

trace/mercury_trace_internal.c:
	Add completion information to the list of commands.
	Add a function MR_trace_command_completion_info to access
	that information.

runtime/mercury_wrapper.{c,h}
	Add a runtime option `--force-readline', which tells mdb to
	use readline even if MR_mdb_in is not a tty. This is needed
	for tests/debugger/completion. `--force-readline' is not
	documented because I'm not sure that it will work properly
	in all situations (it's fine for the test).

	Fix capitalisation in references to the Mercury User's Guide
	in error messages.

trace/mercury_trace_readline.c:
	Tell Readline to use our completer.

	Handle `--force-readline'. Disable some Readline terminal
	initialisation code which reports spurious warnings if the
	input stream is not a tty.

trace/Mmakefile:
	Add mercury_trace_completion.{c,h}.

runtime/mercury_array_macros.h:
	Define a macro MR_find_first_match, which is like MR_bsearch
	except that it finds the first match, not an arbitrary match.

runtime/mercury_memory.c:
	Handle NULL pointers in MR_copy_string();

runtime/mercury_memory.h:
	Add a macro MR_free_func which returns the address of free().
	Used where it is necessary to pass the address of MR_free().

tests/debugger/Mmakefile:
tests/debugger/completion.m:
tests/debugger/completion.exp:
tests/debugger/completion.inp:
tests/debugger/completion.inputrc:
tests/debugger/completion.sub1.m:
tests/debugger/completion.sub2.m:
tests/debugger/completion.sub2.sub3.m:
	Test case.
2002-03-06 14:35:06 +00:00