1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00
Commit graph

205 commits

Author SHA1 Message Date
Andy Wingo
997659f898 make scm_make_continuation internal
* libguile/continuations.h:
* libguile/continuations.c (scm_i_make_continuation): Change from
  scm_make_continuation, and make internal.

* libguile/vm-i-system.c (call/cc, tail-call/cc): Adapt callers.

* test-suite/standalone/test-unwind.c (check_cont_body): Adapt a test.

* doc/ref/api-control.texi (Continuations): Update docs.
2010-02-08 13:35:06 +01:00
Andy Wingo
17d819d4c4 add a test for ffi and pointers
* test-suite/standalone/test-ffi:
* test-suite/standalone/test-ffi-lib.c: Add a pointer test.
2010-01-27 22:25:29 +01:00
Andy Wingo
c612ed59ab add a test for foreign functions taking struct args
* test-suite/standalone/test-ffi (f-sum-struct):
* test-suite/standalone/test-ffi-lib.c (test_ffi_sum_struct): Add a
  struct test. Wheee....
2010-01-26 22:56:42 +01:00
Andy Wingo
37371ea1ba add ffi tests
* test-suite/standalone/Makefile.am:
* test-suite/standalone/test-ffi:
* test-suite/standalone/test-ffi-lib.c: Add some tests for the ffi.
2010-01-26 22:56:42 +01:00
Thien-Thi Nguyen
bd4b6c1a83 Use mkstemp' instead of mktemp'.
* test-suite/standalone/test-unwind.c (check_ports):
Use `mkstemp' instead of `mktemp'.

Signed-off-by: Thien-Thi Nguyen <ttn@gnuvola.org>
2010-01-13 20:49:37 +01:00
Ludovic Courtès
bc4adf1739 Remove unneeded #include <assert.h>.
* libguile/backtrace.c, libguile/eval.c, libguile/gc.c,
  libguile/goops.c, libguile/memoize.c, libguile/threads.c,
  libguile/uniform.c, libguile/vm.c,
  test-suite/standalone/test-conversion.c,
  test-suite/standalone/test-list.c: Don't include <assert.h>.
2009-12-15 20:20:38 +01:00
Ludovic Courtès
5b98517a65 Fix test environment issue with ltdl from Libtool 2.2.6b.
Earlier versions of ltdl would look for extensions under $PWD; this
behavior changed in 2.2.6b.

* test-suite/standalone/Makefile.am (TESTS_ENVIRONMENT): Define
  $builddir.

* test-suite/standalone/test-asmobs: Specify the full path to
  `libtest-asmobs', using $builddir.

* test-suite/standalone/test-extensions: Likewise.
2009-12-14 10:59:25 +01:00
Ludovic Courtès
c291b58835 Fix stylistic issues revealed by "make syntax-check".
* libguile/gc-malloc.c (scm_must_free): Remove unnecessary `if' before
  `free ()'.

* libguile/stime.c (scm_localtime, scm_mktime): Likewise.

* libguile/eval.i.c (ceval): Don't cast the result of alloca(3).

* libguile/i18n.c (SCM_STRING_TO_U32_BUF): Likewise.

* test-suite/standalone/test-unwind.c: Likewise.

* libguile/strings.c (scm_i_deprecated_string_chars): Don't end error
  message in period.
2009-11-17 23:42:36 +01:00
Ludovic Courtès
56a3dcd431 Remove references to undefined macros.
The intent is to allow compilation with `-Wundef', which in turn should
make it easier to catch erroneous uses of nonexistent macros.

* libguile/__scm.h: Don't assume `BUILDING_LIBGUILE' is defined.

* libguile/conv-uinteger.i.c (SCM_TO_TYPE_PROTO): Remove unneeded CPP
  conditional on `TYPE_MIN == 0'.

* libguile/fports.c: Check for the definition of `HAVE_CHSIZE' and
  `HAVE_FTRUNCATE', not for their value.

* libguile/ports.c: Likewise.

* libguile/numbers.c (guile_ieee_init): Likewise with `HAVE_DINFINITY'
  and `HAVE_DQNAN'.

* test-suite/standalone/test-conversion.c (ieee_init): Likewise.

* libguile/strings.c: Likewise with `SCM_STRING_LENGTH_HISTOGRAM'.

* libguile/strings.h: Likewise.

* libguile/tags.h: Likewise with `HAVE_INTTYPES_H' and `HAVE_STDINT_H'.

* libguile/threads.c: Likewise with `HAVE_PTHREAD_GET_STACKADDR_NP'.

* libguile/vm-engine.c (VM_NAME): Likewise with `VM_CHECK_IP'.

* libguile/gen-scmconfig.c (main): Use "#ifdef HAVE_", not "#if HAVE_".

* libguile/socket.c (scm_setsockopt): Likewise.
2009-11-17 23:42:22 +01:00
Ludovic Courtès
5e5351f8f8 Update `.gitignore'. 2009-11-08 01:15:23 +01:00
Neil Jerram
440ae51035 Fill code coverage holes in continuations.c and keywords.c
* test-suite/Makefile.am (SCM_TESTS): Add tests/keywords.test.

* test-suite/standalone/Makefile.am (test-loose-ends): New test.

* test-suite/standalone/test-loose-ends.c: New file.

* test-suite/tests/continuations.test: Three new tests.

* test-suite/tests/keywords.test: New file.
2009-11-04 00:00:09 +00:00
Neil Jerram
98241dc53f Revert "Change dynwind flag enums to #defines, for greater portability"
This reverts commit b25aa0b937.
2009-10-07 22:14:38 +01:00
Neil Jerram
b25aa0b937 Change dynwind flag enums to #defines, for greater portability
Thanks to Inge Gutheil for raising this problem.

* doc/ref/api-control.texi (Dynamic Wind): Remove doc for
  scm_t_dynwind_flags, and change uses of scm_t_dynwind_flags to int.
  Mention possible flags inside doc for scm_dynwind_begin instead.
  Similarly for scm_t_wind_flags.  In this case the doc on possible
  flags is moved to after the four functions that can use them.

* libguile/dynwind.c (scm_dynwind_begin): Change scm_t_dynwind_flags
  to int.
  (scm_dynwind_unwind_handler): Change scm_t_wind_flags to int.
  (scm_dynwind_rewind_handler): Ditto.
  (scm_dynwind_unwind_handler_with_scm): Ditto.
  (scm_dynwind_rewind_handler_with_scm): Ditto.

* libguile/dynwind.h (SCM_F_DYNWIND_REWINDABLE): Use #define instead
  of typedef enum.
  (SCM_F_WIND_EXPLICITLY): Ditto.
  (function declarations): Change scm_t_dynwind_flags and
  scm_t_wind_flags to int.

* test-suite/standalone/test-unwind.c (check_cont_body): Change
  scm_t_dynwind_flags to int.
2009-10-02 22:20:47 +01:00
Ludovic Courtès
f538a0709a Add test case for `scm_take_u8vector ()'.
This is a followup to commit d7e7a02a62
("Fix leaky behavior of `scm_take_TAGvector ()'.") and a reminder that
the uniform vector implementation can't do away with the cell->buffer
indirection.

* test-suite/standalone/Makefile.am (test_scm_take_u8vector_SOURCES,
  test_scm_take_u8vector_CFLAGS, test_scm_take_u8vector_LDADD): New.
  (check_PROGRAMS, TESTS): Add `test-scm-take-u8vector'.

* test-suite/standalone/test-scm-take-u8vector.c: New file.
2009-09-03 00:57:24 +02:00
Ken Raeburn
a66480374e Pick up in tree headers rather than installed ones
From Ken Raeburn:

The Mac build off of "master" fails for me currently in srfi-13.c,
with the comparison-always-false warning Greg discussed.  I hacked
around that, but then guile-readline doesn't build:

Making all in guile-readline
../libguile/guile-snarf -o readline.x ../../guile-readline/readline.c
-
DHAVE_CONFIG_H  -I. -I.. -I../../guile-readline/.. -I../../guile-
readline/lib -I./lib  -g -O2
In file included from ../../guile-readline/readline.c:29:
../../guile-readline/../libguile.h:25:17: error: gmp.h: No such file
or directory
In file included from ../../guile-readline/../libguile.h:95,
                 from ../../guile-readline/readline.c:29:
../../guile-readline/../libguile/strings.h:26:21: error: uniconv.h: No
such file or directory

Neither the path specified for libgmp nor the path specified for
libunistring at configure time is included here.

I don't think any of this is Mac-specific; I'm surprised that it works
on GNU/Linux systems.  Perhaps I'm building it in ways that are
unusual for the other developers (build dir != src dir, libgmp and
guile-1.8 installed in the same place, libgmp and libunistring
installed in different nonstandard directories)?

If I use CPPFLAGS=... and LDFLAGS=... instead of --with-libfoo-prefix
configure options to specify paths to find libgmp and libunistring,
the tests still pick old, installed Guile headers (which this time
I've poisoned to highlight the problem) from those locations instead
of the in-tree versions:

Making all in test-suite
Making all in standalone
../../libguile/guile-snarf -o test-asmobs-lib.x ../../../test-suite/
standalone/test-asmobs-lib.c -DHAVE_CONFIG_H
-I. -I../../../test-suite/ standalone -I../.. -I/opt/local/include
-I/Users/raeburn/dev/guile/ libunistring-0.9.1/I/include -g -O2
-I../../.. -I../../../lib -I../../ lib -I../..
In file included from /opt/local/include/libguile.h:30,
                 from ../../../test-suite/standalone/test-asmobs-
lib.c:23:
/opt/local/include/libguile/__scm.h:3:2: error: #error Poison!

I might be building Guile as part of a larger package
(*cough*Emacs*cough*) that wants to include stuff from the same system
directories (e.g., for MacPorts, pkgsrc, whatever) where an old
version of Guile is installed, and thus Guile gets passed CPPFLAGS/
LDFLAGS settings that add that old version to the search paths.  So I
think the CPPFLAGS/LDFLAGS version needs to be made to work, as well
as the --with-libfoo-prefix version.

With the attached patch, I can get guile to build with CPPFLAGS= and
LDFLAGS= ... someone more familiar than I am with automake will have
to fix the guile-readline stuff.
2009-08-26 23:07:17 +01:00
Ludovic Courtès
e4ca305f24 Turn off auto-compilation to stand-alone tests.
* test-suite/standalone/Makefile.am (TESTS_ENVIRONMENT): Add
  "GUILE_AUTO_COMPILE=0".
2009-08-15 14:35:29 +02:00
Neil Jerram
53befeb700 Change Guile license to LGPLv3+
(Not quite finished, the following will be done tomorrow.
   module/srfi/*.scm
   module/rnrs/*.scm
   module/scripts/*.scm
   testsuite/*.scm
   guile-readline/*
)
2009-06-17 00:22:09 +01:00
Ludovic Courtès
13ff47408f Fix compilation of `test-round.c' on BSD.
* test-suite/standalone/test-round.c (HAVE_MACHINE_FPU_H): Include
  <sys/types.h> when available.  This fixes compilation on NetBSD.
  Reported by Greg Toxel.
2009-05-21 00:12:43 +02:00
Ludovic Courtès
e2e85d1406 Don't use raw divisions by zero in `test-conversion.c'.
* test-suite/standalone/test-conversion.c (ieee_init): New function.
  (guile_Inf, guile_NaN): New variables.
  (test_from_double, test_to_double): Use them.  Divisions by zero made
  `cc' on Tru64 5.1b ("Compaq C V6.5-011") bail out and led to a
  floating point exception when compiled with GCC on the same platform.
  (main): Call `ieee_init ()'.
2009-05-21 00:12:04 +02:00
Ludovic Courtès
66818dbb71 Use <machine/fpu.h> instead of <fenv.h> when needed (e.g., Tru64 5.1b).
* configure.in: Look for <machine/fpu.h>.

* test-suite/standalone/test-round.c: Use <machine/fpu.h> if available.
2009-05-21 00:11:22 +02:00
Ludovic Courtès
d0f452d162 Remove extraneous semicolons from `test-conversion.c'.
* test-suite/standalone/test-conversion.c: Remove extraneous semicolon
  following `DEF[SU]TST' invocations since that made Compaq C
  V6.5-011 (`cc' on Tru64 5.1b) bail out.
2009-05-20 23:53:23 +02:00
Andy Wingo
a44c43368b 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/.
2009-03-30 20:28:30 -07:00
Andy Wingo
23ccb831ff rely on getrlimit to DTRT, don't make stack calibration file
* libguile/measure-hwm.scm: Remove.

* .gitignore: Update for removal.

* test-suite/standalone/test-fast-slot-ref.in:
* test-suite/standalone/test-use-srfi.in:
* am/guilec:
* check-guile.in: Revert back to normal guile invocation.

* libguile/Makefile.am: Don't make a stack calibration file, as the
  getrlimit-based limit setting should work fine.
2009-03-27 15:51:16 -07:00
Andy Wingo
0b6d8fdc28 allow building against uninstalled guile; move some things to meta/
* README: Add more info about building against an uninstalled Guile.

* meta/: New directory. The proximate cause of its creation is that I
  want to be able to build external packages against uninstalled Guile,
  and to do that I need guile-tools in the PATH, but I don't want
  $top_builddir/libtool in the path. But it seems like a good
  reorganization, for things that are /about/ Guile: pkg-config files, m4
  files, guile-config... then we also include uninstalled info: the
  environment, the pre-inst-guile script, etc.

* meta/guile-1.8-uninstalled.pc.in: New pkg-config template. pkg-config
  prefers -uninstalled pkg-config files, if they are in its path.

* meta/Makefile.am:
* meta/ChangeLog-2008:
* meta/gdb-uninstalled-guile.in:
* meta/guile-1.8.pc.in:
* meta/guile-config.in:
* meta/guile.m4:
* meta/guile-tools.in: Moved to meta/.

* meta/guile.in: This is the new name of pre-inst-guile.in.

* meta/uninstalled-env.in: And this, pre-inst-guile-env.in.

* Makefile.am:
* am/guilec:
* am/pre-inst-guile:
* check-guile.in:
* configure.in:
* doc/ref/Makefile.am:
* gc-benchmarks/run-benchmark.scm:
* test-suite/standalone/Makefile.am:
* test-suite/standalone/README:
* testsuite/Makefile.am: Adapt to meta/ change.
2009-03-27 14:03:03 -07:00
Ludovic Courtès
05588a1ace Have `scm_take_locale_symbol ()' return an interned symbol (fixes bug #25865).
* libguile/symbols.c (intern_symbol): New function, with code formerly
  duplicated in `scm_i_c_mem2symbol ()' and `scm_i_mem2symbol ()'.
  (scm_i_c_mem2symbol, scm_i_mem2symbol): Use it.
  (scm_take_locale_symboln): Use `intern_symbol ()'.  This fixes
  bug #25865.

* test-suite/standalone/Makefile.am
  (test_scm_take_locale_symbol_SOURCES,
  test_scm_take_locale_symbol_CFLAGS,
  test_scm_take_locale_symbol_LDADD): New variables.
  (check_PROGRAMS, TESTS): Add `test-scm-take-locale-symbol'.
2009-03-19 22:17:40 +01:00
Andy Wingo
aeeff258c6 non-srcdir build fixes
* guile-tools.in: Fix the checks to account for non-srcdir builds.

* libguile/frames.c:
* libguile/objcodes.c:
* libguile/programs.c:
* libguile/instructions.c:
* libguile/vm.c: Fix snarf-includes to cope with non-srcdir builds.

* libguile/instructions.h:
* libguile/instructions.c: Fix the stubs inclusion to be non-srcdir
  compatible.

* libguile/vm-expand.h (VM_DEFINE_INSTRUCTION): Fix some things so as not
  to require the instructions.h defintitions, since we have the codes
  already. Not important tho :)

* pre-inst-guile-env.in: Minor tweak that should have no effect.

* test-suite/standalone/Makefile.am (all-local): Remove a chmod +x step,
  the configure.ac rule should do that if necessary.
2009-03-17 16:47:55 +01:00
Neil Jerram
a9931e4e1a Fix implementation of %fast-slot-ref and %fast-slot-set!
* libguile/goops.c (scm_sys_fast_slot_ref, scm_sys_fast_slot_set_x):
  Correct incantation for getting the number of slots of the specified
  instance.

* libguile/goops.h (SCM_NUMBER_OF_SLOTS): Removed (because wrong).

* test-suite/standalone/test-fast-slot-ref.in: New standalone test.

* configure.in: Generate test-suite/standalone/test-fast-slot-ref.

* test-suite/standalone/Makefile.am (check_SCRIPTS): Add
  test-fast-slot-ref.
2009-01-04 22:46:47 +00:00
Ludovic Courtès
9283475935 Fix comments in `test-scm-c-read.c'.
* test-suite/standalone/test-scm-c-read.c (make_port): Fix comments.
2008-11-24 09:10:51 +01:00
Ludovic Courtès
8e7ff77376 Add C unit test for `scm_c_read ()' and the port API.
* test-suite/standalone/Makefile.am (check_PROGRAMS, TESTS): Add
  `test-scm-c-read'.
  (test_scm_c_read_SOURCES, test_scm_c_read_CFLAGS,
  test_scm_c_read_LDADD): New.
2008-11-23 22:48:29 +00:00
Ludovic Courtès
ccf1ca4adf Update the thread stack base when `scm_with_guile' is invoked multiple times.
* NEWS: Update.

* libguile/threads.c (scm_i_init_thread_for_guile): When the thread is
  already guilified, update `t->base' so that it corresponds to the new
  stack base.  Bug report and patch by Linas Vepstas <linasvepstas@gmail.com>.

* test-suite/standalone/Makefile.am (test_scm_with_guile_CFLAGS,
  test_scm_with_guile_LDADD): New.
  (check_PROGRAMS, TESTS): Add `test-scm-with-guile'.
2008-11-14 00:36:58 +01:00
Ludovic Courtès
38c1da430c Augment `.gitignore'. 2008-11-13 23:27:25 +01:00
Neil Jerram
d8b6e19181 Avoid Stack overflow' errors when running make check'
For explanation, see comments and text in the new file
libguile/measure-hwm.scm.

* .gitignore: Add libguile/stack-limit-calibration.scm.

* check-guile.in: Load libguile/stack-limit-calibration.scm.

* configure.in: Add AC_CONFIG_FILES to generate test-use-srfi from
  test-use-srfi.in.

* libguile/Makefile.am (TESTS, TESTS_ENVIRONMENT,
  stack-limit-calibration.scm): New targets, so that `make check'
  calibrates the stack limit before running the Guile test suite.

* libguile/measure-hwm.scm: New file, calibrates stack limit for `make
  check'.

* libguile/stackchk.c (scm_sys_get_stack_size): New primitive.

* libguile/stackchk.h (scm_sys_get_stack_size): New primitive
  (declaration).

* test-suite/standalone/test-use-srfi: Renamed test-use-srfi.in, so
  that ./configure can fill in variables in it.

* test-suite/standalone/test-use-srfi.in: Load
  libguile/stack-limit-calibration.scm.
2008-10-17 22:05:54 +01:00
Han-Wen Nienhuys
89bc270db3 Remove GH and its traces. 2008-09-28 18:42:02 -03:00
Ludovic Courtès
3394818c0a Include <config.h> in standalone tests.
* test-suite/standalone/Makefile.am (test_cflags): Add `-I$(top_builddir)' so
  that <config.h> can be found.
  (snarfcppopts): Likewise.

* test-suite/standalone/*.c: Include <config.h>.
2008-09-13 20:09:08 +02:00
Ludovic Courtès
85ca88c68b Remove `.cvsignore' files. 2008-09-11 21:28:21 +02:00
Ludovic Courtès
bfb2e11358 Use $(GCC_CFLAGS) for `-Werror' et al. so that it's not used to compile
Gnulib code.
2008-08-25 22:08:45 +02:00
Ludovic Courtès
8722d99a45 Use `-q' when running standalone tests. 2008-07-06 23:58:38 +02:00
Ludovic Courtès
fcbc08686c Support systems whose <inttypes.h> doesn't define `PRIiMAX'. 2008-06-02 21:34:57 +02:00
Ludovic Courtès
102dbb6f6c Add `SCM_INTERNAL' macro, use it. 2008-05-31 23:21:02 +02:00
Ludovic Courtès
56ae214817 Only run `test-with-guile-module' when pthread support is built. 2008-04-26 21:56:02 +02:00
Ludovic Courtès
5995c6d801 Fix "#include" directives in stand-alone C tests. 2008-04-07 23:59:36 +02:00
Ludovic Courtès
89e3e0dcea More `.gitignore'. 2008-04-07 23:48:48 +02:00
Ludovic Courtès
eedcb08a25 Honor $TMPDIR in the test suite. 2008-03-13 14:03:58 +00:00
Neil Jerram
2018147881 Updated to GNU coding
standards; added standard license statement.
2008-02-23 18:29:45 +00:00
Neil Jerram
b226295af8 Release stuff: missing NEWS and 2007/2008 copyrights. 2008-02-15 23:13:59 +00:00
Neil Jerram
01be513ed1 New test file (forgotten from checkin last week). 2008-02-05 21:55:44 +00:00
Neil Jerram
3ac8359afd * modules.c (the_root_module): Moved before scm_current_module.
(scm_current_module): Return the root module if `the-module' fluid
gives #f.

* standalone/Makefile.am: Add stanza for test-with-guile-module.

* standalone/test-with-guile-module.c: New test.
2008-02-01 22:51:34 +00:00
Neil Jerram
c0186ee736 (top level): Explain the point of this test. 2007-12-29 12:34:34 +00:00
Neil Jerram
d69668b7de * standalone/test-bad-identifiers: New test.
* standalone/Makefile.am (check_SCRIPTS, TESTS): Add it.
2007-12-29 01:35:47 +00:00
Neil Jerram
2d04022ce2 * tests/continuations.test ("continuations"): Use
with-debugging-evaluator.

* lib.scm (with-debugging-evaluator*, with-debugging-evaluator):
New utilities.

* standalone/test-use-srfi: Use -q to avoid picking up the user's
~/.guile file.

* tests/eval.test (promises)[unmemoizing a promise]: New test.
2007-10-21 20:45:45 +00:00