Reinstate tests

This commit is contained in:
Shahram Najm 2018-11-06 17:26:58 +00:00
parent ec0e4ddeb6
commit 5c62f6ce5f
3 changed files with 33 additions and 45 deletions

View File

@ -23,42 +23,36 @@ fLog=${label}".log"
rm -f $fLog rm -f $fLog
tempDir=${label}.dir tempDir=${label}.dir
rm -rf $tempDir
mkdir -p $tempDir mkdir -p $tempDir
bufr_files=`cat ${data_dir}/bufr/bufr_data_files.txt` bufr_files=`cat ${data_dir}/bufr/bufr_data_files.txt`
# pkgconfig should be one level above the test dir # pkgconfig should be one level above the test dir
PKGCONFIG_FILE=../eccodes.pc PKGCONFIG_FILE=../../eccodes.pc
CACHE_FILE=../CMakeCache.txt CACHE_FILE=../../CMakeCache.txt
COMPILE_AND_RUN=0 COMPILE_AND_RUN=0
cd $tempDir
if command -v pkg-config >/dev/null 2>&1; then if command -v pkg-config >/dev/null 2>&1; then
if [ -f "$PKGCONFIG_FILE" ]; then if [ -f "$PKGCONFIG_FILE" ]; then
sed -e "s#^prefix=.*#prefix=$build_dir#" < $PKGCONFIG_FILE > temp.pc
PKGCONFIG_FILE=temp.pc
# Work out the C compiler and flags from pkgconfig # Work out the C compiler and flags from pkgconfig
COMPILER=`pkg-config --variable=CC $PKGCONFIG_FILE` COMPILER=`pkg-config --variable=CC $PKGCONFIG_FILE`
FLAGS_COMPILER=`pkg-config --cflags $PKGCONFIG_FILE` FLAGS_COMPILER=`pkg-config --cflags $PKGCONFIG_FILE`
FLAGS_LINKER=`pkg-config --libs $PKGCONFIG_FILE` FLAGS_LINKER=`pkg-config --libs $PKGCONFIG_FILE`
#CMAKE_C_FLAGS=`grep CMAKE_C_FLAGS:STRING $CACHE_FILE | cut -d'=' -f2-`
#FLAGS_COMPILER="$FLAGS_COMPILER $CMAKE_C_FLAGS"
#FLAGS_COMPILER="$FLAGS_COMPILER -fsanitize=memory"
# The pkgconfig variables refer to the install directory. Change to build dir
#BUILD_DIR=`grep -w eccodes_BINARY_DIR $CACHE_FILE | cut -d'=' -f2`
#INSTALL_DIR=`grep -w CMAKE_INSTALL_PREFIX $CACHE_FILE | cut -d'=' -f2`
#FLAGS_LINKER=`echo $FLAGS_LINKER | sed -e "s:$INSTALL_DIR:$BUILD_DIR:g"`
#FLAGS_COMPILER=`echo $FLAGS_COMPILER | sed -e "s:$INSTALL_DIR:$BUILD_DIR:g"`
# TODO: For now only support when shared libs enabled # TODO: For now only support when shared libs enabled
#SHARED_LIBS=`grep -w BUILD_SHARED_LIBS $CACHE_FILE | cut -d'=' -f2` SHARED_LIBS=`grep -w BUILD_SHARED_LIBS $CACHE_FILE | cut -d'=' -f2`
#if [ "$SHARED_LIBS" = "ON" ]; then if [ "$SHARED_LIBS" = "ON" ]; then
# COMPILE_AND_RUN=1 COMPILE_AND_RUN=1
#fi fi
fi fi
fi fi
cd $tempDir
for file in ${bufr_files} for file in ${bufr_files}
do do
tempSrc=$label.$file.c tempSrc=$label.$file.c

View File

@ -19,39 +19,36 @@ rm -f $fLog
tempBufr=outfile.bufr tempBufr=outfile.bufr
tempDir=${label}.dir tempDir=${label}.dir
rm -rf $tempDir
mkdir -p $tempDir mkdir -p $tempDir
bufr_files=`cat ${data_dir}/bufr/bufr_data_files.txt` bufr_files=`cat ${data_dir}/bufr/bufr_data_files.txt`
# If FORTRAN is enabled, then the pkgconfig should be one level above the test dir # If FORTRAN is enabled, then the pkgconfig should be one level above the test dir
PKGCONFIG_FILE=../eccodes_f90.pc PKGCONFIG_FILE=../../eccodes_f90.pc
CACHE_FILE=../CMakeCache.txt CACHE_FILE=../../CMakeCache.txt
COMPILE_AND_RUN=0 COMPILE_AND_RUN=0
cd $tempDir
if command -v pkg-config >/dev/null 2>&1; then if command -v pkg-config >/dev/null 2>&1; then
if [ -f "$PKGCONFIG_FILE" ]; then if [ -f "$PKGCONFIG_FILE" ]; then
sed -e "s#^prefix=.*#prefix=$build_dir#" < $PKGCONFIG_FILE > temp.pc
PKGCONFIG_FILE=temp.pc
# Work out the Fortran compiler and flags from pkgconfig # Work out the Fortran compiler and flags from pkgconfig
COMPILER=`pkg-config --variable=FC $PKGCONFIG_FILE` COMPILER=`pkg-config --variable=FC $PKGCONFIG_FILE`
FLAGS_COMPILER=`pkg-config --cflags $PKGCONFIG_FILE` FLAGS_COMPILER=`pkg-config --cflags $PKGCONFIG_FILE`
FLAGS_LINKER=`pkg-config --libs $PKGCONFIG_FILE` FLAGS_LINKER=`pkg-config --libs $PKGCONFIG_FILE`
# The pkgconfig variables refer to the install directory. Change to build dir
BUILD_DIR=`grep -w eccodes_BINARY_DIR $CACHE_FILE | cut -d'=' -f2`
INSTALL_DIR=`grep -w CMAKE_INSTALL_PREFIX $CACHE_FILE | cut -d'=' -f2`
FLAGS_LINKER=`echo $FLAGS_LINKER | sed -e "s:$INSTALL_DIR:$BUILD_DIR:g"`
FLAGS_COMPILER=`echo $FLAGS_COMPILER | sed -e "s:$INSTALL_DIR:$BUILD_DIR:g"`
# TODO: For now only support when shared libs enabled # TODO: For now only support when shared libs enabled
#SHARED_LIBS=`grep -w BUILD_SHARED_LIBS $CACHE_FILE | cut -d'=' -f2` SHARED_LIBS=`grep -w BUILD_SHARED_LIBS $CACHE_FILE | cut -d'=' -f2`
#if [ "$SHARED_LIBS" = "ON" ]; then if [ "$SHARED_LIBS" = "ON" ]; then
# COMPILE_AND_RUN=1 COMPILE_AND_RUN=1
#fi fi
fi fi
fi fi
cd $tempDir
for file in ${bufr_files} for file in ${bufr_files}
do do
tempSrc=$label.$file.f90 tempSrc=$label.$file.f90

View File

@ -19,39 +19,36 @@ rm -f $fLog
tempBufr=outfile.bufr tempBufr=outfile.bufr
tempDir=${label}.dir tempDir=${label}.dir
rm -rf $tempDir
mkdir -p $tempDir mkdir -p $tempDir
bufr_files=`cat ${data_dir}/bufr/bufr_data_files.txt` bufr_files=`cat ${data_dir}/bufr/bufr_data_files.txt`
# If FORTRAN is enabled, then the pkgconfig should be one level above the test dir # If FORTRAN is enabled, then the pkgconfig should be one level above the test dir
PKGCONFIG_FILE=../eccodes_f90.pc PKGCONFIG_FILE=../../eccodes_f90.pc
CACHE_FILE=../CMakeCache.txt CACHE_FILE=../../CMakeCache.txt
COMPILE_AND_RUN=0 COMPILE_AND_RUN=0
cd $tempDir
if command -v pkg-config >/dev/null 2>&1; then if command -v pkg-config >/dev/null 2>&1; then
if [ -f "$PKGCONFIG_FILE" ]; then if [ -f "$PKGCONFIG_FILE" ]; then
sed -e "s#^prefix=.*#prefix=$build_dir#" < $PKGCONFIG_FILE > temp.pc
PKGCONFIG_FILE=temp.pc
# Work out the Fortran compiler and flags from pkgconfig # Work out the Fortran compiler and flags from pkgconfig
COMPILER=`pkg-config --variable=FC $PKGCONFIG_FILE` COMPILER=`pkg-config --variable=FC $PKGCONFIG_FILE`
FLAGS_COMPILER=`pkg-config --cflags $PKGCONFIG_FILE` FLAGS_COMPILER=`pkg-config --cflags $PKGCONFIG_FILE`
FLAGS_LINKER=`pkg-config --libs $PKGCONFIG_FILE` FLAGS_LINKER=`pkg-config --libs $PKGCONFIG_FILE`
# The pkgconfig variables refer to the install directory. Change to build dir
BUILD_DIR=`grep -w eccodes_BINARY_DIR $CACHE_FILE | cut -d'=' -f2`
INSTALL_DIR=`grep -w CMAKE_INSTALL_PREFIX $CACHE_FILE | cut -d'=' -f2`
FLAGS_LINKER=`echo $FLAGS_LINKER | sed -e "s:$INSTALL_DIR:$BUILD_DIR:g"`
FLAGS_COMPILER=`echo $FLAGS_COMPILER | sed -e "s:$INSTALL_DIR:$BUILD_DIR:g"`
# TODO: For now only support when shared libs enabled # TODO: For now only support when shared libs enabled
#SHARED_LIBS=`grep -w BUILD_SHARED_LIBS $CACHE_FILE | cut -d'=' -f2` SHARED_LIBS=`grep -w BUILD_SHARED_LIBS $CACHE_FILE | cut -d'=' -f2`
#if [ "$SHARED_LIBS" = "ON" ]; then if [ "$SHARED_LIBS" = "ON" ]; then
# COMPILE_AND_RUN=1 COMPILE_AND_RUN=1
#fi fi
fi fi
fi fi
cd $tempDir
for file in ${bufr_files} for file in ${bufr_files}
do do
tempSrc=$label.$file.f90 tempSrc=$label.$file.f90