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