[m-dev.] Failing tests

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Nov 24 14:01:04 AEDT 2004


On 22-Nov-2004, Ian MacLarty <maclarty at cs.mu.OZ.AU> wrote:
> Hi,
> 
> I'm trying to work out why a whole lot of declarative debugger test  
> cases are failing.  When I do a bootcheck they all pass, so I decided  
> to try and simulate the nighly test by running all the commands in the  
> test-latest-jupiter.out file for a failing test manually.  The commands  
> are:
> 
> mmc --generate-dependencies --grade asm_fast.gc      --trace decl -O5  
> --intermodule-optimization --constraint-propagation --opt-space  
> --mercury-linkage shared --pic-reg    closure_dependency
> mmc --make-optimization-interface --grade asm_fast.gc      --trace decl  
> -O5 --intermodule-optimization --constraint-propagation --opt-space  
> --mercury-linkage shared --pic-reg    closure_dependency
> mmc --compile-to-c --grade asm_fast.gc      --trace decl -O5  
> --intermodule-optimization --constraint-propagation --opt-space  
> --mercury-linkage shared --pic-reg    closure_dependency >  
> closure_dependency.err 2>&1
> mgnuc --grade asm_fast.gc      --pic-reg  --      -c  
> closure_dependency.c -o closure_dependency.o
> mgnuc --grade asm_fast.gc      --pic-reg  --      -c  
> closure_dependency_init.c -o closure_dependency_init.o
> ml --grade asm_fast.gc      --trace  --shared       --    -o  
> closure_dependency closure_dependency_init.o \
>         closure_dependency.o \
> 
> However when I run these I get a complaint about  
> closure_dependency_init.c not being found.  Where is this file created?

That file is created by c2init, e.g. with commands something like this:

	c2init --grade asm_fast.gc --init-c-file closure_dependency_init.c closure_dependency.c

These are not shown by "make" because the commands in question
have an "@" in front of them in the .dep file.

If you apply the following patch, `mmc --generate-dependencies' will
generate a ".dep" file without the "@".

Index: modules.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/modules.m,v
retrieving revision 1.308
diff -u -d -u -r1.308 modules.m
--- modules.m	16 Oct 2004 15:07:30 -0000	1.308
+++ modules.m	24 Nov 2004 02:46:28 -0000
@@ -4877,10 +4907,10 @@
 	io__write_strings(DepStream, [
 		ForceC2InitTarget, " :\n\n",
 		InitCFileName, " : ", ForceC2InitTarget, "\n",
-		"\t@$(C2INIT) $(ALL_GRADEFLAGS) $(ALL_C2INITFLAGS) ",
+		"\t$(C2INIT) $(ALL_GRADEFLAGS) $(ALL_C2INITFLAGS) ",
 			"--init-c-file ", TmpInitCFileName,
 			" $(", MakeVarName, ".init_cs) $(ALL_C2INITARGS)\n",
-		"\t at mercury_update_interface ", InitCFileName, "\n\n"
+		"\tmercury_update_interface ", InitCFileName, "\n\n"
 	]),
 
 	module_name_to_lib_file_name("lib", ModuleName, ".install_ints", no,

> In the test-latest-jupiter.out file I only get the following clue as to  
> why the test is failing:
> 
> MERCURY_OPTIONS="$MERCURY_OPTIONS -de" HOME=/nonexistent  
> MERCURY_SUPPRESS_MDB_BANNER=yes mdb ./closure_dependency  <  
> closure_dependency.inp \
>         > closure_dependency.out 2>&1
> gmake[7]: *** [closure_dependency.out] Error 1
> gmake[7]: Target `closure_dependency.runtest' not remade because of  
> errors.

You would get more information if the Mmakefile ina
tests/debugger/declarative was better.

Have a look at the rule for creating *.out files in
tests/Mmake.common:

	%.out: %
		{ [ -f $*.inp ] && cat $*.inp; } | ./$< > $@ 2>&1 || \
				{ grep . $@ /dev/null; exit 1; }


Notice the part starting with "||"  and continuing on to the next line.
This displays the contents of the ".out" file if the command to build
it fails.  (It uses "grep . $@ /dev/null" rather than "cat $@" so
that each line of the output is prefixed by the file name.)

It would be nice to modify the rules in tests/debugger/declarative
to do the same...

-- 
Fergus Henderson                    |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list