Changes between Version 3 and Version 4 of pm-test-make


Ignore:
Timestamp:
Feb 20, 2011 1:21:18 PM (9 years ago)
Author:
stefan
Comment:

update to confirm with BuildTools? 0.7

Legend:

Unmodified
Added
Removed
Modified
  • pm-test-make

    v3 v4  
    1 = Test Directory Makefile.am File =
     1[[TOC(pm-autotools,pm-autotools-intro,pm-structure-config,pm-base-config,pm-project-config,pm-automake-intro,pm-base-make,pm-project-make,pm-source-make,pm-test-make,pm-get-autotools,pm-comments)]]
     2
     3= The Test Directory Makefile.am File =
    24
    35In the {{{test}}} subdirectory, which should provide a unit test, the Makefile has a '''target test''' which compiles and runs the unit test.
     
    68
    79{{{
    8 # Copyright (C) 2006 International Business Machines and others.
     10# Copyright (C) 2011 International Icecream Machines and others.
    911# All Rights Reserved.
    10 # This file is distributed under the Common Public License.
     12# This file is distributed under the Eclipse Public License.
    1113
    12 ## $Id: Makefile.am 506 2006-06-01 20:11:24Z andreasw $
     14## $Id: Makefile.am 788 2011-04-01 11:11:11Z johndoe $
    1315
    14 # Author:  Andreas Waechter           IBM    2006-04-13
     16# Author:  John Doe              IIM    2011-04-01
    1517
    1618AUTOMAKE_OPTIONS = foreign
     
    3234        CoinErrorTest.cpp \
    3335        CoinIndexedVectorTest.cpp \
     36        CoinMessageHandlerTest.cpp \
    3437        CoinModelTest.cpp \
    3538        CoinMpsIOTest.cpp \
     
    3942        unitTest.cpp
    4043
    41 # List libraries of COIN projects
    42 unitTest_LDADD = $(COINUTILSOBJDIR)/src/libCoinUtils.la
     44# List libraries to link into binary
     45unitTest_LDADD = ../src/libCoinUtils.la $(COINUTILSLIB_LIBS)
    4346
    44 # List additional libraries
    45 LIBS += $(ADDLIBS)
     47# Dependencies of binaries are mostly the same as given in LDADD, but with -l and -L removed
     48unitTest_DEPENDENCIES = ../src/libCoinUtils.la $(COINUTILSLIB_DEPENDENCIES)
    4649
    47 # Here list all include flags, relative to this "srcdir" directory.  This
    48 # "cygpath" stuff is necessary to compile with native compilers on Cygwin
    49 AM_CPPFLAGS = \
    50         -I`$(CYGPATH_W) $(COINUTILSSRCDIR)/src`
     50# Here list all include flags, relative to this "srcdir" directory.
     51# This "cygpath" stuff is necessary to compile with native compilers on Cygwin.
     52AM_CPPFLAGS = -I`$(CYGPATH_W) $(srcdir)/../src`
    5153
    52 # This line is necessary to allow VPATH compilation with MS compilers
    53 # on Cygwin
     54# This line is necessary to allow VPATH compilation with MS compilers on Cygwin.
    5455DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/inc
    5556}}}
     
    6061
    6162{{{
     63unittestflags =
     64if COIN_HAS_SAMPLE
     65  unittestflags += -mpsDir=`$(CYGPATH_W) $(SAMPLE_DATA)`
     66endif
     67if COIN_HAS_NETLIB
     68  unittestflags += -netlibDir=`$(CYGPATH_W) $(NETLIB_DATA)` -testModel=adlittle.mps
     69endif
     70
    6271test: unitTest$(EXEEXT)
    63         cd ../../Data/Netlib; $(MAKE) uncompress
    64         ./unitTest$(EXEEXT)
     72        ./unitTest$(EXEEXT) $(unittestflags)
    6573
    6674.PHONY: test
    6775}}}
    6876
    69  * The '''test target''' above depends on the {{{unitTest}}} executable.  Note the addition of the '''EXEEXT''' variable to the executable name; this variable is set to the extension of executables on the specific platform.  For example, on UNIX systems it is an emply string, and on Windows it is automatically set to "{{{.exe}}}".
     77 * The '''test target''' above depends on the {{{unitTest}}} executable.  Note the addition of the '''EXEEXT''' variable to the executable name; this variable is set to the extension of executables on the specific platform.  For example, on UNIX systems it is an empty string, and on Windows it is automatically set to "{{{.exe}}}".
    7078
    71  For this particular test, the executable will use files in the {{{Data/Netlib}}} directory.  If the !CoinUtils library has not been compiled with zlib support, the MPS files in that directory first have to be uncompressed.  This is done by the Makefile in the {{{Data/Netlib}}} directory (unless the files have already been compressed, or the zlib library is used).
    72 
    73  Finally, the unit test executable is run.
     79 For this particular test, the executable will use files of the {{{Data/Sample}}} and {{{Data/Netlib}}} projects, if available. The paths under which the data of these projects can be found has been setup by the [wiki:pm-project-config configure script in the project directory] and stored in the {{{SAMPLE_DATA}}} and {{{NETLIB_DATA}}} variables.
    7480
    7581== House Cleaning ==
     
    8692}}}
    8793
    88  * The unit test program might generate output files.  It is a nice guesture to the user to make sure that everything is cleaned up, when (s)he does a {{{make distclean}}}.  For this reason, you should list all possibly generated output files in the '''DISTCLEANFILES''' Automake variable.
     94 * The unit test program might generate output files.  It is a nice gesture to the user to make sure that everything is cleaned up, when (s)he does a {{{make distclean}}}.  For this reason, you should list all possibly generated output files in the '''DISTCLEANFILES''' Automake variable.