[m-dev.] trivial diff: fix code rot in tests/debugger/interactive

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Nov 20 23:49:48 AEDT 1999


Estimated hours taken: 0.5

Fix some code rot in the (disabled) test case tests/debugger/interactive.

tests/debugger/Mmakefile:
tests/debugger/interactive.inp:
tests/debugger/interactive.exp:
	Fix some places where the renaming of this test from `queens'
	to `interactive' had not been fully reflected in all the
	relevant places.
	Also fix a bug: put the option `--pic-regs' in `GRADEFLAGS-interactive'
	rather than `MGNUCFLAGS-interactive'.

tests/debugger/interactive.exp:
	Update to reflect recent changes, e.g. addition of line numbers
	in the debugger output.

Workspace: /d-drive/home/hg/public/test_mercury/test_dirs/hg
Index: tests/debugger/Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/tests/debugger/Mmakefile,v
retrieving revision 1.29
diff -u -d -r1.29 Mmakefile
--- tests/debugger/Mmakefile	1999/10/08 02:42:10	1.29
+++ tests/debugger/Mmakefile	1999/11/20 12:42:28
@@ -40,7 +40,7 @@
 
 # We need to use shared libraries for interactive queries to work.
 # The following is necessary for shared libraries to work on Linux.
-MGNUCFLAGS-interactive = --pic-reg
+GRADEFLAGS-interactive = --pic-reg
 MLFLAGS-interactive = --shared
 
 # Base grades `jump' and `fast' cannot be used with
@@ -128,10 +128,10 @@
 		    -e 's/<predicate .interactive:qperm.\/2 mode 0>.//' \
 		    -e '/__start$$/N' \
 		    -e 's/__start.//' \
-		    > queens.out
+		    > interactive.out
 	# ignore egcs internal errors -- those are not our fault
-	if grep 'gcc.*Internal compiler error' queens.out; then \
-		cp queens.exp queens.out; \
+	if grep 'gcc.*Internal compiler error' interactive.out; then \
+		cp interactive.exp interactive.out; \
 	fi
 
 # We ignore the result of this action because
Index: tests/debugger/interactive.exp
===================================================================
RCS file: /home/staff/zs/imp/tests/debugger/interactive.exp,v
retrieving revision 1.1
diff -u -d -r1.1 interactive.exp
--- tests/debugger/interactive.exp	1999/04/16 01:12:57	1.1
+++ tests/debugger/interactive.exp	1999/11/20 12:39:46
@@ -1,103 +1,99 @@
-       1:      1  1 CALL pred interactive:main/2-0 (cc_multi) 
+       1:      1  1 CALL pred interactive:main/2-0 (cc_multi) interactive.m:21
 mdb> echo on
 Command echo enabled.
 mdb> print *
-       HeadVar__1           		state('<<c_pointer>>')
+       HeadVar__1             	state('<<c_pointer>>')
 mdb> 
-       2:      2  2 CALL pred interactive:data/1-0 (det) 
+       2:      2  2 CALL pred interactive:data/1-0 (det) interactive.m:40 (interactive.m:19)
 mdb> print *
 mdb: there are no live variables.
 mdb> 
-       3:      2  2 EXIT pred interactive:data/1-0 (det) 
+       3:      2  2 EXIT pred interactive:data/1-0 (det) interactive.m:40 (interactive.m:19)
 mdb> print *
-       HeadVar__1           		[1, 2, 3, 4, 5]
+       HeadVar__1             	[1, 2, 3, 4, 5]
 mdb> 
-       4:      3  2 CALL pred interactive:queen/2-0 (nondet) 
+       4:      3  2 CALL pred interactive:queen/2-0 (nondet) interactive.m:42 (interactive.m:19)
 mdb> print *
-       HeadVar__1           		[1, 2, 3, 4, 5]
+       HeadVar__1             	[1, 2, 3, 4, 5]
 mdb> 
-       5:      4  3 CALL pred interactive:qperm/2-0 (nondet) 
+       5:      4  3 CALL pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:43)
 mdb> print *
-       HeadVar__1           		[1, 2, 3, 4, 5]
+       HeadVar__1             	[1, 2, 3, 4, 5]
 mdb> 
-       6:      4  3 SWTC pred interactive:qperm/2-0 (nondet) s1;
+       6:      4  3 SWTC pred interactive:qperm/2-0 (nondet) s1; interactive.m:47
 mdb> print *
-       HeadVar__1           		[1, 2, 3, 4, 5]
+       HeadVar__1             	[1, 2, 3, 4, 5]
 mdb> 
-       7:      5  4 CALL pred interactive:qdelete/3-0 (nondet) 
+       7:      5  4 CALL pred interactive:qdelete/3-0 (nondet) interactive.m:52 (interactive.m:48)
 mdb> print *
-       HeadVar__2           		[1, 2, 3, 4, 5]
+       HeadVar__2             	[1, 2, 3, 4, 5]
 mdb> 
-       8:      5  4 DISJ pred interactive:qdelete/3-0 (nondet) c2;d1;
+       8:      5  4 DISJ pred interactive:qdelete/3-0 (nondet) c2;d1; interactive.m:52
 mdb> print *
-       HeadVar__2           		[1, 2, 3, 4, 5]
-       V_10                 		[2, 3, 4, 5]
-       V_11                 		1
+       HeadVar__2             	[1, 2, 3, 4, 5]
 mdb> level 1
-   1       5       4    3 pred interactive:qperm/2-0 (nondet) 
-Ancestor level set to 1.
+Ancestor level set to 1:
+   1  pred interactive:qperm/2-0 (nondet) interactive.m:48
 mdb> print *
-       HeadVar__1           		[1, 2, 3, 4, 5]
+       HeadVar__1             	[1, 2, 3, 4, 5]
 mdb> up 1
-   2       4       3    2 pred interactive:queen/2-0 (nondet) 
-Ancestor level set to 2.
+Ancestor level set to 2:
+   2  pred interactive:queen/2-0 (nondet) interactive.m:43
 mdb> vars
-        0 HeadVar__1
+        1 HeadVar__1
 mdb> print *
-       HeadVar__1           		[1, 2, 3, 4, 5]
+       HeadVar__1             	[1, 2, 3, 4, 5]
 mdb> 
-       9:      5  4 EXIT pred interactive:qdelete/3-0 (nondet) 
+       9:      5  4 EXIT pred interactive:qdelete/3-0 (nondet) interactive.m:52 (interactive.m:48)
 mdb> print HeadVar__1
-       HeadVar__1           		1
+       HeadVar__1             	1
 mdb> print HeadVar__2
-       HeadVar__2           		[1, 2, 3, 4, 5]
+       HeadVar__2             	[1, 2, 3, 4, 5]
 mdb> print HeadVar__3
-       HeadVar__3           		[2, 3, 4, 5]
+       HeadVar__3             	[2, 3, 4, 5]
 mdb> 
-      10:      6  4 CALL pred interactive:qperm/2-0 (nondet) 
+      10:      6  4 CALL pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:50)
 mdb> print *
-       HeadVar__1           		[2, 3, 4, 5]
+       HeadVar__1             	[2, 3, 4, 5]
 mdb> 
-      11:      6  4 SWTC pred interactive:qperm/2-0 (nondet) s1;
+      11:      6  4 SWTC pred interactive:qperm/2-0 (nondet) s1; interactive.m:47
 mdb> print *
-       HeadVar__1           		[2, 3, 4, 5]
+       HeadVar__1             	[2, 3, 4, 5]
 mdb> 
-      12:      7  5 CALL pred interactive:qdelete/3-0 (nondet) 
+      12:      7  5 CALL pred interactive:qdelete/3-0 (nondet) interactive.m:52 (interactive.m:48)
 mdb> print *
-       HeadVar__2           		[2, 3, 4, 5]
+       HeadVar__2             	[2, 3, 4, 5]
 mdb> 
-      13:      7  5 DISJ pred interactive:qdelete/3-0 (nondet) c2;d1;
+      13:      7  5 DISJ pred interactive:qdelete/3-0 (nondet) c2;d1; interactive.m:52
 mdb> print *
-       HeadVar__2           		[2, 3, 4, 5]
-       V_10                 		[3, 4, 5]
-       V_11                 		2
+       HeadVar__2             	[2, 3, 4, 5]
 mdb> 
-      14:      7  5 EXIT pred interactive:qdelete/3-0 (nondet) 
+      14:      7  5 EXIT pred interactive:qdelete/3-0 (nondet) interactive.m:52 (interactive.m:48)
 mdb> print *
-       HeadVar__1           		2
-       HeadVar__2           		[2, 3, 4, 5]
-       HeadVar__3           		[3, 4, 5]
+       HeadVar__1             	2
+       HeadVar__2             	[2, 3, 4, 5]
+       HeadVar__3             	[3, 4, 5]
 mdb> 
-      15:      8  5 CALL pred interactive:qperm/2-0 (nondet) 
+      15:      8  5 CALL pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:50)
 mdb> goto -a 20
-      16:      8  5 SWTC pred interactive:qperm/2-0 (nondet) s1;
-      17:      9  6 CALL pred interactive:qdelete/3-0 (nondet) 
-      18:      9  6 DISJ pred interactive:qdelete/3-0 (nondet) c2;d1;
-      19:      9  6 EXIT pred interactive:qdelete/3-0 (nondet) 
-      20:     10  6 CALL pred interactive:qperm/2-0 (nondet) 
+      16:      8  5 SWTC pred interactive:qperm/2-0 (nondet) s1; interactive.m:47
+      17:      9  6 CALL pred interactive:qdelete/3-0 (nondet) interactive.m:52 (interactive.m:48)
+      18:      9  6 DISJ pred interactive:qdelete/3-0 (nondet) c2;d1; interactive.m:52
+      19:      9  6 EXIT pred interactive:qdelete/3-0 (nondet) interactive.m:52 (interactive.m:48)
+      20:     10  6 CALL pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:50)
 mdb> stack
-   0    4* pred interactive:qperm/2-0 (nondet)
-   4       pred interactive:queen/2-0 (nondet)
-   5       pred interactive:main/2-0 (cc_multi)
+   0    4* pred interactive:qperm/2-0 (nondet) (interactive.m:46 and others)
+   4       pred interactive:queen/2-0 (nondet) (interactive.m:43)
+   5       pred interactive:main/2-0 (cc_multi) (interactive.m:19)
 mdb> stack -d
-   0      20      10    6 pred interactive:qperm/2-0 (nondet)
-   1      15       8    5 pred interactive:qperm/2-0 (nondet)
-   2      10       6    4 pred interactive:qperm/2-0 (nondet)
-   3       5       4    3 pred interactive:qperm/2-0 (nondet)
-   4       4       3    2 pred interactive:queen/2-0 (nondet)
-   5       1       1    1 pred interactive:main/2-0 (cc_multi)
+   0      20      10    6 pred interactive:qperm/2-0 (nondet) (interactive.m:46)
+   1      15       8    5 pred interactive:qperm/2-0 (nondet) (interactive.m:50)
+   2      10       6    4 pred interactive:qperm/2-0 (nondet) (interactive.m:50)
+   3       5       4    3 pred interactive:qperm/2-0 (nondet) (interactive.m:50)
+   4       4       3    2 pred interactive:queen/2-0 (nondet) (interactive.m:43)
+   5       1       1    1 pred interactive:main/2-0 (cc_multi) (interactive.m:19)
 mdb> print *
-       HeadVar__1           		[4, 5]
+       HeadVar__1             	[4, 5]
 mdb> #
 Unknown command `#'. Give the command `help' for help.
 mdb> # Test interactive queries.
@@ -106,7 +102,7 @@
 Unknown command `#'. Give the command `help' for help.
 mdb> mmc_options --use-subdirs
 mdb> mmc_options
-mdb> query queens list
+mdb> query interactive list
 ?- <stdin>:026: Inferred :- pred query((list:list(character)), (list:list(character))).
 <stdin>:026: Inferred :- mode query(out, out) is multi.
 X = [], Y = ['a', 'b', 'c'], true ;
@@ -179,7 +175,7 @@
 For more information, try recompiling with `-E'.
 Compilation error(s) occurred.
 ?- 
-mdb>  cc_query queens list
+mdb>  cc_query interactive list
 ?- <stdin>:017: Inferred :- pred query((list:list(character)), (list:list(character))).
 <stdin>:017: Inferred :- mode query(out, out) is multi.
 X = [], Y = ['a', 'b', 'c'], true.
@@ -209,7 +205,7 @@
 <stdin>:017: Inferred :- mode query(out, out) is nondet.
 No solution.
 ?- 
-mdb>  io_query queens list
+mdb>  io_query interactive list
 run <-- [1, 3, 5, 2, 4]
 run <-- X = [], Y = ['a', 'b', 'c']
 run <-- [1, 2, 3]
@@ -223,55 +219,55 @@
 retry
       20:     10  6 CALL pred interactive:qperm/2-0 (nondet) 
 mdb> print *
-       HeadVar__1           		[4, 5]
+       HeadVar__1             	[4, 5]
 mdb> finish -a
-      21:     10  6 SWTC pred interactive:qperm/2-0 (nondet) s1;
-      22:     11  7 CALL pred interactive:qdelete/3-0 (nondet) 
-      23:     11  7 DISJ pred interactive:qdelete/3-0 (nondet) c2;d1;
-      24:     11  7 EXIT pred interactive:qdelete/3-0 (nondet) 
-      25:     12  7 CALL pred interactive:qperm/2-0 (nondet) 
-      26:     12  7 SWTC pred interactive:qperm/2-0 (nondet) s1;
-      27:     13  8 CALL pred interactive:qdelete/3-0 (nondet) 
-      28:     13  8 DISJ pred interactive:qdelete/3-0 (nondet) c2;d1;
-      29:     13  8 EXIT pred interactive:qdelete/3-0 (nondet) 
-      30:     14  8 CALL pred interactive:qperm/2-0 (nondet) 
-      31:     14  8 SWTC pred interactive:qperm/2-0 (nondet) s2;
-      32:     14  8 EXIT pred interactive:qperm/2-0 (nondet) 
-      33:     12  7 EXIT pred interactive:qperm/2-0 (nondet) 
-      34:     10  6 EXIT pred interactive:qperm/2-0 (nondet) 
+      21:     10  6 SWTC pred interactive:qperm/2-0 (nondet) s1; interactive.m:47
+      22:     11  7 CALL pred interactive:qdelete/3-0 (nondet) interactive.m:52 (interactive.m:48)
+      23:     11  7 DISJ pred interactive:qdelete/3-0 (nondet) c2;d1; interactive.m:52
+      24:     11  7 EXIT pred interactive:qdelete/3-0 (nondet) interactive.m:52 (interactive.m:48)
+      25:     12  7 CALL pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:50)
+      26:     12  7 SWTC pred interactive:qperm/2-0 (nondet) s1; interactive.m:47
+      27:     13  8 CALL pred interactive:qdelete/3-0 (nondet) interactive.m:52 (interactive.m:48)
+      28:     13  8 DISJ pred interactive:qdelete/3-0 (nondet) c2;d1; interactive.m:52
+      29:     13  8 EXIT pred interactive:qdelete/3-0 (nondet) interactive.m:52 (interactive.m:48)
+      30:     14  8 CALL pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:50)
+      31:     14  8 SWTC pred interactive:qperm/2-0 (nondet) s2; interactive.m:46
+      32:     14  8 EXIT pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:50)
+      33:     12  7 EXIT pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:50)
+      34:     10  6 EXIT pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:50)
 mdb> register --quiet
 mdb> break print_list
  0: + stop  interface pred interactive:print_list/3-0 (det)
 mdb> break qdelete
  1: + stop  interface pred interactive:qdelete/3-0 (nondet)
 mdb> continue -a
-      35:      8  5 EXIT pred interactive:qperm/2-0 (nondet) 
-      36:      6  4 EXIT pred interactive:qperm/2-0 (nondet) 
-      37:      4  3 EXIT pred interactive:qperm/2-0 (nondet) 
-      38:     15  3 CALL pred interactive:safe/1-0 (semidet) 
-      39:     15  3 SWTC pred interactive:safe/1-0 (semidet) s1;
-      40:     16  4 CALL pred interactive:nodiag/3-0 (semidet) 
-      41:     16  4 SWTC pred interactive:nodiag/3-0 (semidet) s1;
-      42:     16  4 THEN pred interactive:nodiag/3-0 (semidet) s1;c4;t;
-      43:     16  4 FAIL pred interactive:nodiag/3-0 (semidet) 
-      44:     15  3 FAIL pred interactive:safe/1-0 (semidet) 
-      45:      4  3 REDO pred interactive:qperm/2-0 (nondet) 
-      46:      6  4 REDO pred interactive:qperm/2-0 (nondet) 
-      47:      8  5 REDO pred interactive:qperm/2-0 (nondet) 
-      48:     10  6 REDO pred interactive:qperm/2-0 (nondet) 
-      49:     12  7 REDO pred interactive:qperm/2-0 (nondet) 
-      50:     14  8 REDO pred interactive:qperm/2-0 (nondet) 
-      51:     14  8 FAIL pred interactive:qperm/2-0 (nondet) 
-      52:     13  8 REDO pred interactive:qdelete/3-0 (nondet) 
+      35:      8  5 EXIT pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:50)
+      36:      6  4 EXIT pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:50)
+      37:      4  3 EXIT pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:43)
+      38:     15  3 CALL pred interactive:safe/1-0 (semidet) interactive.m:56 (interactive.m:44)
+      39:     15  3 SWTC pred interactive:safe/1-0 (semidet) s1; interactive.m:57
+      40:     16  4 CALL pred interactive:nodiag/3-0 (semidet) interactive.m:61 (interactive.m:58)
+      41:     16  4 SWTC pred interactive:nodiag/3-0 (semidet) s1; interactive.m:62
+      42:     16  4 THEN pred interactive:nodiag/3-0 (semidet) s1;c4;t; interactive.m:66
+      43:     16  4 FAIL pred interactive:nodiag/3-0 (semidet) interactive.m:61 (interactive.m:58)
+      44:     15  3 FAIL pred interactive:safe/1-0 (semidet) interactive.m:56 (interactive.m:44)
+      45:      4  3 REDO pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:43)
+      46:      6  4 REDO pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:50)
+      47:      8  5 REDO pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:50)
+      48:     10  6 REDO pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:50)
+      49:     12  7 REDO pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:50)
+      50:     14  8 REDO pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:50)
+      51:     14  8 FAIL pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:50)
+      52:     13  8 REDO pred interactive:qdelete/3-0 (nondet) interactive.m:52 (interactive.m:48)
 mdb> step -aS 5
-      53:     13  8 DISJ pred interactive:qdelete/3-0 (nondet) c2;d2;
-      54:     17  9 CALL pred interactive:qdelete/3-0 (nondet) 
-      55:     17  9 FAIL pred interactive:qdelete/3-0 (nondet) 
-      56:     13  8 FAIL pred interactive:qdelete/3-0 (nondet) 
-      57:     12  7 FAIL pred interactive:qperm/2-0 (nondet) 
+      53:     13  8 DISJ pred interactive:qdelete/3-0 (nondet) c2;d2; interactive.m:53
+      54:     17  9 CALL pred interactive:qdelete/3-0 (nondet) interactive.m:52 (interactive.m:54)
+      55:     17  9 FAIL pred interactive:qdelete/3-0 (nondet) interactive.m:52 (interactive.m:54)
+      56:     13  8 FAIL pred interactive:qdelete/3-0 (nondet) interactive.m:52 (interactive.m:48)
+      57:     12  7 FAIL pred interactive:qperm/2-0 (nondet) interactive.m:46 (interactive.m:50)
 mdb> disable 1
  1: - stop  interface pred interactive:qdelete/3-0 (nondet)
 mdb> continue -n
-     675:    141  2 CALL pred interactive:print_list/3-0 (det) 
+     675:    141  2 CALL pred interactive:print_list/3-0 (det) interactive.m:83 (interactive.m:22)
 mdb> continue -n -S
 [1, 3, 5, 2, 4]
Index: tests/debugger/interactive.inp
===================================================================
RCS file: /home/staff/zs/imp/tests/debugger/interactive.inp,v
retrieving revision 1.1
diff -u -d -r1.1 interactive.inp
--- tests/debugger/interactive.inp	1999/04/16 01:12:57	1.1
+++ tests/debugger/interactive.inp	1999/11/20 12:29:15
@@ -43,19 +43,19 @@
 #
 mmc_options --use-subdirs
 mmc_options
-query queens list
+query interactive list
 append(X, Y, ['a', 'b', 'c']).
 qperm([1,2,3], List).
 qperm([1,2,3], List), List = [2 | _].
 qperm([1,2,3], List), List = [4 | _].
 qperm([1,2,"foo"], List).
 qperm(List, [1]).
-quit. cc_query queens list
+quit. cc_query interactive list
 append(X, Y, ['a', 'b', 'c']).
 qperm([1,2,3], List).
 qperm([1,2,3], List), List = [2 | _].
 qperm([1,2,3], List), List = [4 | _].
-quit. io_query queens list
+quit. io_query interactive list
 main.
 if { append(X, Y, ['a', 'b', 'c']) } then
 	print("X = "), print(X), 

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- 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