[m-rev.] diff: fix tests/invalid in grade java

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Feb 20 15:00:52 AEDT 2004


Estimated hours taken: 1
Branches: main

Fix the failure of tests/invalid/foreign_decl_line_number and
tests/invalid/type_spec in grade java, and some related cleanups.

tests/invalid/Mmakefile:
	Disable the foreign_decl_line_number test case for grades which
	don't support the C interface.

	Enable the nonexistent_import test in all cases,
	rather than only when --use-subdirs is not specified,
	since it does not seem to be in any way specific to --use-subdirs
	and passes fine even when --use-subdirs is not specified.

Workspace: /home/jupiter/fjh/ws-jupiter/mercury
Index: tests/invalid/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/Mmakefile,v
retrieving revision 1.147
diff -u -d -r1.147 Mmakefile
--- tests/invalid/Mmakefile	8 Jan 2004 07:16:53 -0000	1.147
+++ tests/invalid/Mmakefile	20 Feb 2004 03:56:58 -0000
@@ -65,7 +65,6 @@
 	ext_type_bug \
 	exported_mode \
 	field_syntax_error \
-	foreign_decl_line_number \
 	foreign_singleton \
 	foreign_type_2 \
 	foreign_type_visibility \
@@ -99,6 +98,7 @@
 	multisoln_func \
 	nested_impl_in_int \
 	no_exports \
+	nonexistent_import \
 	not_a_switch \
 	nullary_ho_func_error \
 	occurs \
@@ -141,7 +141,6 @@
 	typeclass_test_9 \
 	typeclass_test_10 \
 	types	\
-	type_spec \
 	unbound_type_vars \
 	undeclared_mode \
 	undef_lambda_mode \
@@ -158,22 +157,17 @@
 	vars_in_wrong_places \
 	with_type
 
-# The following tests can only be run when building with --use-subdirs
-# Note that tests which are compiled with --use-subdirs (or --make,
-# which implies --use-subdirs) can only be run if we are building with
-# --use-subdirs, otherwise (1) these tests will create the `Mercury'
-# subdirectory, which will mean that all remaining tests get run with
-# --use-subdirs and (2) if we're testing against a work-space, and the
-# workspace wasn't built with --use-subdirs, these tests will fail with
-# some misleading error messages, due to the standard library not being
-# in the expected place.
-USE_SUBDIR_MODULES = \
-	nonexistent_import
-
 # The following require that num_tag_bits >= 1
 RESERVE_TAG_MODULES = \
 	reserve_tag
 
+# The following require that the back-end support the C interface
+C_INTERFACE_MODULES = \
+	foreign_decl_line_number
+
+# The following require that the compiler not ignore `pragma type_spec' declarations
+TYPE_SPEC_MODULES = \
+	type_spec
 
 # XXX we do not yet pass the following tests:
 #	foreign_type_line_number (due to some errors being reported in .c
@@ -197,19 +191,37 @@
 
 #-----------------------------------------------------------------------------#
 
+# These tests test things which only work for back-ends which support the C interface.
+ifneq "$(filter java% il%,$(GRADE))" ""
+C_INTERFACE_PROGS=
+else
+C_INTERFACE_PROGS=$(C_INTERFACE_MODULES)
+endif
+
 # The java and il grades compile with num_tag_bits = 0.
 ifneq "$(filter java% il%,$(GRADE))" ""
-SINGLEMODULE_PROGS=$(SINGLEMODULE) 
+RESERVE_TAG_PROGS =
 else
-SINGLEMODULE_PROGS=$(SINGLEMODULE) $(RESERVE_TAG_MODULES)
+RESERVE_TAG_PROGS = $(RESERVE_TAG_MODULES)
 endif
 
-ifeq ($(MMAKE_USE_SUBDIRS),yes)
-PROGS= $(SINGLEMODULE_PROGS) $(MULTIMODULE_PROGS) $(USE_SUBDIR_MODULES)
+# The java back-end ignores pragma type_spec, so it doesn't diagnose errors in them.
+# (XXX Perhaps the code to ignore them in make_hlds.m should be moved to after the
+# error-checking?)
+ifneq "$(filter java%,$(GRADE))" ""
+TYPE_SPEC_PROGS =
 else
-PROGS= $(SINGLEMODULE_PROGS) $(MULTIMODULE_PROGS)
+TYPE_SPEC_PROGS = $(TYPE_SPEC_MODULES)
 endif
 
+SINGLEMODULE_PROGS = $(SINGLEMODULE) \
+	$(C_INTERFACE_PROGS) \
+	$(RESERVE_TAG_PROGS) \
+	$(TYPE_SPEC_PROGS)
+
+#-----------------------------------------------------------------------------#
+
+PROGS= $(SINGLEMODULE_PROGS) $(MULTIMODULE_PROGS)
 TESTS = $(MULTIMODULE_PROGS) $(SINGLEMODULE_PROGS:%=%-nodepend)
 SUBDIRS = purity
 TESTS_DIR=..

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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