[m-dev.] diff: tests/debugger/exception_vars
Zoltan Somogyi
zs at cs.mu.OZ.AU
Fri Jul 21 13:15:22 AEST 2000
This satisfies a request in Fergus's review of one of my previous changes.
tests/debugger/exception_cmd.*:
New test case to test the "exception" command.
tests/debugger/exception_vars.*:
Put this test case back the way it was.
Mmakefile:
Enable the new test case.
Zoltan.
cvs diff: Diffing .
Index: Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/Mmakefile,v
retrieving revision 1.41
diff -u -b -r1.41 Mmakefile
--- Mmakefile 2000/06/19 07:59:18 1.41
+++ Mmakefile 2000/07/21 02:01:18
@@ -22,6 +22,7 @@
browse_pretty \
browser_test \
debugger_regs \
+ exception_cmd \
exception_value \
exception_vars \
existential_type_classes \
@@ -100,7 +101,16 @@
# The exception_vars test is supposed to return a non-zero
# exit status, since it exits by throwing an exception.
-# Likewise for the polymorphic_output test case.
+# Likewise for the exception_cmd and polymorphic_output test cases.
+exception_cmd.out: exception_cmd exception_cmd.inp
+ if $(MDB) ./exception_cmd < exception_cmd.inp \
+ > exception_cmd.out 2>&1; \
+ then \
+ false; \
+ else \
+ true; \
+ fi
+
exception_vars.out: exception_vars exception_vars.inp
if $(MDB) ./exception_vars < exception_vars.inp \
> exception_vars.out 2>&1; \
@@ -109,6 +119,7 @@
else \
true; \
fi
+
polymorphic_output.out: polymorphic_output polymorphic_output.inp
if $(MDB) ./polymorphic_output < polymorphic_output.inp \
> polymorphic_output.out 2>&1; \
Index: exception_cmd.exp
===================================================================
RCS file: exception_cmd.exp
diff -N exception_cmd.exp
--- /dev/null Thu Mar 4 04:20:11 1999
+++ exception_cmd.exp Fri Jul 21 12:30:15 2000
@@ -0,0 +1,12 @@
+ 1: 1 1 CALL pred exception_cmd:main/2-0 (det) exception_cmd.m:12
+mdb> echo on
+Command echo enabled.
+mdb> exception
+ 4: 2 2 EXCP pred exception_cmd:test/2-0 (det) exception_cmd.m:18 (exception_cmd.m:12)
+mdb> print *
+ HeadVar__1 42
+mdb> continue
+Uncaught exception:
+Software Error: oops
+Last trace event was event #5.
+Last trace event before the unhandled exception was event #3.
Index: exception_cmd.exp2
===================================================================
RCS file: exception_cmd.exp2
diff -N exception_cmd.exp2
--- /dev/null Thu Mar 4 04:20:11 1999
+++ exception_cmd.exp2 Fri Jul 21 12:05:06 2000
@@ -0,0 +1,12 @@
+ 1: 1 1 CALL pred exception_cmd:main/2-0 (det) exception_cmd.m:12
+mdb> echo on
+Command echo enabled.
+mdb> exception
+ 5: 3 3 EXCP pred require:error/1-0 (erroneous) require.m:90 (exception_cmd.m:18)
+mdb> print *
+ HeadVar__1 "oops"
+mdb> continue
+Uncaught exception:
+Software Error: oops
+Last trace event was event #9.
+Last trace event before the unhandled exception was event #4.
Index: exception_cmd.inp
===================================================================
RCS file: exception_cmd.inp
diff -N exception_cmd.inp
--- /dev/null Thu Mar 4 04:20:11 1999
+++ exception_cmd.inp Fri Jul 21 10:46:56 2000
@@ -0,0 +1,4 @@
+echo on
+exception
+print *
+continue
Index: exception_cmd.m
===================================================================
RCS file: exception_cmd.m
diff -N exception_cmd.m
--- /dev/null Thu Mar 4 04:20:11 1999
+++ exception_cmd.m Fri Jul 21 11:39:30 2000
@@ -0,0 +1,21 @@
+:- module exception_cmd.
+
+:- interface.
+:- import_module io.
+
+:- pred main(io__state::di, io__state::uo) is det.
+
+:- implementation.
+
+:- import_module require, int.
+
+main --> { test(42, X) }, print(X).
+
+:- pred test(int::in, int::out) is det.
+
+test(X, Y) :-
+ ( X > 0 ->
+ error("oops")
+ ;
+ Y = X + 1
+ ).
Index: exception_vars.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/exception_vars.exp,v
retrieving revision 1.3
diff -u -b -r1.3 exception_vars.exp
--- exception_vars.exp 2000/07/18 03:58:28 1.3
+++ exception_vars.exp 2000/07/21 00:46:00
@@ -1,7 +1,9 @@
1: 1 1 CALL pred exception_vars:main/2-0 (det) exception_vars.m:12
mdb> echo on
Command echo enabled.
-mdb> excp
+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) exception_vars.m:18 (exception_vars.m:12)
mdb> print *
HeadVar__1 42
Index: exception_vars.exp2
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/exception_vars.exp2,v
retrieving revision 1.4
diff -u -b -r1.4 exception_vars.exp2
--- exception_vars.exp2 2000/07/18 03:58:29 1.4
+++ exception_vars.exp2 2000/07/21 00:46:22
@@ -1,7 +1,9 @@
1: 1 1 CALL pred exception_vars:main/2-0 (det) exception_vars.m:12
mdb> echo on
Command echo enabled.
-mdb> excp
+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) exception_vars.m:18 (exception_vars.m:12)
mdb> print *
HeadVar__1 42
Index: exception_vars.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/exception_vars.inp,v
retrieving revision 1.3
diff -u -b -r1.3 exception_vars.inp
--- exception_vars.inp 2000/07/18 03:58:29 1.3
+++ exception_vars.inp 2000/07/21 00:44:56
@@ -1,4 +1,5 @@
echo on
-excp
+goto 2
+finish
print *
continue
cvs diff: Diffing declarative
--------------------------------------------------------------------------
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