1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
|
###########################################################################
#
# MAKEFILE for the NEC++ testharness
#
# Author: Tim Molteno.
#
#
# Copyright (C) 2004-2005 Timothy C.A. Molteno
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
all: check_build test python
BUILD=debug
TARGET = ${BUILD}/src/nec2++
NEC2DIFF = ${BUILD}/src/nec2diff
NEC2C = c_src/nec2c
NECF = FORTRAN/nec2
#
# This target makes sure that the C and FORTRAN executables have been built
# Please note that the testharness assumes that you have built the debug
# version of nec2++ using kdevelop.
#
check_build: ${NEC2C} ${NECF} ${TARGET}
test_fast:
make -f Makefile.test test 'BUILD=optimized'
############################################################################
#
# TESTHARNESS
#
# This tests the output of the C++ port against the nec2c, C
# port as well as the original FORTRAN
#
NEC_TESTS := $(shell find test_data/ -name "example*.nec")
SOM_TESTS := $(shell find test_data/ -name "sommer*.nec")
ALL_TESTS := $(shell find test_data/ -name "*.nec")
DO_TESTS = ${NEC_TESTS} ${SOM_TESTS}
############################################################################
#
# Rewrite Rules are used to automate the generation
# and comparison of output files.
# Generate an output file from nec2c
%.nec %.outc:
- ./${NEC2C} -i $*.nec -o temp.$(*F); mv temp.$(*F) $@
# Generate an output file from nec2cpp
%.nec %.outcpp:
- ./$(TARGET) -i $*.nec -o $@
# Generate an output file from the FORTRAN version
%.nec %.outf:
- ./$(NECF) $*.nec $@
# Compare two outputs (c and cpp)
%.nec %.diff: %.outc %.outcpp
./${NEC2DIFF} $*.outc $*.outcpp > $@
./${NEC2DIFF} $*.outf $*.outcpp >> $@
# Compare two outputs (FORTRAN and cpp)
%.nec %.dif: %.out %.outcpp
./${NEC2DIFF} $*.out $*.outcpp > $@
test:
echo "testing ${DO_TESTS}"
rm -f $(DO_TESTS:.nec=.diff)
rm -f $(DO_TESTS:.nec=.outcpp)
rm -f $(DO_TESTS:.nec=.outc)
rm -f $(DO_TESTS:.nec=.outf)
make -f Makefile.test test_aux
# Change the following line to
# test_aux: ${NEC2DIFF} nec2cpp $(NEC_TESTS:.nec=.outcpp) $(NEC_TESTS:.nec=.outc) $(NEC_TESTS:.nec=.diff) $(NEC_TESTS:.nec=.dif)
# in order to include the FORTRAN code in the test suite.
test_aux: $(DO_TESTS:.nec=.outcpp) $(DO_TESTS:.nec=.outc) $(DO_TESTS:.nec=.outf) $(DO_TESTS:.nec=.diff)
echo "Test Complete"
############################################################################
#
# PYTHON TESTHARNESS
#
# This tests the python bindings
#
python:
echo "Put something in here to test the python code"
|