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

225 commits

Author SHA1 Message Date
Mark H Weaver
c33ecf96a4 Merge remote-tracking branch 'origin/stable-2.0' 2013-03-28 22:24:00 -04:00
Ludovic Courtès
4702deb424 tests: Skip `test-pthread-create-secondary' except on Linux-based systems.
* test-suite/standalone/test-pthread-create-secondary.c: Skip on
  non-Linux-based systems.
2013-03-28 23:33:44 +01:00
Mark H Weaver
26d148066f Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	configure.ac
	libguile/deprecated.c
	libguile/deprecated.h
	libguile/filesys.h
	libguile/fluids.c
	libguile/fports.c
	libguile/gc.c
	libguile/guile.c
	libguile/numbers.c
	libguile/objcodes.c
	libguile/r6rs-ports.c
	libguile/smob.c
	libguile/socket.c
	libguile/threads.h
	module/language/scheme/decompile-tree-il.scm
	module/language/tree-il/peval.scm
	test-suite/tests/syncase.test
2013-03-28 05:09:53 -04:00
Mike Gran
d2df3950a9 Add standalone test for smob marking
* test-suite/standalone/Makefile.am (TESTS, check_PROGRAMS): add test-smob-mark
  (test_smob_mark_SOURCES, test_smob_mark_CFLAGS, test_smob_mark_LDADD): new variables
* test-suite/standalone/test-smob-mark.c: new file
2013-03-10 19:43:38 -07:00
Andy Wingo
83dce818ec GUILE_INSTALL_LOCALE=1 during build
* doc/ref/Makefile.am (autoconf-macros.texi):
* libguile/Makefile.am (snarf2checkedtexi):
* module/Makefile.am (ice-9/psyntax-pp.scm.gen, ice-9/psyntax-pp.go):
* test-suite/Makefile.am (GUILE_AUTO_COMPILE):
* test-suite/standalone/Makefile.am (GUILE_INSTALL_LOCALE):
* test-suite/vm/Makefile.am (TESTS_ENVIRONMENT):
* am/guilec (.scm.go): Set GUILE_INSTALL_LOCALE to 1 during the build.
  Fixes bug 12887.
2013-03-07 11:02:33 +01:00
Mark H Weaver
5ccc3764b3 Support calling foreign functions of 10 arguments or more.
* libguile/foreign.c (OBJCODE_HEADER, META_HEADER, META): Change these
  into higher-order macros.
  (GEN_CODE): New higher-order macro based on 'CODE'.
  (M_STATIC, M_DYNAMIC): New macros.
  (CODE): Reimplement using 'GEN_CODE' and 'M_STATIC'.
  (make_objcode_trampoline): New static function.
  (large_objcode_trampolines, large_objcode_trampolines_mutex): New
  static variables.
  (get_objcode_trampoline): New static function.
  (cif_to_procedure): Use 'get_objcode_trampoline'.

* test-suite/standalone/test-ffi-lib.c (test_ffi_sum_many):
  New function.

* test-suite/standalone/test-ffi: Add test.
2013-02-28 04:11:35 -05:00
Ludovic Courtès
4124994771 tests: Avoid missing missing-prototype warning with <fenv.h> on glibc 2.17.
* test-suite/standalone/test-round.c: Avoid missing-prototype warning
  with <fenv.h> on glibc 2.17.
2013-02-27 20:40:07 +01:00
Andy Wingo
180ac9d7b0 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
	module/language/bytecode/spec.scm
	module/language/tree-il/spec.scm
2013-01-31 11:52:42 +01:00
Ludovic Courtès
13ff681c33 Add tests for `--language'.
* test-suite/standalone/Makefile.am (top_srcdir): Add `top_srcdir'.
  (check_SCRIPTS, TESTS): Add `test-language'.
  (EXTRA_DIST): Add `test-language.el' and `test-language.js'.
* test-suite/standalone/test-language,
  test-suite/standalone/test-language.el,
  test-suite/standalone/test-language.js: New files.
2013-01-26 21:49:17 +01:00
Andy Wingo
e7501d4a68 Merge commit 'd10f7b572c'
Conflicts:
	libguile/smob.c
	libguile/smob.h
	test-suite/tests/tree-il.test
2012-04-26 22:17:47 +02:00
Mark H Weaver
bbb9f000ad Fix scm_to_utf8_stringn once and for all; optimize; add tests
* libguile/strings.c (scm_to_utf8_stringn): Fix another new bug in this
  recent comedy of errors: pass the size of the preallocated buffer to
  u32_to_u8.  Arrange to call 'scm_i_string_wide_chars' and
  'scm_i_string_length' only once each.  Rename local variables for
  improved code clarity.

* test-suite/standalone/test-conversion.c (test_to_utf8_stringn): New
  function to test scm_to_utf8_stringn.
2012-04-04 18:58:44 -04:00
Andy Wingo
9d15db65ff Merge remote-tracking branch 'local-2.0/stable-2.0'
Conflicts:
	module/language/tree-il/analyze.scm
2012-02-23 14:10:22 +01:00
Ludovic Courtès
5de0053178 Don't fail when locale env. vars specify a dot-less locale name.
Fixes <http://bugs.gnu.org/10742>.
Reported by Alírio Eyng <alirioeyng@ig.com.br>.

* gnulib-local/lib/localcharset.c.diff (environ_locale_charset): Change
  to set CODESET to "" when LOCALE lacks a dot.  Return "ISO-8859-1"
  when CODESET is the empty string.

* lib/localcharset.c: Update.

* test-suite/standalone/Makefile.am (check_SCRIPTS): Add
  `test-command-line-encoding2'.
  (TESTS): Likewise.

* test-suite/standalone/test-command-line-encoding2: New file.
2012-02-18 00:04:17 +01:00
Andy Wingo
0858753e82 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	GUILE-VERSION
	libguile/gc-malloc.c
	libguile/ports.c
2012-02-08 11:48:08 +01:00
Mark H Weaver
1d00abb04f Implement scm_to_pointer
* libguile/foreign.c, libguile/foreign.h (scm_to_pointer):
  New C function.

* test-suite/standalone/test-loose-ends.c: Add test.
2012-02-02 18:34:52 -05:00
Andy Wingo
dfadcf85cb Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/debug.h
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
	module/language/tree-il/peval.scm
	module/language/tree-il/primitives.scm
2012-01-30 20:27:35 +01:00
Andy Wingo
855db1905d Merge commit '9b0975f1dc'
Conflicts:
	libguile/foreign.c
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
2012-01-30 18:25:07 +01:00
Mark H Weaver
07c2ca0f0d Rename scm_call_varargs -> scm_call
* libguile/eval.c, libguile/eval.h, doc/ref/api-evaluation.texi,
  test-suite/standalone/test-loose-ends.c, NEWS: Rename
  scm_call_varargs -> scm_call

Suggested by Ludovic Courtès <ludo@gnu.org>
2012-01-30 11:02:29 -05:00
Mark H Weaver
741b8a2300 Implement scm_call_varargs and scm_call_{7,8,9}
* libguile/eval.c (scm_call_7, scm_call_8, scm_call_9,
  scm_call_varargs): New functions.

* libguile/eval.h: Add prototypes.

* doc/ref/api-evaluation.texi: Add documentation.

* test-suite/standalone/test-loose-ends.c: Add tests.

* NEWS: Add news entry.
2012-01-30 10:27:44 -05:00
Andy Wingo
0133e13f34 fix test-loose-ends
* test-suite/standalone/test-loose-ends.c (test_scm_local_eval): Use
  ice-9 local-eval to get (the-environment).
2012-01-26 18:21:01 +01:00
Andy Wingo
d062a8c1ee Implement local-eval', local-compile', and `the-environment'
* module/ice-9/local-eval.scm: New module (ice-9 local-eval) which
  exports `the-environment', `local-eval', and `local-compile'.

* libguile/debug.c (scm_local_eval): New C function that calls the
  Scheme implementation of `local-eval' in (ice-9 local-eval).

* libguile/debug.h (scm_local_eval): Add prototype.

* doc/ref/api-evaluation.texi (Local Evaluation): Add documentation.

* test-suite/tests/eval.test (local evaluation): Add tests.

* test-suite/standalone/test-loose-ends.c (test_scm_local_eval):
  Add test.

* module/Makefile.am: Add ice-9/local-eval.scm.

Based on a patch by Mark H Weaver <mhw@netris.org>.
2012-01-26 12:08:58 +01:00
Mark H Weaver
1ceeca0a76 Add `scm_c_value_ref' to allow access to multiple returned values from C
Based on a patch by Julian Graham <julian@member.fsf.org>

* libguile/values.c, libguile/values.h (scm_c_value_ref): New function.
* doc/ref/api-control.texi (Multiple Values): Add documentation.
* test-suite/standalone/test-scm-values.c: New test program.
* test-suite/standalone/Makefile.am: Add test-scm-values test.
2012-01-18 18:01:48 -05:00
Ludovic Courtès
25dc93dd57 Avoid non-portable tail' argument in test-guile-snarf'.
* test-suite/standalone/test-guile-snarf (strip_first_line): New
  function.
  (snarf): Use it.
2012-01-14 22:25:59 +01:00
Andy Wingo
91ee7515da Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/__scm.h
	libguile/array-map.c
	libguile/procprop.c
	libguile/tags.h
	module/ice-9/deprecated.scm
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
	test-suite/standalone/test-num2integral.c
	test-suite/tests/regexp.test
2012-01-10 00:41:42 +01:00
Ludovic Courtès
002aab40bc Fix loose typing in `test-scm-spawn-thread.c'.
* test-suite/standalone/test-scm-spawn-thread.c (inner_main): Use
  `SCM2PTR' instead of a cast.
2012-01-09 21:23:46 +01:00
Andy Wingo
8f47877fc7 test-pthread-create-secondary: gc/gc.h, not gc/gc_version.h
* test-suite/standalone/test-pthread-create-secondary.c: Include
  gc/gc.h.  It works on libgc from git, and on 7.1.
2012-01-09 15:38:51 +01:00
Ludovic Courtès
20c360b298 Fix typo in `test-num2integral.c'.
* test-suite/standalone/test-num2integral.c (out_of_range_handler): Use
  `scm_is_eq' when comparing KEY.
2012-01-08 16:16:21 +01:00
Andy Wingo
296004b3ba Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/feature.c
	m4/gnulib-cache.m4
	module/ice-9/deprecated.scm
	module/language/tree-il/peval.scm
2011-12-19 18:00:28 +01:00
Ludovic Courtès
ed4c373966 Arrange to convert command-line arguments from the right encoding.
This is a temporary workaround for the 2.0 stable series.  The next
stable series should have an implicit `setlocale (LC_ALL, "")' call,
which will make this unnecessary.

* libguile/feature.c (progargs_fluid): Rename to...
  (scm_program_arguments_fluid): ... this.  Update users.

* libguile/feature.h (scm_program_arguments_fluid): New internal
  declaration.

* libguile/init.c (invoke_main_func): Call
  `scm_i_set_boot_program_arguments' instead of
  `scm_set_program_arguments'.

* libguile/script.c (locale_arguments_to_string_list,
  scm_i_set_boot_program_arguments): New functions.
  (scm_compile_shell_switches): Use `locale_arguments_to_string_list'.

* libguile/script.h (scm_i_set_boot_program_arguments): New internal
  declaration.

* test-suite/standalone/Makefile.am (check_SCRIPTS, TESTS): Add
  `test-command-line-encoding'.
* test-suite/standalone/test-command-line-encoding: New file.
2011-12-15 01:31:23 +01:00
Ludovic Courtès
c2c2b5a49b Use Gnulib's `localcharset', with local patches.
This follows Bruno Haible's suggestion at
<http://lists.gnu.org/archive/html/guile-devel/2011-11/msg00055.html>.

* m4/gnulib-cache.m4: Add `gl_LOCAL_DIR'; use `localcharset'.

* Makefile.am (EXTRA_DIST): Add gnulib-local/lib/localcharset.[ch].diff.
  (TESTS_ENVIRONMENT): New variable.

* gnulib-local/lib/localcharset.c.diff,
  gnulib-local/lib/localcharset.h.diff: New files.

* test-suite/Makefile.am (TESTS_ENVIRONMENT): Add
  @LOCALCHARSET_TESTS_ENVIRONMENT@.
* test-suite/standalone/Makefile.am (TESTS_ENVIRONMENT): Likewise.
2011-12-15 01:31:16 +01:00
Andy Wingo
a215c15913 Merge remote-tracking branch 'origin/stable-2.0'
Does not include psyntax regeneration.

Conflicts:
	module/ice-9/psyntax-pp.scm
	module/language/tree-il/peval.scm
	test-suite/tests/tree-il.test
2011-10-10 16:20:08 +02:00
Mike Gran
022dda6901 New functions scm_is_exact and scm_is_inexact
* doc/ref/api-data.texi (Exact and Inexact Numbers): doc for scm_is_exact
  and scm_is_inexact
* libguile/numbers.c (scm_is_exact, scm_is_inexact): new functions
* libguile/numbers.h: declarations for scm_is_exact and scm_is_inexact
* test/suite/standalone/test-conversion.c (test_is_exact, test_is_inexact):
  new tests
2011-10-09 20:54:37 -07:00
Andy Wingo
ca12824581 Merge remote-tracking branch 'origin/stable-2.0'
This was a pretty big merge involving a fair amount of porting,
especially to peval and its tests.  I did not update psyntax-pp.scm,
that comes in the next commit.

Conflicts:
	module/ice-9/boot-9.scm
	module/ice-9/psyntax-pp.scm
	module/language/ecmascript/compile-tree-il.scm
	module/language/tree-il.scm
	module/language/tree-il/analyze.scm
	module/language/tree-il/inline.scm
	test-suite/tests/tree-il.test
2011-09-29 18:02:28 +02:00
Andy Wingo
fe13364050 fix scm_to_latin1_stringn for substrings
* libguile/strings.c (scm_to_latin1_stringn): Fix for substrings.

* test-suite/standalone/Makefile.am:
* test-suite/standalone/test-scm-to-latin1-string.c: Add test case.

  Thanks to David Hansen for the bug report and test case, and Stefan
  Israelsson Tampe for the fix.
2011-09-10 11:38:25 -07:00
Andy Wingo
8a562c697b Merge remote-tracking branch 'local-2.0/stable-2.0'
Conflicts:
	libguile/deprecated.c
	module/ice-9/psyntax-pp.scm
2011-06-30 13:47:46 +02:00
Ludovic Courtès
134fe52a85 Placate GCC in `test-ffi-lib.c'.
This fixes warnings saying "this decimal constant is unsigned only in
ISO C90".

* test-suite/standalone/test-ffi-lib.c (test_ffi_u32_, test_ffi_u32_u8,
  test_ffi_u32_s64, test_ffi_s64_s64, test_ffi_u64_u8,
  test_ffi_u64_s64): Mark constants as unsigned.
2011-06-20 00:45:18 +02:00
Andy Wingo
a099c8d971 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/procprop.c
2011-05-25 10:32:19 +02:00
Andy Wingo
7ad0737de9 out-of-tree build fix
* test-suite/standalone/Makefile.am (GUILE_AUTO_COMPILE): Add srcdir to
  the environment.
* test-suite/standalone/test-import-order: Look for the modules in the
  srcdir.  Fixes out-of-tree builds.
2011-05-25 10:27:46 +02:00
Andy Wingo
ad4bd7c2c0 fix define-module ordering
* module/ice-9/boot-9.scm (define-module): Fix to load the #:use-module
  clauses in the order in which they appear in the define-module form.
  Thanks to Jan Nieuwenhuizen for the report.

* test-suite/standalone/test-import-order: Add new test that
  define-module and use-modules resolve the interface in the right
  order.

* test-suite/standalone/Makefile.am:
* test-suite/standalone/test-import-order-a.scm:
* test-suite/standalone/test-import-order-b.scm:
* test-suite/standalone/test-import-order-c.scm:
* test-suite/standalone/test-import-order-d.scm: Aux files.
2011-05-21 18:29:03 +02:00
Andy Wingo
4f1ce27a36 remove SCM_I_LLONG and SCM_I_ULLONG limit defines
* test-suite/standalone/test-num2integral.c (test_long_long):
  (test_ulong_long): Replace SCM_I_LLONG and SCM_I_ULLONG defines with
  their counterparts from limits.h.

* libguile/__scm.h: Remove SCM_I_LLONG and SCM_I_ULLONG limit defines.
2011-05-15 15:34:15 +02:00
Andy Wingo
6bc898466b fix type errors in test suite
* test-suite/standalone/test-num2integral.c (out_of_range_handler): Fix
  SCM used as a truth value.
* test-suite/standalone/test-scm-spawn-thread.c (inner_main): Use
  SCM2PTR here.
2011-05-15 15:34:14 +02:00
Ludovic Courtès
7c86abd9ce Use scm_with_guile' in test-pthread-create'.
* test-suite/standalone/test-pthread-create.c (inner_main): New
  function.
  (main): Call it within `scm_with_guile', instead of using
  `scm_init_guile'.  This improves portability--e.g.,
  `GC_get_stack_base', used by `scm_init_guile', failed on Darwin
  up to BDW-GC 7.1alpha4 included (thanks, Mark, for the hint.)
2011-04-25 23:59:42 +02:00
Ludovic Courtès
eb0ffdd819 Fix `#ifdef HAVE_CONFIG_H' stanza in some stand-alone tests.
* test-suite/standalone/test-asmobs-lib.c,
  test-suite/standalone/test-extensions-lib.c,
  test-suite/standalone/test-ffi-lib.c,
  test-suite/standalone/test-list.c,
  test-suite/standalone/test-num2integral.c,
  test-suite/standalone/test-with-guile-module.c: Change `#ifndef
  HAVE_CONFIG_H' to `#ifdef HAVE_CONFIG_H' (!).
2011-04-25 23:59:35 +02:00
Ludovic Courtès
4a23562339 Add pthread-related tests.
* test-suite/standalone/Makefile.am (test_scm_spawn_thread_CFLAGS,
  test_scm_spawn_thread_LDADD, test_pthread_create_CFLAGS,
  test_pthread_create_LDADD, test_pthread_create_secondary_CFLAGS,
  test_pthread_create_secondary_LDADD): New variables.
  (check_PROGRAMS)[BUILD_PTHREAD_SUPPORT]: Add `test-scm-spawn-thread',
  `test-pthread_create', `test-pthread_create-secondary'.
  (TESTS)[BUILD_PTHREAD_SUPPORT]: Likewise.

* test-suite/standalone/test-scm-spawn-thread.c,
  test-suite/standalone/test-pthread-create.c,
  test-suite/standalone/test-pthread-create-secondary.c: New files.
2011-04-25 16:45:24 +02:00
BT Templeton
95c1cfb550 fix guile-snarf
* libguile/snarf.h: New macro `SCM_SNARF_INIT_PREFIX'. (SCM_SNARF_INIT)
  Use `SCM_SNARF_INIT_PREFIX' instead of including a literal marker. If
  the preprocessor echoes #define directives to its output, this will
  prevent `guile-snarf' from snarfing the `SCM_SNARF_INIT' definition
  itself. Reported by Mike Gran <spk121@yahoo.com>.
* libguile/guile-snarf.in (modern_snarf): Don't output anything for
  lines in which only one of the magic snarfing markers is present.
  Modify the `sed' program for compatibility with POSIX `sed'. The new
  `sed' program is based on a version by Wolfgang Jenkner
  <wjenkner@inode.at>.
* test-suite/standalone/test-guile-snarf: New tests.
2011-03-20 10:22:44 +01:00
Andy Wingo
f80ed1be36 add multibyte regexp test
* test-suite/standalone/Makefile.am:
* test-suite/standalone/test-mb-regexp: New test, that the previous
  patch fixed the abort() on fixup_multibyte_match.
2011-03-17 18:53:11 +01:00
BT Templeton
fd029c35de guile-snarf: allow multiple init actions on one line
* libguile/guile-snarf.in (modern_snarf): Allow programs to specify
  multiple initialization actions on a single line. This makes it
  possible for C programs to define multiple subrs with a single macro
  invocation.

* test-suite/standalone/test-guile-snarf: Enable more tests.
2011-03-04 11:34:24 +01:00
BT Templeton
2dea6a4d33 add guile-snarf tests
* test-suite/standalone/test-guile-snarf: New file.
* test-suite/standalone/Makefile.am: Add `test-guile-snarf'.
2011-03-04 11:32:18 +01:00
Ludovic Courtès
6a94e6e1ae Link stand-alone tests against libgc.
Reported by Andreas Rottmann <a.rottmann@gmx.at>.

* test-suite/standalone/Makefile.am (LIBGUILE_LDADD): New variable.
  (test_num2integral_LDADD, test_round_LDADD, libtest_asmobs_la_LIBADD,
  libtest_ffi_la_LIBADD, test_list_LDADD, test_unwind_LDADD,
  test_conversion_LDADD, test_loose_ends_LDADD, test_scm_c_read_LDADD,
  test_scm_take_locale_symbol_LDADD, test_scm_take_u8vector_LDADD,
  libtest_extensions_la_LIBADD, test_with_guile_module_LDADD,
  test_scm_with_guile_LDADD): Use it.
2011-02-28 00:40:45 +01:00
Ludovic Courtès
d6cf96974e Use #ifdef HAVE_...', not #if'.
* test-suite/standalone/test-round.c (test_scm_c_round): Use `#ifdef
  HAVE_FESETROUND', not `#if'.
2011-02-02 18:06:28 +01:00