Skip to content

Commit

Permalink
Regression test tweaks
Browse files Browse the repository at this point in the history
-don't compile LAPACK tests if LAPACK is missing
-symlink from PWD to TooN in case TooN is checked out with a funny name
-respect CXXFLAGS etc
  • Loading branch information
Edward Rosten committed Oct 15, 2012
1 parent 6726662 commit a4d8b14
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
28 changes: 23 additions & 5 deletions Makefile.in
Expand Up @@ -10,11 +10,15 @@ ifneq "$(DESTDIR)" ""
DESTDIR+=/
endif

CXX=@CXX@
CXXFLAGS=@CXXFLAGS@
LDFALGS=@LDFALGS@
LIBS=@LIBS@

hdr = $(DESTDIR)$(includedir)/TooN


.PHONY: all
.PHONY: all clean testclean

all:
@echo There is nothing to be compiled in TooN.
Expand All @@ -37,15 +41,23 @@ internal/make_vector.hh: make_make_vector.awk
internal/builtin_typeof.h:make_typeof.awk
awk -f make_typeof.awk > $@

clean:
clean: testclean
rm -rf html

docs:
doxygen


TESTS=lu slice vector_resize gauss_jordan eigen-sqrt determinant chol_toon chol_lapack simplex sym_eigen fill so3 complex qr gr_svd diagonal_matrix gaussian_elimination zeros
LAPACK_TESTS=eigen-sqrt chol_lapack sym_eigen qr lu determinant
BUILTIN_TESTS=slice vector_resize gauss_jordan chol_toon fill so3 complex gr_svd diagonal_matrix gaussian_elimination zeros

ifeq (@use_lapack@,yes)
TESTS=$(BUILTIN_TESTS) $(LAPACK_TESTS)
MISSING_TESTS=
else
TESTS=$(BUILTIN_TESTS)
MISSING_TESTS=$(LAPACK_TESTS)
endif

TEST_RESULT=$(TESTS:%=regressions/%.result)
TEST_FILES=$(TESTS:%=regressions/%.testout) $(TESTS:%=regressions/%.test) $(TEST_RESULT)
Expand All @@ -61,16 +73,22 @@ foo:
test:regressions/results
@echo -------------- Test Results ---------------
@cat regressions/results
@echo $(MISSING_TESTS) | awk '{for(i=1; i <= NF; i++) print $$i, "Missing."}'

regressions/results:$(TEST_RESULT)
cat $(TEST_RESULT) > regressions/results

.PRECIOUS: regressions/%.testout regressions/%.test

TooN:
ln -s "$$PWD" TooN

.INTERMEDIATE: TooN

#Build a test executable from a test program. On compile error,
#create an execuaable which decalres the error.
regressions/%.test: regressions/%.cc
$(CXX) -g -ggdb $< -o $@ -llapack -DTOON_CHECK_BOUNDS -DTOON_INITIALIZE_SNAN -I .. -I . @CXXFLAGS@||\
regressions/%.test: regressions/%.cc TooN
$(CXX) $(CXXFLAGS) $< -o $@ -DTOON_CHECK_BOUNDS -DTOON_INITIALIZE_SNAN -I .. -I . $(LDFLAGS) ||\
{ \
echo "echo 'Compile error!'" > $@ ; \
chmod +x $@; \
Expand Down
3 changes: 3 additions & 0 deletions configure
Expand Up @@ -565,6 +565,7 @@ PACKAGE_URL=''

ac_subst_vars='LTLIBOBJS
LIBOBJS
use_lapack
VERSION
PKGCONFIG_LIBDIR
SED
Expand Down Expand Up @@ -2502,6 +2503,8 @@ if test "$lapack" != "no"
then
$as_echo "#define TOON_USE_LAPACK 1" >>confdefs.h
use_lapack=yes
fi
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Expand Up @@ -111,6 +111,7 @@ fi
if test "$lapack" != "no"
then
AC_DEFINE(TOON_USE_LAPACK, 1)
AC_SUBST(use_lapack, yes)
fi


Expand Down

0 comments on commit a4d8b14

Please sign in to comment.