mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-21 20:33:55 +00:00
Estimated hours taken: 80 Add support for exception handling, in extras/exceptions. extras/exceptions/README: Describes the files in this directory. extras/exceptions/exception.m: Contains the exception handling interface and implementation. extras/exceptions/test_exceptions.m: extras/exceptions/test_exceptions.exp: extras/exceptions/test_uncaught_exception.m: extras/exceptions/test_uncaught_exception.exp: extras/exceptions/test_exceptions_func.m: extras/exceptions/test_exceptions_func.exp: Test cases. extras/exceptions/Mmakefile: The Mmakefile for building and running the test cases.
49 lines
1.3 KiB
Plaintext
49 lines
1.3 KiB
Plaintext
#-----------------------------------------------------------------------------#
|
|
# Copyright (C) 1997-1998 The University of Melbourne.
|
|
# This file may only be copied under the terms of the GNU General
|
|
# Public Licence - see the file COPYING in the Mercury distribution.
|
|
#-----------------------------------------------------------------------------#
|
|
#
|
|
# These rules define the main targets: depend, all, check.
|
|
#
|
|
|
|
MAIN_TARGET = check
|
|
|
|
PROGS = test_exceptions.m test_uncaught_exception.m test_exceptions_func.m
|
|
|
|
depend: $(PROGS:.m=.depend)
|
|
all: $(PROGS:.m=)
|
|
check: $(PROGS:.m=.res)
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
#
|
|
# the following lines are required for exception.m
|
|
# (see the comment at the top of exception.m)
|
|
#
|
|
|
|
RM_C=:
|
|
C2INITFLAGS=--extra-inits
|
|
$(PROGS:.m=_init.c): $(PROGS:.m=.c) exception.c
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
#
|
|
# some rules for running test cases
|
|
#
|
|
|
|
%.out: %
|
|
./$< > $@
|
|
|
|
%.res: %.out %.exp
|
|
diff -c $*.out $*.exp > $@
|
|
|
|
clean:
|
|
rm -f *.out
|
|
realclean:
|
|
rm -f *.res
|
|
|
|
# test_uncaught_exception is *supposed* to return an error exit status
|
|
test_uncaught_exception.out: test_uncaught_exception
|
|
if ./$< > $@ 2>&1; then false; else true; fi
|
|
|
|
#-----------------------------------------------------------------------------#
|