tests: migrate legacy tests/fcdemo tests to Autotest.
Along with the demise of the last demo directory, so all the
cruft for re-autotooling and distributing the additional
directories is no longer necessary.
* tests/fcdemo.at: New autotest groups, based on...
* tests/fcdemo-conf.test, tests/fcdemo-exec.test,
tests/fcdemo-make.test, tests/fcdemo-shared-exec.test,
tests/fcdemo-shared-make.test, tests/fcdemo-shared.test,
tests/fcdemo-static-exec.test, tests/fcdemo-static-make.test,
tests/fcdemo-static.test: ...these legacy tests, now removed.
* tests/fcdemo/Makefile.am, tests/fcdemo/README,
tests/fcdemo/configure.ac, tests/fcdemo/cprogram.c,
tests/fcdemo/foo.h, tests/fcdemo/fooc.c, tests/fcdemo/foof.f90,
tests/fcdemo/foof2.f90, tests/fcdemo/foof3.f90,
tests/fcdemo/fprogram.f90: Remove.
* configure.ac (CONF_SUBDIRS, DIST_MAKEFILE_LIST): Remove.
* Makefile.am (DIST_SUBDIRS, FC_TESTS, clean-local-legacy)
(configure-subdirs, distclean-recursive, distdir)
(fake-distclean-legacy, $(DIST_MAKEFILE_LIST)): Remove.
(COMMON_TESTS): Rename from this...
(TESTS): ...to this.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 19:26:17 +08:00
|
|
|
# fcdemo.at -- Fortran 90/95 language support. -*- Autotest -*-
|
|
|
|
#
|
2017-04-21 21:18:48 +08:00
|
|
|
# Copyright (C) 2003, 2005-2006, 2011-2017 Free Software Foundation,
|
2012-10-04 21:19:33 +08:00
|
|
|
# Inc.
|
tests: migrate legacy tests/fcdemo tests to Autotest.
Along with the demise of the last demo directory, so all the
cruft for re-autotooling and distributing the additional
directories is no longer necessary.
* tests/fcdemo.at: New autotest groups, based on...
* tests/fcdemo-conf.test, tests/fcdemo-exec.test,
tests/fcdemo-make.test, tests/fcdemo-shared-exec.test,
tests/fcdemo-shared-make.test, tests/fcdemo-shared.test,
tests/fcdemo-static-exec.test, tests/fcdemo-static-make.test,
tests/fcdemo-static.test: ...these legacy tests, now removed.
* tests/fcdemo/Makefile.am, tests/fcdemo/README,
tests/fcdemo/configure.ac, tests/fcdemo/cprogram.c,
tests/fcdemo/foo.h, tests/fcdemo/fooc.c, tests/fcdemo/foof.f90,
tests/fcdemo/foof2.f90, tests/fcdemo/foof3.f90,
tests/fcdemo/fprogram.f90: Remove.
* configure.ac (CONF_SUBDIRS, DIST_MAKEFILE_LIST): Remove.
* Makefile.am (DIST_SUBDIRS, FC_TESTS, clean-local-legacy)
(configure-subdirs, distclean-recursive, distdir)
(fake-distclean-legacy, $(DIST_MAKEFILE_LIST)): Remove.
(COMMON_TESTS): Rename from this...
(TESTS): ...to this.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 19:26:17 +08:00
|
|
|
# Written by Eric Lindahl, 2002
|
|
|
|
# Written by Gary V. Vaughan, 2003
|
|
|
|
#
|
|
|
|
# This file is part of GNU Libtool.
|
|
|
|
#
|
|
|
|
# GNU Libtool 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.
|
|
|
|
#
|
|
|
|
# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
|
|
|
|
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
|
|
|
|
# or obtained by writing to the Free Software Foundation, Inc.,
|
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
####
|
|
|
|
|
|
|
|
|
|
|
|
AT_BANNER([Fortran language support.])
|
|
|
|
|
|
|
|
|
|
|
|
# _LT_SETUP
|
|
|
|
# ---------
|
|
|
|
m4_define([_LT_SETUP],
|
|
|
|
[LT_AT_TAG([FC])
|
|
|
|
AT_KEYWORDS([libtool])
|
|
|
|
|
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_INIT([fcdemo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
|
|
|
|
AC_CONFIG_AUX_DIR([build-aux])
|
|
|
|
AM_INIT_AUTOMAKE
|
|
|
|
AC_PROG_CC
|
|
|
|
|
|
|
|
AC_LANG_PUSH([Fortran])
|
|
|
|
AC_PROG_FC
|
|
|
|
dnl Check the flags needed to link fc programs with ld (i.e. cc)
|
|
|
|
AC_FC_LIBRARY_LDFLAGS
|
|
|
|
dnl Check for underscoring of external names
|
|
|
|
AC_FC_WRAPPERS
|
|
|
|
dnl We need to use .f90 and not .f to enable Automake FC support
|
|
|
|
dnl Some Intel ifc/ifort do not understand .f95. :-/
|
|
|
|
AC_FC_SRCEXT([f90])
|
|
|
|
dnl Yes, we want free-form Fortran!
|
|
|
|
AC_FC_FREEFORM
|
|
|
|
AC_LANG_POP
|
|
|
|
|
|
|
|
LT_INIT
|
|
|
|
AC_SUBST([LIBTOOL_DEPS])
|
|
|
|
AC_CONFIG_FILES([Makefile])
|
|
|
|
AC_CONFIG_HEADERS([config.h:config.in.h])
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([Makefile.am],
|
|
|
|
[[AUTOMAKE_OPTIONS = no-dependencies foreign
|
|
|
|
ACLOCAL_AMFLAGS = -I m4
|
|
|
|
|
|
|
|
lib_LTLIBRARIES = libfoo.la libmix.la libfoo2.la libfoo3.la
|
|
|
|
|
|
|
|
libfoo_la_SOURCES = foof.f90
|
|
|
|
libfoo_la_LIBADD = libfoo2.la
|
2014-02-12 17:03:56 +08:00
|
|
|
libfoo_la_LDFLAGS = -no-undefined
|
tests: migrate legacy tests/fcdemo tests to Autotest.
Along with the demise of the last demo directory, so all the
cruft for re-autotooling and distributing the additional
directories is no longer necessary.
* tests/fcdemo.at: New autotest groups, based on...
* tests/fcdemo-conf.test, tests/fcdemo-exec.test,
tests/fcdemo-make.test, tests/fcdemo-shared-exec.test,
tests/fcdemo-shared-make.test, tests/fcdemo-shared.test,
tests/fcdemo-static-exec.test, tests/fcdemo-static-make.test,
tests/fcdemo-static.test: ...these legacy tests, now removed.
* tests/fcdemo/Makefile.am, tests/fcdemo/README,
tests/fcdemo/configure.ac, tests/fcdemo/cprogram.c,
tests/fcdemo/foo.h, tests/fcdemo/fooc.c, tests/fcdemo/foof.f90,
tests/fcdemo/foof2.f90, tests/fcdemo/foof3.f90,
tests/fcdemo/fprogram.f90: Remove.
* configure.ac (CONF_SUBDIRS, DIST_MAKEFILE_LIST): Remove.
* Makefile.am (DIST_SUBDIRS, FC_TESTS, clean-local-legacy)
(configure-subdirs, distclean-recursive, distdir)
(fake-distclean-legacy, $(DIST_MAKEFILE_LIST)): Remove.
(COMMON_TESTS): Rename from this...
(TESTS): ...to this.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 19:26:17 +08:00
|
|
|
|
|
|
|
libfoo2_la_SOURCES = foof2.f90
|
2014-02-12 17:03:56 +08:00
|
|
|
libfoo2_la_LDFLAGS = -no-undefined
|
tests: migrate legacy tests/fcdemo tests to Autotest.
Along with the demise of the last demo directory, so all the
cruft for re-autotooling and distributing the additional
directories is no longer necessary.
* tests/fcdemo.at: New autotest groups, based on...
* tests/fcdemo-conf.test, tests/fcdemo-exec.test,
tests/fcdemo-make.test, tests/fcdemo-shared-exec.test,
tests/fcdemo-shared-make.test, tests/fcdemo-shared.test,
tests/fcdemo-static-exec.test, tests/fcdemo-static-make.test,
tests/fcdemo-static.test: ...these legacy tests, now removed.
* tests/fcdemo/Makefile.am, tests/fcdemo/README,
tests/fcdemo/configure.ac, tests/fcdemo/cprogram.c,
tests/fcdemo/foo.h, tests/fcdemo/fooc.c, tests/fcdemo/foof.f90,
tests/fcdemo/foof2.f90, tests/fcdemo/foof3.f90,
tests/fcdemo/fprogram.f90: Remove.
* configure.ac (CONF_SUBDIRS, DIST_MAKEFILE_LIST): Remove.
* Makefile.am (DIST_SUBDIRS, FC_TESTS, clean-local-legacy)
(configure-subdirs, distclean-recursive, distdir)
(fake-distclean-legacy, $(DIST_MAKEFILE_LIST)): Remove.
(COMMON_TESTS): Rename from this...
(TESTS): ...to this.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 19:26:17 +08:00
|
|
|
|
|
|
|
libfoo3_la_SOURCES = foof3.f90
|
2014-02-12 17:03:56 +08:00
|
|
|
libfoo3_la_LDFLAGS = -no-undefined
|
tests: migrate legacy tests/fcdemo tests to Autotest.
Along with the demise of the last demo directory, so all the
cruft for re-autotooling and distributing the additional
directories is no longer necessary.
* tests/fcdemo.at: New autotest groups, based on...
* tests/fcdemo-conf.test, tests/fcdemo-exec.test,
tests/fcdemo-make.test, tests/fcdemo-shared-exec.test,
tests/fcdemo-shared-make.test, tests/fcdemo-shared.test,
tests/fcdemo-static-exec.test, tests/fcdemo-static-make.test,
tests/fcdemo-static.test: ...these legacy tests, now removed.
* tests/fcdemo/Makefile.am, tests/fcdemo/README,
tests/fcdemo/configure.ac, tests/fcdemo/cprogram.c,
tests/fcdemo/foo.h, tests/fcdemo/fooc.c, tests/fcdemo/foof.f90,
tests/fcdemo/foof2.f90, tests/fcdemo/foof3.f90,
tests/fcdemo/fprogram.f90: Remove.
* configure.ac (CONF_SUBDIRS, DIST_MAKEFILE_LIST): Remove.
* Makefile.am (DIST_SUBDIRS, FC_TESTS, clean-local-legacy)
(configure-subdirs, distclean-recursive, distdir)
(fake-distclean-legacy, $(DIST_MAKEFILE_LIST)): Remove.
(COMMON_TESTS): Rename from this...
(TESTS): ...to this.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 19:26:17 +08:00
|
|
|
|
|
|
|
libmix_la_SOURCES = foof.f90 foof2.f90 fooc.c
|
2014-02-12 17:03:56 +08:00
|
|
|
libmix_la_LDFLAGS = -no-undefined
|
tests: migrate legacy tests/fcdemo tests to Autotest.
Along with the demise of the last demo directory, so all the
cruft for re-autotooling and distributing the additional
directories is no longer necessary.
* tests/fcdemo.at: New autotest groups, based on...
* tests/fcdemo-conf.test, tests/fcdemo-exec.test,
tests/fcdemo-make.test, tests/fcdemo-shared-exec.test,
tests/fcdemo-shared-make.test, tests/fcdemo-shared.test,
tests/fcdemo-static-exec.test, tests/fcdemo-static-make.test,
tests/fcdemo-static.test: ...these legacy tests, now removed.
* tests/fcdemo/Makefile.am, tests/fcdemo/README,
tests/fcdemo/configure.ac, tests/fcdemo/cprogram.c,
tests/fcdemo/foo.h, tests/fcdemo/fooc.c, tests/fcdemo/foof.f90,
tests/fcdemo/foof2.f90, tests/fcdemo/foof3.f90,
tests/fcdemo/fprogram.f90: Remove.
* configure.ac (CONF_SUBDIRS, DIST_MAKEFILE_LIST): Remove.
* Makefile.am (DIST_SUBDIRS, FC_TESTS, clean-local-legacy)
(configure-subdirs, distclean-recursive, distdir)
(fake-distclean-legacy, $(DIST_MAKEFILE_LIST)): Remove.
(COMMON_TESTS): Rename from this...
(TESTS): ...to this.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 19:26:17 +08:00
|
|
|
|
|
|
|
noinst_HEADERS = foo.h
|
|
|
|
|
|
|
|
bin_PROGRAMS = fprogram cprogram
|
|
|
|
|
|
|
|
fprogram_SOURCES = fprogram.f90
|
|
|
|
fprogram_LDADD = libfoo.la libfoo3.la
|
|
|
|
|
|
|
|
cprogram_SOURCES = cprogram.c
|
|
|
|
cprogram_LDADD = libmix.la $(FCLIBS)
|
|
|
|
|
|
|
|
libtool: $(LIBTOOL_DEPS)
|
|
|
|
$(SHELL) ./config.status --recheck
|
|
|
|
|
|
|
|
# Work around Automake bug, where FCFLAGS_f90 is not provided:
|
|
|
|
.f90.o:
|
|
|
|
$(FCCOMPILE) -c -o @S|@@ $(FCFLAGS_f90) $<
|
|
|
|
|
|
|
|
.f90.obj:
|
|
|
|
$(FCCOMPILE) -c -o @S|@@ $(FCFLAGS_f90) `$(CYGPATH_W) '$<'`
|
|
|
|
|
|
|
|
.f90.lo:
|
|
|
|
$(LTFCCOMPILE) -c -o @S|@@ $(FCFLAGS_f90) $<
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([fprogram.f90],
|
|
|
|
[[program fprogram
|
|
|
|
implicit none
|
|
|
|
integer arg,res
|
|
|
|
|
|
|
|
write(*,*) 'Welcome to GNU libtool Fortran demo!'
|
|
|
|
write(*,*) 'Real programmers write in FORTRAN.'
|
|
|
|
arg=2
|
|
|
|
|
|
|
|
call fsub(arg,res)
|
|
|
|
|
|
|
|
write(*,*) 'fsub returned, saying that 2 *',arg,' =',res
|
|
|
|
|
|
|
|
if (res.eq.4) then
|
|
|
|
write(*,*) 'fsub is ok!'
|
|
|
|
endif
|
|
|
|
|
|
|
|
call fsub3(arg,res)
|
|
|
|
|
|
|
|
write(*,*) 'fsub3 returned, saying that 4 *',arg,' =',res
|
|
|
|
|
|
|
|
if (res.eq.8) then
|
|
|
|
write(*,*) 'fsub3 is ok!'
|
|
|
|
endif
|
|
|
|
|
|
|
|
stop
|
|
|
|
end
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([cprogram.c],
|
|
|
|
[[#include <config.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "foo.h"
|
|
|
|
|
|
|
|
int
|
|
|
|
main ()
|
|
|
|
{
|
|
|
|
int arg,cres,fres;
|
|
|
|
|
|
|
|
printf ("Welcome to GNU libtool mixed C/Fortran demo!\n");
|
|
|
|
|
|
|
|
arg=2;
|
|
|
|
|
|
|
|
cres=csub (arg);
|
|
|
|
|
|
|
|
printf ("The C subroutine returned, claiming that 2*%d = %d\n",arg,cres);
|
|
|
|
|
|
|
|
if (cres == 2*arg)
|
|
|
|
printf ("The C subroutine is ok!\n");
|
|
|
|
|
|
|
|
printf ("\nCalling the C wrapper routine...\n");
|
|
|
|
fres = fwrapper (arg);
|
|
|
|
|
|
|
|
printf ("The C wrapper to the fortran subroutine returned,\n"
|
|
|
|
"claiming that 2*%d = %d\n",arg,fres);
|
|
|
|
|
|
|
|
if (fres == 2*arg)
|
|
|
|
printf ("The Fortran subroutine is ok!\n");
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([foo.h],
|
|
|
|
[[#ifndef _FOO_H_
|
|
|
|
#define _FOO_H_ 1
|
|
|
|
|
|
|
|
/* config.h is necessary for the fortran name mangling */
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
/* csub is an extremely useful subroutine that
|
|
|
|
* returns the argument multiplied by two :-)
|
|
|
|
*/
|
|
|
|
extern int csub(int);
|
|
|
|
|
|
|
|
/* This routine performs the same action, but
|
|
|
|
* calls the fortran subroutine fsub to do the
|
|
|
|
* real work.
|
|
|
|
*/
|
|
|
|
extern int fwrapper(int);
|
|
|
|
|
|
|
|
/* fsub does the same thing as csub, i.e. res=arg*2.
|
|
|
|
* Use autoconf macro for fortran function names.
|
|
|
|
* Note that fortran passes args by reference, so
|
|
|
|
* you need to provide pointers to your ints.
|
|
|
|
*/
|
|
|
|
extern
|
|
|
|
#ifdef __cplusplus
|
|
|
|
"C"
|
|
|
|
#endif
|
|
|
|
void FC_FUNC(fsub,FSUB)(int *arg, int *res);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([fooc.c],
|
|
|
|
[[#include <config.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "foo.h"
|
|
|
|
|
|
|
|
int csub(int arg)
|
|
|
|
{
|
|
|
|
return (2*arg);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int fwrapper(int arg)
|
|
|
|
{
|
|
|
|
int res;
|
|
|
|
printf("Calling the Fortran subroutine from the C wrapper...\n");
|
|
|
|
FC_FUNC(fsub,FSUB)(&arg,&res);
|
|
|
|
printf("Returned from the Fortran subroutine...\n");
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([foof.f90],
|
|
|
|
[[subroutine fsub(arg,res)
|
|
|
|
write(*,*) 'fsub called'
|
|
|
|
call fsubf(arg,res)
|
|
|
|
return
|
|
|
|
end
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([foof2.f90],
|
|
|
|
[[subroutine fsubf(arg,res)
|
|
|
|
implicit none
|
|
|
|
integer arg,res
|
|
|
|
write(*,*) 'fsubf called'
|
|
|
|
res=arg*2
|
|
|
|
return
|
|
|
|
end
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA([foof3.f90],
|
|
|
|
[[subroutine fsub3(arg,res)
|
|
|
|
implicit none
|
|
|
|
integer arg,res
|
|
|
|
write(*,*) 'fsub3 called'
|
|
|
|
res=arg*4
|
|
|
|
return
|
|
|
|
end
|
|
|
|
]])
|
|
|
|
|
|
|
|
LT_AT_AUTOHEADER
|
|
|
|
]) # _LT_SETUP
|
|
|
|
|
|
|
|
|
|
|
|
# _LT_CHECK_EXECUTE
|
|
|
|
# -----------------
|
|
|
|
# Run the default make rule, and check that the built binaries work.
|
|
|
|
m4_define([_LT_CHECK_EXECUTE],
|
|
|
|
[LT_AT_MAKE
|
|
|
|
|
2012-10-06 12:47:56 +08:00
|
|
|
# Due to differences in line-endings between C stdout and Fortran
|
|
|
|
# stdout, as well as unpredictable output ordering between platforms
|
|
|
|
# and runtimes, we can't reliably check the output here... although
|
|
|
|
# it should be some variation of the following:
|
2012-10-06 03:31:33 +08:00
|
|
|
LT_AT_HOST_DATA([expout],
|
tests: migrate legacy tests/fcdemo tests to Autotest.
Along with the demise of the last demo directory, so all the
cruft for re-autotooling and distributing the additional
directories is no longer necessary.
* tests/fcdemo.at: New autotest groups, based on...
* tests/fcdemo-conf.test, tests/fcdemo-exec.test,
tests/fcdemo-make.test, tests/fcdemo-shared-exec.test,
tests/fcdemo-shared-make.test, tests/fcdemo-shared.test,
tests/fcdemo-static-exec.test, tests/fcdemo-static-make.test,
tests/fcdemo-static.test: ...these legacy tests, now removed.
* tests/fcdemo/Makefile.am, tests/fcdemo/README,
tests/fcdemo/configure.ac, tests/fcdemo/cprogram.c,
tests/fcdemo/foo.h, tests/fcdemo/fooc.c, tests/fcdemo/foof.f90,
tests/fcdemo/foof2.f90, tests/fcdemo/foof3.f90,
tests/fcdemo/fprogram.f90: Remove.
* configure.ac (CONF_SUBDIRS, DIST_MAKEFILE_LIST): Remove.
* Makefile.am (DIST_SUBDIRS, FC_TESTS, clean-local-legacy)
(configure-subdirs, distclean-recursive, distdir)
(fake-distclean-legacy, $(DIST_MAKEFILE_LIST)): Remove.
(COMMON_TESTS): Rename from this...
(TESTS): ...to this.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 19:26:17 +08:00
|
|
|
[[ Welcome to GNU libtool Fortran demo!
|
|
|
|
Real programmers write in FORTRAN.
|
|
|
|
fsub called
|
|
|
|
fsubf called
|
|
|
|
fsub returned, saying that 2 * 2 = 4
|
|
|
|
fsub is ok!
|
|
|
|
fsub3 called
|
|
|
|
fsub3 returned, saying that 4 * 2 = 8
|
|
|
|
fsub3 is ok!
|
|
|
|
]])
|
2012-10-06 12:47:56 +08:00
|
|
|
LT_AT_EXEC_CHECK([./fprogram], 0, [stdout])
|
tests: migrate legacy tests/fcdemo tests to Autotest.
Along with the demise of the last demo directory, so all the
cruft for re-autotooling and distributing the additional
directories is no longer necessary.
* tests/fcdemo.at: New autotest groups, based on...
* tests/fcdemo-conf.test, tests/fcdemo-exec.test,
tests/fcdemo-make.test, tests/fcdemo-shared-exec.test,
tests/fcdemo-shared-make.test, tests/fcdemo-shared.test,
tests/fcdemo-static-exec.test, tests/fcdemo-static-make.test,
tests/fcdemo-static.test: ...these legacy tests, now removed.
* tests/fcdemo/Makefile.am, tests/fcdemo/README,
tests/fcdemo/configure.ac, tests/fcdemo/cprogram.c,
tests/fcdemo/foo.h, tests/fcdemo/fooc.c, tests/fcdemo/foof.f90,
tests/fcdemo/foof2.f90, tests/fcdemo/foof3.f90,
tests/fcdemo/fprogram.f90: Remove.
* configure.ac (CONF_SUBDIRS, DIST_MAKEFILE_LIST): Remove.
* Makefile.am (DIST_SUBDIRS, FC_TESTS, clean-local-legacy)
(configure-subdirs, distclean-recursive, distdir)
(fake-distclean-legacy, $(DIST_MAKEFILE_LIST)): Remove.
(COMMON_TESTS): Rename from this...
(TESTS): ...to this.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 19:26:17 +08:00
|
|
|
|
2012-10-06 12:47:56 +08:00
|
|
|
# A weaker output content check that is agnostic to the issues above.
|
tests: use $GREP throughout.
Trust the user, and use $GREP from TESTS_EVVIRONMENT uniformly.
* Makefile.am (TESTS_ENVIRONMENT): Add GREP setting.
* tests/am-subdir.at, tests/archive-in-archive.at, tests/bindir.at,
tests/configure-iface.at, tests/cwrapper.at, tests/darwin.at,
tests/demo.at, tests/destdir.at, tests/dumpbin-symbols.at,
tests/early-libtool.at, tests/execute-mode.at, tests/export-def.at,
tests/export.at, tests/f77demo.at, tests/fcdemo.at, tests/flags.at,
tests/help.at, tests/inherited_flags.at, tests/install.at,
tests/lalib-syntax.at, tests/libtool.at, tests/libtoolize.at,
tests/localization.at, tests/lt_dladvise.at, tests/lt_dlopen.at,
tests/lt_dlopenext.at, tests/ltdl-api.at, tests/ltdl-libdir.at,
tests/mdemo.at, tests/old-m4-iface.at, tests/pic_flag.at,
tests/resident.at, tests/runpath-in-lalib.at, tests/search-path.at,
tests/static.at, tests/sysroot.at, tests/template.at,
tests/testsuite.at, tests/versioning.at: Replace all hardcoded grep
invocations with $GREP.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2013-10-30 12:39:06 +08:00
|
|
|
AT_CHECK([$GREP 'Welcome to GNU libtool Fortran demo!' stdout],
|
2012-10-06 12:47:56 +08:00
|
|
|
[0], [ignore])
|
|
|
|
|
|
|
|
# Similarly, we can't reliably compare actual output with the following.
|
2012-10-06 03:31:33 +08:00
|
|
|
LT_AT_HOST_DATA([expout],
|
tests: migrate legacy tests/fcdemo tests to Autotest.
Along with the demise of the last demo directory, so all the
cruft for re-autotooling and distributing the additional
directories is no longer necessary.
* tests/fcdemo.at: New autotest groups, based on...
* tests/fcdemo-conf.test, tests/fcdemo-exec.test,
tests/fcdemo-make.test, tests/fcdemo-shared-exec.test,
tests/fcdemo-shared-make.test, tests/fcdemo-shared.test,
tests/fcdemo-static-exec.test, tests/fcdemo-static-make.test,
tests/fcdemo-static.test: ...these legacy tests, now removed.
* tests/fcdemo/Makefile.am, tests/fcdemo/README,
tests/fcdemo/configure.ac, tests/fcdemo/cprogram.c,
tests/fcdemo/foo.h, tests/fcdemo/fooc.c, tests/fcdemo/foof.f90,
tests/fcdemo/foof2.f90, tests/fcdemo/foof3.f90,
tests/fcdemo/fprogram.f90: Remove.
* configure.ac (CONF_SUBDIRS, DIST_MAKEFILE_LIST): Remove.
* Makefile.am (DIST_SUBDIRS, FC_TESTS, clean-local-legacy)
(configure-subdirs, distclean-recursive, distdir)
(fake-distclean-legacy, $(DIST_MAKEFILE_LIST)): Remove.
(COMMON_TESTS): Rename from this...
(TESTS): ...to this.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 19:26:17 +08:00
|
|
|
[[Welcome to GNU libtool mixed C/Fortran demo!
|
|
|
|
The C subroutine returned, claiming that 2*2 = 4
|
|
|
|
The C subroutine is ok!
|
|
|
|
|
|
|
|
Calling the C wrapper routine...
|
|
|
|
Calling the Fortran subroutine from the C wrapper...
|
|
|
|
fsub called
|
|
|
|
fsubf called
|
|
|
|
Returned from the Fortran subroutine...
|
|
|
|
The C wrapper to the fortran subroutine returned,
|
|
|
|
claiming that 2*2 = 4
|
|
|
|
The Fortran subroutine is ok!
|
|
|
|
]])
|
2012-10-06 12:47:56 +08:00
|
|
|
LT_AT_EXEC_CHECK([./cprogram], 0, [stdout])
|
|
|
|
|
|
|
|
# A weaker output content check that is agnostic to the issues above.
|
tests: use $GREP throughout.
Trust the user, and use $GREP from TESTS_EVVIRONMENT uniformly.
* Makefile.am (TESTS_ENVIRONMENT): Add GREP setting.
* tests/am-subdir.at, tests/archive-in-archive.at, tests/bindir.at,
tests/configure-iface.at, tests/cwrapper.at, tests/darwin.at,
tests/demo.at, tests/destdir.at, tests/dumpbin-symbols.at,
tests/early-libtool.at, tests/execute-mode.at, tests/export-def.at,
tests/export.at, tests/f77demo.at, tests/fcdemo.at, tests/flags.at,
tests/help.at, tests/inherited_flags.at, tests/install.at,
tests/lalib-syntax.at, tests/libtool.at, tests/libtoolize.at,
tests/localization.at, tests/lt_dladvise.at, tests/lt_dlopen.at,
tests/lt_dlopenext.at, tests/ltdl-api.at, tests/ltdl-libdir.at,
tests/mdemo.at, tests/old-m4-iface.at, tests/pic_flag.at,
tests/resident.at, tests/runpath-in-lalib.at, tests/search-path.at,
tests/static.at, tests/sysroot.at, tests/template.at,
tests/testsuite.at, tests/versioning.at: Replace all hardcoded grep
invocations with $GREP.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2013-10-30 12:39:06 +08:00
|
|
|
AT_CHECK([$GREP 'Welcome to GNU libtool mixed C/Fortran demo!' stdout],
|
2012-10-06 12:47:56 +08:00
|
|
|
[0], [ignore])
|
tests: migrate legacy tests/fcdemo tests to Autotest.
Along with the demise of the last demo directory, so all the
cruft for re-autotooling and distributing the additional
directories is no longer necessary.
* tests/fcdemo.at: New autotest groups, based on...
* tests/fcdemo-conf.test, tests/fcdemo-exec.test,
tests/fcdemo-make.test, tests/fcdemo-shared-exec.test,
tests/fcdemo-shared-make.test, tests/fcdemo-shared.test,
tests/fcdemo-static-exec.test, tests/fcdemo-static-make.test,
tests/fcdemo-static.test: ...these legacy tests, now removed.
* tests/fcdemo/Makefile.am, tests/fcdemo/README,
tests/fcdemo/configure.ac, tests/fcdemo/cprogram.c,
tests/fcdemo/foo.h, tests/fcdemo/fooc.c, tests/fcdemo/foof.f90,
tests/fcdemo/foof2.f90, tests/fcdemo/foof3.f90,
tests/fcdemo/fprogram.f90: Remove.
* configure.ac (CONF_SUBDIRS, DIST_MAKEFILE_LIST): Remove.
* Makefile.am (DIST_SUBDIRS, FC_TESTS, clean-local-legacy)
(configure-subdirs, distclean-recursive, distdir)
(fake-distclean-legacy, $(DIST_MAKEFILE_LIST)): Remove.
(COMMON_TESTS): Rename from this...
(TESTS): ...to this.
Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2011-11-24 19:26:17 +08:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
## -------------- ##
|
|
|
|
## Fcdemo static. ##
|
|
|
|
## -------------- ##
|
|
|
|
|
|
|
|
AT_SETUP([static library])
|
|
|
|
|
|
|
|
# Executing the static fprogram might be interactive on MSYS.
|
|
|
|
AT_KEYWORDS([interactive])
|
|
|
|
|
|
|
|
_LT_SETUP
|
|
|
|
|
|
|
|
LT_AT_CHECK_CONFIG([--disable-shared],
|
|
|
|
[^build_old_libs=yes], [^build_libtool_libs=no])
|
|
|
|
_LT_CHECK_EXECUTE
|
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
## -------------- ##
|
|
|
|
## Fcdemo shared. ##
|
|
|
|
## -------------- ##
|
|
|
|
|
|
|
|
AT_SETUP([shared library])
|
|
|
|
|
|
|
|
_LT_SETUP
|
|
|
|
|
|
|
|
LT_AT_CHECK_CONFIG([--disable-static],
|
|
|
|
[^build_old_libs=no], [^build_libtool_libs=yes])
|
|
|
|
_LT_CHECK_EXECUTE
|
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
## ------------ ##
|
|
|
|
## Fcdemo conf. ##
|
|
|
|
## ------------ ##
|
|
|
|
|
|
|
|
AT_SETUP([shared and static together])
|
|
|
|
|
|
|
|
_LT_SETUP
|
|
|
|
|
|
|
|
LT_AT_CHECK_CONFIG([],
|
|
|
|
[^build_old_libs=yes], [^build_libtool_libs=yes])
|
|
|
|
_LT_CHECK_EXECUTE
|
|
|
|
|
|
|
|
AT_CLEANUP
|