[m-dev.] diff: fix debugger test case failures

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Jan 23 12:13:23 AEDT 2000


Estimated hours taken: 0.5

Fix a problem where one of the debugger test cases
was failing due to a change to library/io.m affecting
the line numbers in the debugger output.

tests/debugger/Mmakefile:
	Pipe the output of several test cases through sed,
	so we can avoid hard-coding the line numbers of code
	in the standard library in the expected output for
	those test cases.

tests/debugger/browser_test.exp2:
tests/debugger/multi_parameter.exp2:
tests/debugger/existential_type_classes.exp2:
	Replace hard-coded line numbers with "NNNN".

Workspace: /mnt/ender/home/ender2/test_mercury_quicksilver
Index: tests/debugger/Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/tests/debugger/Mmakefile,v
retrieving revision 1.34
diff -u -d -r1.34 Mmakefile
--- tests/debugger/Mmakefile	1999/12/21 01:23:42	1.34
+++ tests/debugger/Mmakefile	2000/01/23 01:06:29
@@ -67,8 +67,11 @@
 breakpoints.out: breakpoints breakpoints.inp
 	$(MDB) ./breakpoints < breakpoints.inp > breakpoints.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.
 browser_test.out: browser_test browser_test.inp
-	$(MDB) ./browser_test < browser_test.inp > browser_test.out 2>&1
+	$(MDB) ./browser_test < browser_test.inp 2>&1 | \
+		sed 's/io.m:[0-9]*/io.m:NNNN/g' > browser_test.out 2>&1
 
 debugger_regs.out: debugger_regs debugger_regs.inp
 	$(MDB) ./debugger_regs < debugger_regs.inp > debugger_regs.out 2>&1
@@ -84,10 +87,12 @@
 		true;						\
 	fi
 
+# We need to pipe the output through sed to avoid hard-coding dependencies on
+# particular line numbers in the standard library source code.
 existential_type_classes.out: existential_type_classes \
 			existential_type_classes.inp
-	$(MDB) ./existential_type_classes < existential_type_classes.inp \
-		> existential_type_classes.out 2>&1
+	$(MDB) ./existential_type_classes < existential_type_classes.inp 2>&1 | \
+		sed 's/string.m:[0-9]*/string.m:NNNN/g' > existential_type_classes.out
 
 implied_instance.out: implied_instance implied_instance.inp
 	$(MDB) ./implied_instance < implied_instance.inp \
@@ -101,9 +106,11 @@
 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.
 multi_parameter.out: multi_parameter multi_parameter.inp
-	$(MDB) ./multi_parameter < multi_parameter.inp \
-		> multi_parameter.out 2>&1
+	$(MDB) ./multi_parameter < multi_parameter.inp 2>&1 | \
+		sed 's/char.m:[0-9]*/char.m:NNNN/g' > multi_parameter.out
 
 queens.out: queens queens.inp
 	$(MDB) ./queens < queens.inp > queens.out 2>&1
Index: tests/debugger/browser_test.exp2
===================================================================
RCS file: /home/staff/zs/imp/tests/debugger/browser_test.exp2,v
retrieving revision 1.6
diff -u -d -r1.6 browser_test.exp2
--- tests/debugger/browser_test.exp2	1999/12/14 02:30:24	1.6
+++ tests/debugger/browser_test.exp2	2000/01/23 01:03:01
@@ -83,9 +83,9 @@
        2:      2  2 CALL pred browser_test:big_data/1-0 (det) browser_test.m:18 (browser_test.m:12)
 mdb> continue -a
        3:      2  2 EXIT pred browser_test:big_data/1-0 (det) browser_test.m:18 (browser_test.m:12)
-       4:      3  2 CALL pred io:print/3-0 (det) io.m:1791 (browser_test.m:13)
-big(big(big(small, 1, small), 2, small), 3, big(big(small, 4, big(small, 5, small)), 6, small))       5:      3  2 EXIT pred io:print/3-0 (det) io.m:1791 (browser_test.m:13)
-       6:      4  2 CALL pred io:write_string/3-0 (det) io.m:2845 (browser_test.m:14)
+       4:      3  2 CALL pred io:print/3-0 (det) io.m:NNNN (browser_test.m:13)
+big(big(big(small, 1, small), 2, small), 3, big(big(small, 4, big(small, 5, small)), 6, small))       5:      3  2 EXIT pred io:print/3-0 (det) io.m:NNNN (browser_test.m:13)
+       6:      4  2 CALL pred io:write_string/3-0 (det) io.m:NNNN (browser_test.m:14)
 .
-       7:      4  2 EXIT pred io:write_string/3-0 (det) io.m:2845 (browser_test.m:14)
+       7:      4  2 EXIT pred io:write_string/3-0 (det) io.m:NNNN (browser_test.m:14)
        8:      1  1 EXIT pred browser_test:main/2-0 (det) browser_test.m:11
Index: tests/debugger/existential_type_classes.exp2
===================================================================
RCS file: /home/staff/zs/imp/tests/debugger/existential_type_classes.exp2,v
retrieving revision 1.8
diff -u -d -r1.8 existential_type_classes.exp2
--- tests/debugger/existential_type_classes.exp2	1999/11/20 01:03:27	1.8
+++ tests/debugger/existential_type_classes.exp2	2000/01/23 01:02:18
@@ -55,9 +55,9 @@
 mdb> continue -a
       13:      9  5 CALL existential_type_classes.m:47 (from existential_type_classes.m:25)
                          pred existential_type_classes:string_foo/2-0 (det)
-      14:     10  6 CALL string.m:1692 (from existential_type_classes.m:47)
+      14:     10  6 CALL string.m:NNNN (from existential_type_classes.m:47)
                          pred string:length/2-0 (det)
-      15:     10  6 EXIT string.m:1692 (from existential_type_classes.m:47)
+      15:     10  6 EXIT string.m:NNNN (from existential_type_classes.m:47)
                          pred string:length/2-0 (det)
       16:      9  5 EXIT existential_type_classes.m:47 (from existential_type_classes.m:25)
                          pred existential_type_classes:string_foo/2-0 (det)
Index: tests/debugger/multi_parameter.exp2
===================================================================
RCS file: /home/staff/zs/imp/tests/debugger/multi_parameter.exp2,v
retrieving revision 1.8
diff -u -d -r1.8 multi_parameter.exp2
--- tests/debugger/multi_parameter.exp2	1999/11/20 01:03:27	1.8
+++ tests/debugger/multi_parameter.exp2	2000/01/23 01:02:34
@@ -20,12 +20,12 @@
        HeadVar__1             	'z'
 mdb> 
        5:      5  5 CALL pred char:to_int/2-0 (det)
-                         char.m:402 (from multi_parameter.m:20)
+                         char.m:NNNN (from multi_parameter.m:20)
 mdb> print *
        Character              	'z'
 mdb> 
        6:      5  5 EXIT pred char:to_int/2-0 (det)
-                         char.m:402 (from multi_parameter.m:20)
+                         char.m:NNNN (from multi_parameter.m:20)
 mdb> print *
        Character              	'z'
        Int                    	122

-- 
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