Commit Graph

4 Commits

Author SHA1 Message Date
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
Ian MacLarty
17ca99b27e Fix a bug in my recent diff to allow retries over predicates which are
Estimated hours taken: 2
Branches: main

Fix a bug in my recent diff to allow retries over predicates which are
passed an io.state in their polymorphic arguments.

The IO action number was not being reset if a retry was done over
a predicate with an io.state in one of its polymorphic arguments.

tests/debugger/Mercury.options:
	Enable io tabling on poly_io_retry.

tests/debugger/poly_io_retry.exp:
tests/debugger/poly_io_retry.inp:
tests/debugger/poly_io_retry.m:
	Test the bug fix.
	Previously reexecuting the first call to polycall/3 would result
	in another "1" being displayed.

trace/mercury_trace.c:
	Find the IO action number of the call being retried to if a
	polymorphic argument with an io.state value is found.
2005-05-13 13:45:32 +00:00
Ian MacLarty
5ecee352bd Allow retries over procedures which are called with an io.state type in one of
Estimated hours taken: 3
Branches: main

Allow retries over procedures which are called with an io.state type in one of
their polymorphic arguments.

tests/debugger/Mmakefile:
tests/debugger/poly_io_retry.exp:
tests/debugger/poly_io_retry.inp:
tests/debugger/poly_io_retry.m:
	Test we can retry over a procedure with an io.state in it's
	polymorphic arguments.  Prevoiusly the retry would give an error
	message like "some inputs are missing".

trace/mercury_trace.c:
	Construct the type parameters for a call and pass these to
	MR_is_io_state so it can instantiate any polymorphic arguments before
	checking if they are io.state.

	Set has_io_state to true if we find an io.state argument, since this
	would not have been done previously if the argument was polymorphic.
2005-05-11 09:39:22 +00:00