[m-rev.] diff: fix failing string_format tests

Peter Ross pro at missioncriticalit.com
Wed Nov 20 22:48:16 AEDT 2002


Hi,

I am not sure if my diagnosis for the agc grades is correct, but on
ceres it is up to over 7 mins of CPU time for string_format_c and still
no output.


===================================================================


Estimated hours taken: 1
Branches: main

Get the string_format tests passing.

tests/general/string_format/Mercury.options:
    Remove some unintentational checked in options.
    Set the heap-size to 30Mb so that we don't run out of heap space in
    the non-gc grades.

tests/general/string_format/Mmakefile:
    Disable the agc grade because the tests take too long to finish.
    
tests/general/string_format/string_format_f.m:
tests/general/string_format/string_format_g.m:
    Only calculate format_strings once, rather then relying on the
    compiler to do duplicate call elemination.  This speeds the tests
    up.

Index: tests/general/string_format/Mercury.options
===================================================================
RCS file: /home/staff/zs/imp/tests/general/string_format/Mercury.options,v
retrieving revision 1.1
diff -u -r1.1 Mercury.options
--- tests/general/string_format/Mercury.options	19 Nov 2002 09:42:27 -0000	1.1
+++ tests/general/string_format/Mercury.options	20 Nov 2002 11:44:29 -0000
@@ -1,2 +1,3 @@
-MCFLAGS=--no-line-numbers
-MS_ILASMFLAGS=/debug
+    # The heap-size must be increased to avoid running out of heap in the
+    # non-gc grades.
+MLFLAGS=--runtime-flags "--heap-size 30000"
Index: tests/general/string_format/Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/tests/general/string_format/Mmakefile,v
retrieving revision 1.1
diff -u -r1.1 Mmakefile
--- tests/general/string_format/Mmakefile	19 Nov 2002 09:42:27 -0000	1.1
+++ tests/general/string_format/Mmakefile	20 Nov 2002 11:45:33 -0000
@@ -6,7 +6,7 @@
 
 # Any program added here should also be added to the `.cvsignore' file.
 
-PROGS=	\
+STRING_FORMAT_PROGS=	\
 		string_format_c \
 		string_format_d \
 		string_format_e \
@@ -16,6 +16,15 @@
 		string_format_s \
 		string_format_u \
 		string_format_x 
+
+
+	# The tests don't work in the *.agc grades, because I think they
+	# take too long to finsih and the CPU time limit is breached.
+ifneq "$(findstring .agc,$(GRADE))" ""
+	PROGS=
+else
+	PROGS=$(STRING_FORMAT_PROGS)
+endif
 
 SUBDIRS = 
 TESTS=$(PROGS)
Index: tests/general/string_format/string_format_f.m
===================================================================
RCS file: /home/staff/zs/imp/tests/general/string_format/string_format_f.m,v
retrieving revision 1.1
diff -u -r1.1 string_format_f.m
--- tests/general/string_format/string_format_f.m	19 Nov 2002 09:42:32 -0000	1.1
+++ tests/general/string_format/string_format_f.m	20 Nov 2002 11:04:16 -0000
@@ -23,12 +23,14 @@
 %------------------------------------------------------------------------------%
 
 main -->
-	list__foldl(output_list(standard_floats), format_strings("f")),
-	list__foldl(output_list(trailing_zero_floats), format_strings("f")),
-	list__foldl(output_list(rounding_floats), format_strings("f")),
-	list__foldl(output_list(extreme_floats), format_strings("f")),
-	list__foldl(output_list(denormal_floats), format_strings("f")),
-	list__foldl(output_list(infinite_floats), format_strings("f")),
+	{ FormatStrs_f = format_strings("f") },
+
+	list__foldl(output_list(standard_floats), FormatStrs_f),
+	list__foldl(output_list(trailing_zero_floats), FormatStrs_f),
+	list__foldl(output_list(rounding_floats), FormatStrs_f),
+	list__foldl(output_list(extreme_floats), FormatStrs_f),
+	list__foldl(output_list(denormal_floats), FormatStrs_f),
+	list__foldl(output_list(infinite_floats), FormatStrs_f),
 	[].
 
 %------------------------------------------------------------------------------%
Index: tests/general/string_format/string_format_g.m
===================================================================
RCS file: /home/staff/zs/imp/tests/general/string_format/string_format_g.m,v
retrieving revision 1.1
diff -u -r1.1 string_format_g.m
--- tests/general/string_format/string_format_g.m	19 Nov 2002 09:42:34 -0000	1.1
+++ tests/general/string_format/string_format_g.m	20 Nov 2002 11:04:18 -0000
@@ -23,19 +23,22 @@
 %------------------------------------------------------------------------------%
 
 main -->
-	list__foldl(output_list(standard_floats), format_strings("g")),
-	list__foldl(output_list(trailing_zero_floats), format_strings("g")),
-	list__foldl(output_list(rounding_floats), format_strings("g")),
-	list__foldl(output_list(extreme_floats), format_strings("g")),
-	list__foldl(output_list(denormal_floats), format_strings("g")),
-	list__foldl(output_list(infinite_floats), format_strings("g")),
+	{ FormatStrs_g = format_strings("g") },
+	{ FormatStrs_G = format_strings("G") },
 
-	list__foldl(output_list(standard_floats), format_strings("G")),
-	list__foldl(output_list(trailing_zero_floats), format_strings("G")),
-	list__foldl(output_list(rounding_floats), format_strings("G")),
-	list__foldl(output_list(extreme_floats), format_strings("G")),
-	list__foldl(output_list(denormal_floats), format_strings("G")),
-	list__foldl(output_list(infinite_floats), format_strings("G")),
+	list__foldl(output_list(standard_floats), FormatStrs_g),
+	list__foldl(output_list(trailing_zero_floats), FormatStrs_g),
+	list__foldl(output_list(rounding_floats), FormatStrs_g),
+	list__foldl(output_list(extreme_floats), FormatStrs_g),
+	list__foldl(output_list(denormal_floats), FormatStrs_g),
+	list__foldl(output_list(infinite_floats), FormatStrs_g),
+
+	list__foldl(output_list(standard_floats), FormatStrs_G),
+	list__foldl(output_list(trailing_zero_floats), FormatStrs_G),
+	list__foldl(output_list(rounding_floats), FormatStrs_G),
+	list__foldl(output_list(extreme_floats), FormatStrs_G),
+	list__foldl(output_list(denormal_floats), FormatStrs_G),
+	list__foldl(output_list(infinite_floats), FormatStrs_G),
 	[].
 
 %------------------------------------------------------------------------------%

----
Peter Ross
PhD Student University of Melbourne
http://www.cs.mu.oz.au/~petdr/
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list