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

183 commits

Author SHA1 Message Date
Mark H Weaver
28d5d2537c Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/keywords.c
	libguile/vm.c
2013-07-16 01:33:27 -04:00
Ludovic Courtès
556d35af88 tests: Don't rely on $TMPDIR and /tmp on Windows.
* test-suite/standalone/test-unwind.c (check_ports)[__MINGW32__]: Use
  $TEMP, $TMP, or / as the value for TMPDIR.
  Patch by Eli Zaretskii <eliz@gnu.org>.
2013-06-16 16:42:01 +02:00
Ludovic Courtès
b518c6a0b3 tests: Use double quotes around shell arguments, for Windows.
* test-suite/standalone/test-system-cmds (test-system-cmd): Use double
  quotes around shell arguments.
  Reported by Eli Zaretskii <eliz@gnu.org>.
2013-06-16 16:39:14 +02:00
Mark H Weaver
8b12a34c8f Fix tests for 'scm_c_bind_keyword_arguments'.
* test-suite/standalone/test-scm-c-bind-keyword-arguments.c (error_handler):
  Remove function.
  (unrecognized_keyword_error_handler, invalid_keyword_error_handler,
  odd_length_error_handler): New functions.
  (test_scm_c_bind_keyword_arguments): Use new error handler functions.
2013-06-10 02:29:05 -04:00
Ludovic Courtès
72d4abda1d tests: Use shell constructs that /bin/sh on Solaris 10 can understand.
Partly fixes <http://bugs.gnu.org/14042>.
Reported by Marc Girod <marc.girod@gmail.com>

* test-suite/standalone/test-language: Use a shell construct that
  /bin/sh on Solaris 10 can understand.
2013-04-14 15:46:56 +02:00
Mark H Weaver
f6f4feb0a2 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	GUILE-VERSION
	libguile/array-map.c
	libguile/fports.h
	libguile/gc.h
	libguile/inline.h
	libguile/ports.c
	libguile/ports.h
	libguile/print.c
	libguile/r6rs-ports.c
	libguile/read.c
	test-suite/tests/00-socket.test
2013-04-14 02:48:33 -04:00
Mark H Weaver
3e5a164ac3 Fix indentation in test-scm-c-bind-keyword-arguments.c.
* test-suite/standalone/test-scm-c-bind-keyword-arguments.c
  (test_invalid_keyword): Fix indentation.
2013-04-06 18:13:04 -04:00
Mark H Weaver
a16d4e82e9 Implement 'scm_c_bind_keyword_arguments'.
* libguile/keywords.c (scm_keyword_argument_error): New variable.
  (scm_c_bind_keyword_arguments): New API function.

* libguile/keywords.h (enum scm_keyword_arguments_flags): New enum.
  (scm_t_keyword_arguments_flags): New typedef.
  (scm_c_bind_keyword_arguments): New prototype.

* doc/ref/api-data.texi (Coding With Keywords, Keyword Procedures): Add
  documentation.

* test-suite/standalone/test-scm-c-bind-keyword-arguments.c: New file.

* test-suite/standalone/Makefile.am: Add
  test-scm-c-bind-keyword-arguments test.
2013-04-06 18:09:45 -04:00
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