Commit Graph

2 Commits

Author SHA1 Message Date
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
7989f17311 Fix some software rot that prevented I/O operations from working in mmos
Estimated hours taken: 6
Branches: main

Fix some software rot that prevented I/O operations from working in mmos
grades. The problem was the change to the I/O module to make it use thread
local storage via a new field of the MR_Context structure which was accessed
via the MR_eng_this_context field of the engine, instead of via the
MR_eng_context field. The new field was not set by the code for initializing
the contexts used by own stack minimal model tabling.

runtime/mercury_context.h:
runtime/mercury_engine.h:
	Add significant new documentation about how fields of the MR_Context
	structure are accessed, both because the documentation is useful and to
	make similar mistakes less likely in future.

	Add a macro for use by own stack minimal model tabling.

runtime/mercury_thread.c:
	Add a comment about a link to mercury_engine.h.

runtime/mercury_thread.h:
	Convert to four-space indentation, and fix some formatting.

runtime/mercury_mm_own_stacks.c:
	Add code for filling in the missing fields of newly created contexts.

runtime/mercury_wrapper.c:
	In own stack minimal model grades, set up the main context properly.
	The previous code was based on a flawed understanding of the
	relationalship between MR_eng_context and MR_eng_this_context.

tests/debugger/mmos_print.{m,inp,exp}:
	Add a new test case (which we don't yet pass due to a problem with
	formatting of mdb output) to test the fix. The old versions of the
	compiler don't pass this test case, because the "p *" commands of the
	debugger invoke I/O code in the Mercury standard library, which fails
	with a segfault due to the thread local fields of generators' contexts
	being uninitialized.

	Note that the .inp aborts execution, because without the abort the
	execution would go into an infinite loop since mmos grades don't yet
	have code for detecting completion.

tests/debugger/Mmakefile:
	Enable the new test case in mmos grades.

	Fix inconsistent indentation.

tests/tabling/Mmakefile:
	Do not try to execute minimal tests in mmos grades, since we don't pass
	them yet, and the symptom is in many cases an infinite loop.
2007-04-17 05:38:22 +00:00