diff --git a/.gitignore b/.gitignore index 370a5446623f18c408be77d6dadd67909e1cc999..3a8146ae84db2d4f2ec5be44853f1d861b5ce5c4 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ m4/lt~obsolete.m4 /install-sh /missing /stamp-h1 +/test-driver # Object files .deps/ @@ -48,6 +49,9 @@ m4/lt~obsolete.m4 *.obj *.elf +# Test results +*.trs + # Precompiled Headers *.gch *.pch diff --git a/Makefile.am b/Makefile.am index caeca1d7fffc927f224703d90c75273137b3afc8..946534d512007f514eb0c67c2489f22b5bb362c7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,7 @@ # This file is part of SWIFT. # Coypright (c) 2012 pedro.gonnet@durham.ac.uk. +# 2015 matthieu.schaller@durham.ac.uk. # # 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 @@ -19,7 +20,7 @@ ACLOCAL_AMFLAGS = -I m4 # Show the way... -SUBDIRS = src examples doc +SUBDIRS = src examples doc tests # Non-standard files that should be part of the distribution. EXTRA_DIST = INSTALL.swift diff --git a/configure.ac b/configure.ac index f8113dce23be88a3c373aca1b2d99ea2dd474273..1a6cd114895b0f0571f18778fb54707e4fd37de6 100644 --- a/configure.ac +++ b/configure.ac @@ -313,7 +313,7 @@ DX_INIT_DOXYGEN(libswift,doc/Doxyfile,doc/) AM_CONDITIONAL([HAVE_DOXYGEN], [test "$ac_cv_path_ac_pt_DX_DOXYGEN" != ""]) # Handle .in files. -AC_CONFIG_FILES([Makefile src/Makefile examples/Makefile doc/Makefile doc/Doxyfile]) +AC_CONFIG_FILES([Makefile src/Makefile examples/Makefile doc/Makefile doc/Doxyfile tests/Makefile]) # Report general configuration. AC_MSG_RESULT([ diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..0c968d4fabc7528c19283bb22e43c36d8ef343a6 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,30 @@ +# This file is part of SWIFT. +# Coypright (c) 2015 matthieu.schaller@durham.ac.uk. +# +# 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 3 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, see <http://www.gnu.org/licenses/>. + +# Add the source directory and debug to CFLAGS +AM_CFLAGS = -I../src -DCPU_TPS=2.67e9 $(HDF5_CPPFLAGS) + +AM_LDFLAGS = ../src/.libs/libswiftsim.a $(HDF5_LDFLAGS) $(HDF5_LIBS) + +# List of test programs to compile +TESTS = testGreetings + +# List of programs and scripts to run in the test suite +check_PROGRAMS = testGreetings + + +# Sources for the individual programs +testGreetings_SOURCES = testGreetings.c diff --git a/tests/testGreetings.c b/tests/testGreetings.c new file mode 100644 index 0000000000000000000000000000000000000000..2f17bddf5731692d515675d2a21f6c3b4a725ebf --- /dev/null +++ b/tests/testGreetings.c @@ -0,0 +1,27 @@ +/******************************************************************************* + * This file is part of SWIFT. + * Copyright (C) 2015 Matthieu Schaller (matthieu.schaller@durham.ac.uk). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation, either version 3 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 Lesser General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + ******************************************************************************/ + +#include "swift.h" + +int main() { + + greetings(); + + return 0; +}