1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-12-22 20:36:01 +01:00

Added tests

This commit is contained in:
Anthony Scemama 2021-05-11 12:56:41 +02:00
parent 90474fee2d
commit a4e49f4939
3 changed files with 26 additions and 14 deletions

View File

@ -50,6 +50,11 @@ qmckl_f = $(srcdir)/share/qmckl/fortran/qmckl_f.f90
fortrandir = $(datadir)/$(PACKAGE_NAME)/fortran/
fortran_DATA = $(qmckl_f)
lib_LTLIBRARIES = src/libqmckl.la
src_libqmckl_la_CPPFLAGS = -I$(srcdir)/src -I$(srcdir)/include
src_libqmckl_la_SOURCES = $(qmckl_h) $(qmckl_f) $(C_FILES) $(F_FILES) $(H_PRIVATE_FUNC_FILES) $(H_PRIVATE_TYPE_FILES)
export srcdir qmckl_f qmckl_h
@ -58,7 +63,7 @@ if QMCKL_DEVEL
dist_src_DATA = $(ORG_FILES)
BUILT_SOURCES = $(C_FILES) $(F_FILES) $(FH_FUNC_FILES) $(FH_TYPE_FILES) $(H_FUNC_FILES) $(H_TYPE_FILES) $(H_PRIVATE_FUNC_FILES) $(H_PRIVATE_TYPE_FILES)
CLEANFILES += $(BUILT_SOURCES) $(C_TEST_FILES) $(F_TEST_FILES) $(TANGLED_FILES)
CLEANFILES += $(BUILT_SOURCES) $(C_TEST_FILES) $(F_TEST_FILES) $(TANGLED_FILES) $(C_TEST_FILES) $(F_TEST_FILES)
# ----->
endif

View File

@ -38,7 +38,7 @@ AC_PREREQ([2.69])
AC_INIT([QMCkl],[0.1.1],
[https://github.com/TREX-CoE/qmckl/issues], [],
[https://trex-coe.github.io/qmckl/index.html])
AM_INIT_AUTOMAKE([color-tests parallel-tests silent-rules 1.11])
AM_INIT_AUTOMAKE([subdir-objects color-tests parallel-tests silent-rules 1.11])
AM_MAINTAINER_MODE()
LT_INIT
AC_CONFIG_SRCDIR([Makefile.in])

View File

@ -15,7 +15,7 @@ function make_src()
cd ${srcdir}
declare -A DEPS DEPS_ORG
declare -A DEPS DEPS_ORG DEPS_TEST
C_FILES=
F_FILES=
@ -30,15 +30,15 @@ function make_src()
TANGLED_FILES=
for org in org/*.org ; do
tangled="\$(srcdir)/${org%.org}.tangled"
i=${org%.org}
i=$(basename ${org%.org})
tangled="\$(srcdir)/org/${i}.tangled"
c_test_o="\$(srcdir)/src/test_${i}.o"
f_test_o="\$(srcdir)/src/test_${i}_f.o"
c_test="\$(srcdir)/src/test_${i}.c"
f_test="\$(srcdir)/src/test_${i}_f.f90"
i="\$(srcdir)/src/${i#org/}"
i="\$(srcdir)/src/${i}"
c="${i}.c"
o="${i}.o"
h_func="${i}_func.h"
@ -113,16 +113,16 @@ function make_src()
grep -q "(eval c_test)" $org
if [[ $? -eq 0 ]] ; then
DEPS["$c_test"]="${tangled} "
DEPS["$c_test_o"]+=" $c_test $o"
C_TEST_FILES+=" $c_test"
DEPS_TEST["${c_test}"]="${tangled} "
DEPS_TEST["${c_test_o}"]+=" ${c_test} $o"
C_TEST_FILES+=" ${c_test}"
fi
grep -q "(eval f_test)" $org
if [[ $? -eq 0 ]] ; then
DEPS["$f_test"]+="${tangled} "
DEPS["$f_test_o"]+=" $f_test $fo"
F_TEST_FILES+=" $f_test"
DEPS_TEST["${f_test}"]+="${tangled} "
DEPS_TEST["${f_test_o}"]+=" ${f_test} $fo"
F_TEST_FILES+=" ${f_test}"
fi
done
@ -187,7 +187,14 @@ function make_src()
echo "## Source dependencies" >> ${OUTPUT}
echo >> ${OUTPUT}
for f in ${!DEPS[@]} ; do
echo ${f}: ${DEPS[$f]}
echo "${f}: ${DEPS[$f]}"
done | sort >> ${OUTPUT}
echo >> ${OUTPUT}
echo "## Test files" >> ${OUTPUT}
echo >> ${OUTPUT}
for f in ${!DEPS_TEST[@]} ; do
echo "${f}: ${DEPS_TEST[$f]} \$(qmckl_h) \$(srcdir)/src/libqmckl.la"
done | sort >> ${OUTPUT}
}