A.6 Unit Test m4 Macros

The main documentation of the Unit Test m4 Macros contains additional explanation of this code listing.

dnl
dnl Author: Michael L. Hall
dnl         P.O. Box 1663, MS-D413, LANL
dnl         Los Alamos, NM 87545
dnl         ph: 505-665-4312
dnl         email: Hall@LANL.gov
dnl 
dnl Created on: 12/07/98
dnl CVS Info:   $Id: unit_test.m4,v 1.12 2004/02/26 18:59:43 hall Exp $


dnl Define a macro that toggles output.

ifdef([UNIT_TEST],
      [define([TESTWRITE], [write])],
      [define([TESTWRITE], [! write])])


dnl Define a macro that comments out code if 
dnl unit testing is not being done.

ifdef([UNIT_TEST],
      [define([IF_UNIT_TEST], [])],
      [define([IF_UNIT_TEST], [! ])])


dnl Define a macro that comments out code if 
dnl unit testing is being done.

ifdef([UNIT_TEST],
      [define([IF_NOT_UNIT_TEST], [! ])],
      [define([IF_NOT_UNIT_TEST], [])])



Michael L. Hall