mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 03:30:27 +02:00
add test case for load-extension bug, fix gdb-uninstalled-guile
* test-suite/standalone/test-extensions: * test-suite/standalone/test-extensions-lib.c: * test-suite/standalone/Makefile.am: Add a test case for the load-extension bug. * meta/gdb-uninstalled-guile.in: Fix the path to include meta/.
This commit is contained in:
parent
9c0cd73e61
commit
a44c43368b
4 changed files with 67 additions and 1 deletions
|
@ -34,5 +34,5 @@
|
|||
set -e
|
||||
# env (set by configure)
|
||||
top_builddir="@top_builddir_absolute@"
|
||||
exec ${top_builddir}/uninstalled-env libtool --mode=execute \
|
||||
exec ${top_builddir}/meta/uninstalled-env libtool --mode=execute \
|
||||
gdb --args ${top_builddir}/libguile/guile "$@"
|
||||
|
|
|
@ -125,6 +125,15 @@ test_scm_take_locale_symbol_LDADD = ${top_builddir}/libguile/libguile.la
|
|||
check_PROGRAMS += test-scm-take-locale-symbol
|
||||
TESTS += test-scm-take-locale-symbol
|
||||
|
||||
# test-extensions
|
||||
noinst_LTLIBRARIES += libtest-extensions.la
|
||||
libtest_extensions_la_SOURCES = test-extensions-lib.c
|
||||
libtest_extensions_la_CFLAGS = ${test_cflags}
|
||||
libtest_extensions_la_LDFLAGS = -no-undefined -rpath `pwd` # so libtool will really build an .so
|
||||
libtest_extensions_la_LIBADD = ${top_builddir}/libguile/libguile.la
|
||||
check_SCRIPTS += test-extensions
|
||||
TESTS += test-extensions
|
||||
|
||||
|
||||
if BUILD_PTHREAD_SUPPORT
|
||||
|
||||
|
|
14
test-suite/standalone/test-extensions
Executable file
14
test-suite/standalone/test-extensions
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
exec guile -q -s "$0" "$@"
|
||||
!#
|
||||
|
||||
(load-extension "libtest-extensions" "libtest_extensions_init")
|
||||
(load-extension "libtest-extensions" "libtest_extensions_init2")
|
||||
|
||||
(or (= init2-count 1)
|
||||
(error "init2 called more or less than one time"))
|
||||
|
||||
|
||||
;; Local Variables:
|
||||
;; mode: scheme
|
||||
;; End:
|
43
test-suite/standalone/test-extensions-lib.c
Normal file
43
test-suite/standalone/test-extensions-lib.c
Normal file
|
@ -0,0 +1,43 @@
|
|||
/* Copyright (C) 1999,2000,2001,2003, 2006, 2008 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library 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 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <libguile.h>
|
||||
|
||||
SCM init2_count;
|
||||
|
||||
void libtest_extensions_init2 (void);
|
||||
void libtest_extensions_init (void);
|
||||
|
||||
void
|
||||
libtest_extensions_init2 (void)
|
||||
{
|
||||
scm_variable_set_x (init2_count,
|
||||
scm_from_int (scm_to_int (scm_variable_ref (init2_count)) + 1));
|
||||
}
|
||||
|
||||
void
|
||||
libtest_extensions_init (void)
|
||||
{
|
||||
scm_c_define ("init2-count", scm_from_int (0));
|
||||
init2_count = scm_permanent_object (scm_c_lookup ("init2-count"));
|
||||
scm_c_register_extension ("libtest-extensions", "libtest_extensions_init2",
|
||||
(scm_t_extension_init_func)libtest_extensions_init2, NULL);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue