e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf# CDDL HEADER START
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf# The contents of this file are subject to the terms of the
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf# Common Development and Distribution License (the "License").
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf# You may not use this file except in compliance with the License.
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf# See the License for the specific language governing permissions
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf# and limitations under the License.
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf# When distributing Covered Code, include this CDDL HEADER in each
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf# If applicable, add the following below this CDDL HEADER, with the
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf# fields enclosed by brackets "[]" replaced with your own identifying
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf# information: Portions Copyright [yyyy] [name of copyright owner]
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf# CDDL HEADER END
b695575577bae0337af339d76949713bfe1c9013Robert Johnston# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
e1c679fa4b0ab8c4bcaa6263974ca0c46e5b027faf# Use is subject to license terms.
b695575577bae0337af339d76949713bfe1c9013Robert JohnstonCLOBBERFILES += fmd_msg_test fmd_msg_test.core fmd_msg_test.out
b695575577bae0337af339d76949713bfe1c9013Robert JohnstonLDLIBS_$(MACH) = -L$(ROOT)/usr/lib/fm -R$(ROOT)/usr/lib/fm
b695575577bae0337af339d76949713bfe1c9013Robert JohnstonLDLIBS_$(MACH64) = -L$(ROOT)/usr/lib/fm/$(MACH64) -R$(ROOT)/usr/lib/fm/$(MACH64)
b695575577bae0337af339d76949713bfe1c9013Robert Johnston# To ease the development and maintenance of libfmd_msg, a test suite is built
b695575577bae0337af339d76949713bfe1c9013Robert Johnston# directly into the library. The test program fmd_msg_test.c includes a set of
b695575577bae0337af339d76949713bfe1c9013Robert Johnston# tests for all the code paths in the library. The test program executes the
b695575577bae0337af339d76949713bfe1c9013Robert Johnston# calls, and then forks into the background and dumps core. After the test
b695575577bae0337af339d76949713bfe1c9013Robert Johnston# runs, we diff the output against the master hand-verified output, and confirm
b695575577bae0337af339d76949713bfe1c9013Robert Johnston# no leaks or corruption exist. To run the entire suite, type "make test" and
b695575577bae0337af339d76949713bfe1c9013Robert Johnston# inspect the results (the make target will fail on an error).
b695575577bae0337af339d76949713bfe1c9013Robert Johnston# The cmp skips the first 900 bytes of $(SRCDIR)/fmd_msg_test.out to get us
b695575577bae0337af339d76949713bfe1c9013Robert Johnston# passed the CDDL header and copyright in that file.
b695575577bae0337af339d76949713bfe1c9013Robert Johnston @echo; echo "Running `pwd | sed 's/.*\///'` fmd_msg test suite ... \c"
b695575577bae0337af339d76949713bfe1c9013Robert Johnston @UMEM_DEBUG=default,verbose UMEM_LOGGING=fail,contents LANG=C \
b695575577bae0337af339d76949713bfe1c9013Robert Johnston LC_ALL=C ./fmd_msg_test | grep -v EVENT-TIME > fmd_msg_test.out
b695575577bae0337af339d76949713bfe1c9013Robert Johnston @chmod 0444 core; mv -f core fmd_msg_test.core
b695575577bae0337af339d76949713bfe1c9013Robert Johnston @echo; echo "Checking test output ... \c"
b695575577bae0337af339d76949713bfe1c9013Robert Johnston @cmp -s $(SRCDIR)/fmd_msg_test.out fmd_msg_test.out 900 0 && echo pass \
b695575577bae0337af339d76949713bfe1c9013Robert Johnston || ( echo FAIL && diff $(SRCDIR)/fmd_msg_test.out fmd_msg_test.out )
b695575577bae0337af339d76949713bfe1c9013Robert Johnston @echo ::umem_verify | mdb fmd_msg_test.core | grep -v clean
b695575577bae0337af339d76949713bfe1c9013Robert Johnston $(LINK.c) -o fmd_msg_test $(SRCDIR)/fmd_msg_test.c \