[m-dev.] diff: exception goal paths in test cases
Zoltan Somogyi
zs at cs.mu.OZ.AU
Wed Nov 1 15:05:13 AEDT 2000
tests/debugger/Mmakefile:
tests/debugger/declarative/Mmakefile:
Strip away goal paths from exception events in the test cases that
generate them, because different optimization levels cause different
goals paths to be associated with exceptions.
tests/debugger/*.exp{,2}:
tests/debugger/declarative/*.exp{,2}:
Strip away goal paths from exception events in the expected outputs
of those test cases.
Zoltan.
cvs diff: Diffing .
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
Index: tests/debugger/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/Mmakefile,v
retrieving revision 1.44
diff -u -b -r1.44 Mmakefile
--- tests/debugger/Mmakefile 2000/10/13 04:06:36 1.44
+++ tests/debugger/Mmakefile 2000/11/01 00:55:42
@@ -98,36 +98,71 @@
# particular line numbers in the standard library source code.
exception_value.out: exception_value exception_value.inp
$(MDB) ./exception_value < exception_value.inp 2>&1 | \
- sed 's/exception.m:[0-9]*/exception.m:NNNN/g' \
- > exception_value.out 2>&1
+ sed -e 's/exception.m:[0-9]*/exception.m:NNNN/g' | \
+ sed -e '/EXCP/s/).*/)/' > exception_value.out 2>&1
-# The exception_vars test is supposed to return a non-zero
-# exit status, since it exits by throwing an exception.
-# Likewise for the exception_cmd and polymorphic_output test cases.
+# The exception_cmd, exception_vars, polymorphic_output and loopcheck tests
+# are supposed to return a non-zero exit status, since they exit by throwing
+# an exception. We strip the goal paths from their exception events, since
+# the exact goal paths are dependent on optimization level. The stripping
+# must be done outside the condition of the if-then-else.
exception_cmd.out: exception_cmd exception_cmd.inp
if $(MDB) ./exception_cmd < exception_cmd.inp \
- > exception_cmd.out 2>&1; \
+ > exception_cmd.tmp 2>&1; \
then \
+ sed -e '/EXCP/s/).*/)/' < exception_cmd.tmp \
+ > exception_cmd.out 2>&1; \
+ rm exception_cmd.tmp; \
false; \
else \
+ sed -e '/EXCP/s/).*/)/' < exception_cmd.tmp \
+ > exception_cmd.out 2>&1; \
+ rm exception_cmd.tmp; \
true; \
fi
exception_vars.out: exception_vars exception_vars.inp
if $(MDB) ./exception_vars < exception_vars.inp \
- > exception_vars.out 2>&1; \
+ > exception_vars.tmp 2>&1; \
then \
+ sed -e '/EXCP/s/).*/)/' < exception_vars.tmp \
+ > exception_vars.out 2>&1; \
+ rm exception_vars.tmp; \
false; \
else \
+ sed -e '/EXCP/s/).*/)/' < exception_vars.tmp \
+ > exception_vars.out 2>&1; \
+ rm exception_vars.tmp; \
true; \
fi
polymorphic_output.out: polymorphic_output polymorphic_output.inp
if $(MDB) ./polymorphic_output < polymorphic_output.inp \
+ > polymorphic_output.tmp 2>&1; \
+ then \
+ sed -e '/EXCP/s/).*/)/' < polymorphic_output.tmp\
+ > polymorphic_output.out 2>&1; \
+ rm polymorphic_output.tmp; \
+ false; \
+ else \
+ sed -e '/EXCP/s/).*/)/' < polymorphic_output.tmp\
> polymorphic_output.out 2>&1; \
+ rm polymorphic_output.tmp; \
+ true; \
+ fi
+
+loopcheck.out: loopcheck loopcheck.inp
+ if $(MDB) ./loopcheck < loopcheck.inp \
+ > loopcheck.tmp 2>&1; \
then \
+ sed -e '/EXCP/s/).*/)/' < loopcheck.tmp \
+ > loopcheck.out 2>&1; \
+ rm loopcheck.tmp; \
false; \
else \
+ sed -e '/EXCP/s/).*/)/' < loopcheck.tmp \
+ > loopcheck.out 2>&1; \
+ rm loopcheck.tmp; \
true; \
fi
@@ -145,10 +180,6 @@
interpreter.out: interpreter interpreter.inp
$(MDB) ./interpreter interpreter.m < interpreter.inp \
> interpreter.out 2>&1
-
-# loopcheck aborts, so we must ignore the exit status
-loopcheck.out: loopcheck loopcheck.inp
- -$(MDB) ./loopcheck < loopcheck.inp > loopcheck.out 2>&1
# We need to pipe the output through sed to avoid hard-coding dependencies on
# particular line numbers in the standard library source code.
Index: tests/debugger/exception_cmd.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/exception_cmd.exp,v
retrieving revision 1.2
diff -u -b -r1.2 exception_cmd.exp
--- tests/debugger/exception_cmd.exp 2000/10/13 04:06:37 1.2
+++ tests/debugger/exception_cmd.exp 2000/11/01 00:22:45
@@ -2,7 +2,7 @@
mdb> echo on
Command echo enabled.
mdb> exception
- 4: 2 2 EXCP pred exception_cmd:test/2-0 (det) t;c2; exception_cmd.m:18 (exception_cmd.m:12)
+ 4: 2 2 EXCP pred exception_cmd:test/2-0 (det)
mdb> print *
HeadVar__1 42
mdb> continue
Index: tests/debugger/exception_cmd.exp2
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/exception_cmd.exp2,v
retrieving revision 1.2
diff -u -b -r1.2 exception_cmd.exp2
--- tests/debugger/exception_cmd.exp2 2000/10/18 14:37:59 1.2
+++ tests/debugger/exception_cmd.exp2 2000/11/01 00:22:49
@@ -2,7 +2,7 @@
mdb> echo on
Command echo enabled.
mdb> exception
- 5: 3 3 EXCP pred require:error/1-0 (erroneous) c3; require.m:90 (exception_cmd.m:18)
+ 5: 3 3 EXCP pred require:error/1-0 (erroneous)
mdb> print *
HeadVar__1 "oops"
mdb> continue
Index: tests/debugger/exception_value.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/exception_value.exp,v
retrieving revision 1.2
diff -u -b -r1.2 exception_value.exp
--- tests/debugger/exception_value.exp 2000/10/13 04:06:37 1.2
+++ tests/debugger/exception_value.exp 2000/11/01 00:22:57
@@ -9,7 +9,7 @@
mdb> continue
3: 3 3 CALL pred exception_value:p/1-0 (det) exception_value.m:30
mdb> finish
- 4: 3 3 EXCP pred exception_value:p/1-0 (det) c3; exception_value.m:31
+ 4: 3 3 EXCP pred exception_value:p/1-0 (det)
mdb> print exception
"p exception"
mdb> continue
@@ -19,7 +19,7 @@
exception(univ("p exception" : string))
7: 5 3 CALL pred exception_value:q/1-0 (det) exception_value.m:35
mdb> finish
- 8: 5 3 EXCP pred exception_value:q/1-0 (det) c16; exception_value.m:36
+ 8: 5 3 EXCP pred exception_value:q/1-0 (det)
mdb> browse exception
browser> set depth 9
browser> set size 99
Index: tests/debugger/exception_value.exp2
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/exception_value.exp2,v
retrieving revision 1.2
diff -u -b -r1.2 exception_value.exp2
--- tests/debugger/exception_value.exp2 2000/10/18 14:38:01 1.2
+++ tests/debugger/exception_value.exp2 2000/11/01 00:23:03
@@ -9,14 +9,14 @@
mdb> continue
4: 4 4 CALL pred exception_value:p/1-0 (det) exception_value.m:30 (exception.m:NNNN)
mdb> finish
- 7: 4 4 EXCP pred exception_value:p/1-0 (det) c3; exception_value.m:31 (exception.m:NNNN)
+ 7: 4 4 EXCP pred exception_value:p/1-0 (det)
mdb> print exception
"p exception"
mdb> continue
exception(univ("p exception" : string))
18: 11 4 CALL pred exception_value:q/1-0 (det) exception_value.m:35 (exception.m:NNNN)
mdb> finish
- 21: 11 4 EXCP pred exception_value:q/1-0 (det) c16; exception_value.m:36 (exception.m:NNNN)
+ 21: 11 4 EXCP pred exception_value:q/1-0 (det)
mdb> browse exception
browser> set depth 9
browser> set size 99
Index: tests/debugger/exception_vars.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/exception_vars.exp,v
retrieving revision 1.5
diff -u -b -r1.5 exception_vars.exp
--- tests/debugger/exception_vars.exp 2000/10/13 04:06:37 1.5
+++ tests/debugger/exception_vars.exp 2000/11/01 00:23:08
@@ -4,7 +4,7 @@
mdb> goto 2
2: 2 2 CALL pred exception_vars:test/2-0 (det) exception_vars.m:19 (exception_vars.m:12)
mdb> finish
- 4: 2 2 EXCP pred exception_vars:test/2-0 (det) t;c2; exception_vars.m:18 (exception_vars.m:12)
+ 4: 2 2 EXCP pred exception_vars:test/2-0 (det)
mdb> print *
HeadVar__1 42
mdb> continue
Index: tests/debugger/exception_vars.exp2
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/exception_vars.exp2,v
retrieving revision 1.6
diff -u -b -r1.6 exception_vars.exp2
--- tests/debugger/exception_vars.exp2 2000/10/18 14:38:01 1.6
+++ tests/debugger/exception_vars.exp2 2000/11/01 00:23:12
@@ -4,7 +4,7 @@
mdb> goto 2
2: 2 2 CALL pred exception_vars:test/2-0 (det) exception_vars.m:19 (exception_vars.m:12)
mdb> finish
- 6: 2 2 EXCP pred exception_vars:test/2-0 (det) t;c2; exception_vars.m:18 (exception_vars.m:12)
+ 6: 2 2 EXCP pred exception_vars:test/2-0 (det)
mdb> print *
HeadVar__1 42
mdb> continue
Index: tests/debugger/loopcheck.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/loopcheck.exp,v
retrieving revision 1.3
diff -u -b -r1.3 loopcheck.exp
--- tests/debugger/loopcheck.exp 2000/10/13 04:06:38 1.3
+++ tests/debugger/loopcheck.exp 2000/11/01 00:24:21
@@ -16,11 +16,11 @@
loopcheck.m:21
7: 3 3 THEN pred loopcheck:loop/1-0 (erroneous) c3;e;t;
loopcheck.m:21
- 8: 3 3 EXCP pred loopcheck:loop/1-0 (erroneous) c3;e;t;c2;
+ 8: 3 3 EXCP pred loopcheck:loop/1-0 (erroneous)
loopcheck.m:21 (from loopcheck.m:21)
- 9: 2 2 EXCP pred loopcheck:loop/1-0 (erroneous) c3;e;e;c2;
+ 9: 2 2 EXCP pred loopcheck:loop/1-0 (erroneous)
loopcheck.m:21 (from loopcheck.m:14)
- 10: 1 1 EXCP pred loopcheck:main/2-0 (det) c2;
+ 10: 1 1 EXCP pred loopcheck:main/2-0 (det)
loopcheck.m:14
Uncaught exception:
Software Error: detected infinite recursion in pred loopcheck:loop/1
Index: tests/debugger/loopcheck.exp2
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/loopcheck.exp2,v
retrieving revision 1.4
diff -u -b -r1.4 loopcheck.exp2
--- tests/debugger/loopcheck.exp2 2000/10/18 14:38:01 1.4
+++ tests/debugger/loopcheck.exp2 2000/11/01 00:24:32
@@ -18,13 +18,13 @@
loopcheck.m:21
8: 4 4 CALL pred require:error/1-0 (erroneous)
require.m:89 (from loopcheck.m:21)
- 9: 4 4 EXCP pred require:error/1-0 (erroneous) c3;
+ 9: 4 4 EXCP pred require:error/1-0 (erroneous)
require.m:90 (from loopcheck.m:21)
- 10: 3 3 EXCP pred loopcheck:loop/1-0 (erroneous) c3;e;t;c2;
+ 10: 3 3 EXCP pred loopcheck:loop/1-0 (erroneous)
loopcheck.m:21 (from loopcheck.m:21)
- 11: 2 2 EXCP pred loopcheck:loop/1-0 (erroneous) c3;e;e;c2;
+ 11: 2 2 EXCP pred loopcheck:loop/1-0 (erroneous)
loopcheck.m:21 (from loopcheck.m:14)
- 12: 1 1 EXCP pred loopcheck:main/2-0 (det) c2;
+ 12: 1 1 EXCP pred loopcheck:main/2-0 (det)
loopcheck.m:14
Uncaught exception:
Software Error: detected infinite recursion in pred loopcheck:loop/1
Index: tests/debugger/polymorphic_output.exp2
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/polymorphic_output.exp2,v
retrieving revision 1.4
diff -u -b -r1.4 polymorphic_output.exp2
--- tests/debugger/polymorphic_output.exp2 2000/10/18 14:38:02 1.4
+++ tests/debugger/polymorphic_output.exp2 2000/11/01 00:24:10
@@ -12,7 +12,7 @@
HeadVar__1 two("three", 3, three("four", 4, "one", 1, empty, empty, empty), two/4)
HeadVar__2 3
mdb> f
- 10: 6 4 EXCP func std_util:det_arg/3-0 (det) e;t;c2;
+ 10: 6 4 EXCP func std_util:det_arg/3-0 (det)
mdb> P
HeadVar__1 two("three", 3, three("four", 4, "one", 1, empty, empty, empty), two/4)
HeadVar__2 3
cvs diff: Diffing tests/debugger/declarative
Index: tests/debugger/declarative/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/Mmakefile,v
retrieving revision 1.21
diff -u -b -r1.21 Mmakefile
--- tests/debugger/declarative/Mmakefile 2000/10/01 17:03:35 1.21
+++ tests/debugger/declarative/Mmakefile 2000/11/01 00:21:35
@@ -152,7 +152,8 @@
$(MDB) ./solutions < solutions.inp > solutions.out 2>&1
throw.out: throw throw.inp
- $(MDB) ./throw < throw.inp > throw.out 2>&1
+ $(MDB) ./throw < throw.inp 2>&1 | sed -e '/EXCP/s/).*/)/' \
+ > throw.out 2>&1
untraced_subgoal.out: untraced_subgoal untraced_subgoal.inp
$(MDB) ./untraced_subgoal < untraced_subgoal.inp \
Index: tests/debugger/declarative/throw.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/throw.exp,v
retrieving revision 1.3
diff -u -b -r1.3 throw.exp
--- tests/debugger/declarative/throw.exp 2000/10/13 04:06:44 1.3
+++ tests/debugger/declarative/throw.exp 2000/11/01 00:22:03
@@ -9,7 +9,7 @@
mdb> continue
2: 2 2 CALL pred throw:p/1-0 (cc_nondet) throw.m:20
mdb> finish
- 31: 2 2 EXCP pred throw:p/1-0 (cc_nondet) q!;c2; throw.m:22
+ 31: 2 2 EXCP pred throw:p/1-0 (cc_nondet)
mdb> dd
Call p(_)
Throws "Too big"
@@ -23,7 +23,7 @@
p(_)
"Too big"
Is this a bug? yes
- 31: 2 2 EXCP pred throw:p/1-0 (cc_nondet) q!;c2; throw.m:22
+ 31: 2 2 EXCP pred throw:p/1-0 (cc_nondet)
mdb> continue
mdb: warning: reached unknown label
This may result in some exception events
@@ -31,7 +31,7 @@
exception(univ("Too big" : string))
32: 6 2 CALL pred throw:q/1-0 (semidet) throw.m:48
mdb> finish
- 65: 6 2 EXCP pred throw:q/1-0 (semidet) c2;~;q!;c2;~;c2;q!;c1; throw.m:52
+ 65: 6 2 EXCP pred throw:q/1-0 (semidet)
mdb> dd
Call q(_)
Throws "Too big"
@@ -45,7 +45,7 @@
q(_)
"Too big"
Is this a bug? yes
- 65: 6 2 EXCP pred throw:q/1-0 (semidet) c2;~;q!;c2;~;c2;q!;c1; throw.m:52
+ 65: 6 2 EXCP pred throw:q/1-0 (semidet)
mdb> continue
mdb: warning: reached unknown label
This may result in some exception events
Index: tests/debugger/declarative/throw.exp2
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/throw.exp2,v
retrieving revision 1.3
diff -u -b -r1.3 throw.exp2
--- tests/debugger/declarative/throw.exp2 2000/10/18 14:38:04 1.3
+++ tests/debugger/declarative/throw.exp2 2000/11/01 00:23:31
@@ -9,7 +9,7 @@
mdb> continue
3: 3 3 CALL pred throw:p/1-0 (cc_nondet) throw.m:20 (exception.m:320)
mdb> finish
- 34: 3 3 EXCP pred throw:p/1-0 (cc_nondet) q!;c2; throw.m:22 (exception.m:320)
+ 34: 3 3 EXCP pred throw:p/1-0 (cc_nondet)
mdb> dd
Call p(_)
Throws "Too big"
@@ -23,12 +23,12 @@
p(_)
"Too big"
Is this a bug? yes
- 34: 3 3 EXCP pred throw:p/1-0 (cc_nondet) q!;c2; throw.m:22 (exception.m:320)
+ 34: 3 3 EXCP pred throw:p/1-0 (cc_nondet)
mdb> continue
exception(univ("Too big" : string))
41: 11 3 CALL pred throw:q/1-0 (semidet) throw.m:48 (exception.m:320)
mdb> finish
- 76: 11 3 EXCP pred throw:q/1-0 (semidet) c2;~;q!;c2;~;c2;q!;c1; throw.m:52 (exception.m:320)
+ 76: 11 3 EXCP pred throw:q/1-0 (semidet)
mdb> dd
Call q(_)
Throws "Too big"
@@ -42,6 +42,6 @@
q(_)
"Too big"
Is this a bug? yes
- 76: 11 3 EXCP pred throw:q/1-0 (semidet) c2;~;q!;c2;~;c2;q!;c1; throw.m:52 (exception.m:320)
+ 76: 11 3 EXCP pred throw:q/1-0 (semidet)
mdb> continue
exception(univ("Too big" : string))
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing trax
cvs diff: Diffing trial
cvs diff: Diffing util
--------------------------------------------------------------------------
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