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

52 commits

Author SHA1 Message Date
Andy Wingo
5270a001ad an experiment: clearing the C stack in gc tests
* test-suite/lib.scm (clear-stale-stack-references): New helper.
* test-suite/tests/gc.test:
* test-suite/tests/threads.test: Use the new helper.

I removed the "unresolved" throw, as I'd like to see what the bots do
with this.
2012-01-31 17:57:13 +01:00
Ludovic Courtès
b3da54d181 Placate a number of `syntax-check' verifications.
- "filesystem" -> "file system"
  - remove doubled words
  - use EXIT_* macros instead of literal numbers
  - update `syntax-check' exclusion files
2012-01-05 23:38:10 +01:00
Andy Wingo
9447207f0c Use default value for make-fluid in Scheme files
* module/ice-9/boot-9.scm (%exception-handler)
  (%running-exception-handlers, read-eval?, *repl-stack*)
  (make-mutable-parameter):
* module/ice-9/getopt-long.scm (%program-name):
* module/language/elisp/runtime.scm (built-in-macro, defspecial):
* module/srfi/srfi-39.scm (make-parameter/helper):
* module/system/base/language.scm (*current-language*):
* module/system/base/message.scm (*current-warning-port*):
  (*current-warning-prefix*):
* module/system/base/target.scm (%target-type, %target-endianness)
  (%target-word-size):
* module/texinfo/plain-text.scm (*indent*, *itemizer*):
* benchmark-suite/lib.scm (prefix-fluid):
* test-suite/lib.scm (prefix-fluid): Give fluids a useful default
  value.
2011-11-23 12:54:09 +01:00
Neil Jerram
679cceeda4 Misc textual editing
* doc/ref/api-scheduling.texi (Asyncs): "queueing" -> "queuing".

* benchmark-suite/lib.scm, doc/sources/unix.texi (Unix conventions),
  test-suite/lib.scm: "postpend" -> "append".

* doc/ref/api-compound.texi (Array Syntax, Dictionary Types),
  doc/ref/api-control.texi (Catch), doc/ref/api-data.texi (Complex
  Numbers, Conversion, Random, Symbol Props, Symbol Uninterned),
  doc/ref/api-options.texi (Build Config, Common Feature Symbols),
  doc/ref/api-regex.texi (Match Structures),
  doc/ref/api-undocumented.texi, doc/ref/compiler.texi (Tree-IL,
  GLIL), doc/ref/data-rep.texi (Immediate objects), doc/ref/goops.texi
  (Slot Description Example), doc/ref/history.texi (A Scheme of Many
  Maintainers, Status), doc/ref/libguile-program.texi (Available
  Functionality), doc/ref/misc-modules.texi (Formatted Output),
  doc/ref/mod-getopt-long.texi (getopt-long Reference),
  doc/ref/posix.texi (Network Socket Address, Network Sockets and
  Communication), doc/ref/srfi-modules.texi (SRFI-1 Association Lists,
  SRFI-10, SRFI-19 String to date, SRFI-27 Random Sources),
  doc/ref/vm.texi (Instruction Set, Top-Level Environment
  Instructions, Procedure Call and Return Instructions),
  doc/sources/unix.texi (Unix conventions): Correct spacing after
  "i.e." and "e.g.".
2011-02-13 22:13:33 +00:00
Ludovic Courtès
cc540d0bbd Have `scm_getc' honor the port's conversion strategy.
* libguile/ports.c (get_codepoint): Reset `pt->input_cd' upon failure.
  If `pt->ilseq_handler' is `SCM_ICONVEH_QUESTION_MARK', then return a
  question mark.
  [failure]: Use `scm_encoding_error' when raising an error.

* test-suite/lib.scm (exception:encoding-error): Adjust regexp.

* test-suite/tests/ports.test ("string ports")["read-char, wrong
  encoding, error", "read-char, wrong encoding, escape", "read-char,
  wrong encoding, substitute"]: New tests.
2011-01-26 00:29:51 +01:00
Ludovic Courtès
fb032fa722 Move with-test-prefix/c&e' to (test-suite lib)'.
* test-suite/tests/bytevectors.test (c&e, with-test-prefix/c&e): Move...
* test-suite/lib.scm: ... here.
  (with-test-prefix): Rewrite using `syntax-rules'.
2010-11-19 13:34:43 +01:00
Andy Wingo
3932bdb3af remove a number of debug options
* libguile/private-options.h (SCM_BREAKPOINTS_P, SCM_TRACE_P)
  (SCM_REC_PROCNAMES_P, SCM_BACKTRACE_INDENT, SCM_N_FRAMES)
  (SCM_BACKTRACE_MAXDEPTH, SCM_DEVAL_P): Remove these internal names.

* libguile/eval.c (scm_debug_opts): Remove the corresponding debug
  options -- breakpoints, trace, procnames, indent, frames, maxdepth,
  and debug.

* libguile/debug.c (scm_debug_options): Remove SCM_N_FRAMES check.

* test-suite/lib.scm (with-debugging-evaluator*):
* module/scripts/summarize-guile-TODO.scm:
* module/statprof.scm (statprof-reset):
* module/ice-9/boot-9.scm (turn-on-debugging): Remove useless
  debug-enable 'debug calls.

* module/ice-9/deprecated.scm (debug-enable): As it seems that 'debug is
  a particulatly common option that we just removed, add a deprecation
  shim.

* doc/ref/api-options.texi (Debugger options): Update the set of debug
  options.
2010-09-24 20:57:01 +02:00
Ludovic Courtès
f1046e6b78 Raise an exception upon VM stack overflows (fixes bug #29574).
* libguile/vm-engine.c (VM_NAME)[vm_error_stack_overflow]: Increase
  `vp->stack_limit' when possible.

* libguile/vm.c (VM_STACK_RESERVE_SIZE): New macro.

* test-suite/lib.scm (exception:vm-error): New variable.

* test-suite/tests/eval.test ("stack overflow"): New test prefix.
2010-05-26 23:41:23 +02:00
Ludovic Courtès
01ad5a7ba9 Raise an error when attempting to modify the value of `%null-pointer'.
* libguile/foreign.c (sym_null_pointer_error): New variable.
  (null_pointer_error): New function.
  (scm_foreign_set_x): Raise an error if attempting to modify
  NULL_POINTER.
  (scm_foreign_to_bytevector): Use `null_pointer_error ()' instead of
  `scm_misc_error ()'.

* test-suite/tests/foreign.test: New file.

* test-suite/Makefile.am (SCM_TESTS): Add tests/foreign.test.

* test-suite/lib.scm (exception:null-pointer-error): New variable.
2010-04-09 00:32:15 +02:00
Ludovic Courtès
c45de346fd Move Latin-1 locale fiddling to `(test-suite lib)'.
* test-suite/lib.scm (with-latin1-locale*): New procedure.
  (with-latin1-locale): New macro.

* test-suite/tests/bytevectors.test (with-locale, with-latin1-locale):
  Remove.  Adjust users.
2010-03-04 00:39:18 +01:00
Ludovic Courtès
f5147c84a2 Fix with-locale*' in (test-suite lib)'.
* test-suite/lib.scm (with-locale*): Set LOC to the previous locale
  name, not to the new locale name.  Only restore LOC when it's not #f.
  (with-locale): Use `syntax-rules'.
2010-03-03 23:57:50 +01:00
Ludovic Courtès
30a700c8c1 Inline SRFI-9 constructors too.
* module/srfi/srfi-9.scm (define-record-type)[constructor]: Use
  `define-inlinable' instead of `define'.

* test-suite/lib.scm (exception:syntax-pattern-unmatched): New variable.

* test-suite/tests/srfi-9.test ("constructor")["foo 0 args (inline)",
  "foo 2 args (inline)"]: New tests.
  ["foo 0 args", "foo 2 args"]: Adjust to constructor inlining.

* testsuite/t-records.scm: Remove wrong-arg-count case.
2010-02-01 00:25:51 +01:00
Ludovic Courtès
a3d7d5d508 Use encoding-error' instead of misc-error' for string encoding errors.
* libguile/strings.c (scm_encoding_error): New function.
  (scm_from_stringn, scm_to_stringn): Use it instead of `scm_misc_error ()'.

* test-suite/lib.scm (exception:encoding-error): Adjust accordingly.

* test-suite/tests/encoding-escapes.test (exception:conversion):
  Remove.  Use `exception:encoding-error' instead.

* test-suite/tests/encoding-iso88591.test: Likewise.

* test-suite/tests/encoding-iso88597.test: Likewise.

* test-suite/tests/encoding-utf8.test: Likewise.
2010-01-07 11:10:35 +01:00
Ludovic Courtès
7b0419128b Have string ports honor `%default-port-encoding'.
* libguile/strports.c (scm_i_mkstrport): Remove.
  (scm_mkstrport): Don't change the port's encoding to UTF-8; convert
  STR to the default port encoding.
  (scm_strport_to_string): Fix documentation & indentation.

* libguile/strports.h (scm_i_mkstrport): Remove.

* test-suite/lib.scm (exception:encoding-error): New variable.
  (format-test-name): Set `%default-port-encoding' to "UTF-8".

* test-suite/tests/ports.test ("string ports")["%default-port-encoding
  is honored", "suitable encoding [latin-1]", "suitable encoding
  [latin-3]", "wrong encoding"]: New tests.

* test-suite/tests/r6rs-ports.test ("7.2.11 Binary
  Output")["put-bytevector with UTF-16 string port", "put-bytevector
  with wrong-encoding string port"]: New tests.

* test-suite/tests/reader.test (read-string): Set
  `%default-port-encoding' to `#f'.
  ("reading")["unprintable symbol"]: Use a string that doesn't contain
  zeros.

* doc/ref/api-io.texi (String Ports): Document encoding issues with
  `call-with-output-string' and `with-output-to-string'.
2010-01-07 11:10:35 +01:00
Michael Gran
ce3ed0125f Don't presume existence or success of setlocale in test-suite
* test-suite/lib.scm (with-locale, with-locale*): new test functions

* test-suite/tests/encoding-escapes: don't fail if en_US.utf8 doesn't exist

* test-suite/tests/encoding-iso88591.test: set and restore locale, if
  possible

* test-suite/tests/encoding-iso88597.test: set and restore locale, if
  possible

* test-suite/tests/encoding-utf8.test: set and restore locale, if possible

* test-suite/tests/srfi-14.test: don't need to setlocale to Latin-1 to
  test Latin-1 since string conversion is handled at read/compile time.
  Set and restore locale, if possible.
2009-08-28 06:27:00 -07:00
Ludovic Courtès
0ba0b38489 Implement R6RS bytevector read syntax.
* libguile/read.c (scm_read_bytevector): New function.
  (scm_read_sharp): Add `v' case for bytevectors.

* test-suite/lib.scm (exception:read-error): New variable.

* test-suite/tests/bytevectors.test ("Datum Syntax"): New test set.
2009-06-19 00:47:11 +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
Andy Wingo
ce09ee1989 add tree-il->glil compilation test suite
* module/language/tree-il.scm (parse-tree-il): Fix a number of bugs.
  (unparse-tree-il): Apply takes rest args now.

* module/language/tree-il/analyze.scm (analyze-lexicals)
  (analyze-lexicals): Heap vars shouldn't increment the number of locals.

* module/language/tree-il/optimize.scm (resolve-primitives!): Don't
  resolve public refs to primitives, not at the moment anyway.

* test-suite/Makefile.am (SCM_TESTS): Add tree-il test.

* test-suite/lib.scm (pass-if, expect-fail, pass-if-exception)
  (expect-fail-exception): Rewrite as syntax-rules macros. In a very
  amusing turn of events, it turns out that bindings introduced by
  hygienic macros are not visible inside expansions produced by
  defmacros. This seems to be expected, so go ahead and work around the
  problem.

* test-suite/tests/srfi-31.test ("rec special form"): Expand in eval.

* test-suite/tests/syntax.test ("begin"): Do some more expanding in eval,
  though all is not yet well.

* test-suite/tests/tree-il.test: New test suite, for tree-il->glil
  compilation.
2009-05-18 23:45:35 +02: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
Ludovic Courtès
a1ef740636 Changes from arch/CVS synchronization 2007-06-07 08:36:13 +00:00
Kevin Ryde
970aac161b (exception:string-contains-nul): New exception pattern. 2007-01-18 23:10:13 +00:00
Ludovic Courtès
d15ad007c9 Changes from arch/CVS synchronization 2006-06-13 07:48:42 +00:00
Kevin Ryde
6e7d5622ee merge from 1.8 branch 2006-04-16 23:37:40 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Marius Vollmer
a47d845fd4 (exception:out-of-range, exception:wrong-type-arg):
Accept new wording.
2004-09-23 17:57:55 +00:00
Marius Vollmer
0ac467456b * lib.scm (exception:used-before-define): New.
* tests/syntax.test ("letrec"): Use it.
2004-08-23 10:48:51 +00:00
Kevin Ryde
0825ae0b5b (exception:numerical-overflow): New define. 2004-05-29 22:09:52 +00:00
Dirk Herrmann
d6754c2398 * libguile/eval.c (scm_m_let, scm_m_letstar, scm_m_letrec,
scm_m_expand_body, check_bindings): Extracted syntax checking of
	bindings to new static function check_bindings.

	(scm_m_let, memoize_named_let): Extracted handling of named let to
	new static function memoize_named_let.

	(transform_bindings, scm_m_let, scm_m_letstar, scm_m_letrec): Use
	ASSERT_SYNTAX to signal syntax errors.  Be more specific about the
	kind of error that was detected.  Avoid use of SCM_CDRLOC.  Avoid
	unnecessary consing when creating the memoized code.

	* test-suite/lib.scm (exception:bad-variable): New.

	* test-suite/tests/syntax.test (exception:bad-binding,
	exception:duplicate-binding): New.

	(exception:duplicate-bindings): Removed.

	Adapted tests for 'let', 'let*' and 'letrec' to the new way of
	error reporting.
2003-10-18 12:07:39 +00:00
Dirk Herrmann
e6729603c0 * libguile/eval.c (s_bad_expression, syntax_error_key, syntax_error,
ASSERT_SYNTAX, ASSERT_SYNTAX_2): New static identifiers.

	(scm_m_and): Use ASSERT_SYNTAX to signal syntax errors.  Avoid
	unnecessary consing when creating the memoized code.

	* test-suite/lib.scm (run-test-exception): Handle syntax errors.
2003-10-10 21:49:27 +00:00
Dirk Herrmann
d6e04e7c4a * lib.scm (exception:missing-expression): New.
* tests/dynamic-scope.test, tests/eval.test,
	tests/r5rs_pitfall.test, tests/srfi-17.test, tests/syncase.test:
	Wrap tests in module (test-suite test-<file-name without .test>),
	following a practice that was used on a couple of files already.

	* tests/dynamic-scope.test (exception:duplicate-binding,
	exception:bad-binding): New.

	* tests/dynamic-scope.test, tests/srfi-17.test, tests/syntax.test:
	Execute syntactically wrong tests using eval.  With the upcoming
	new memoizer this is necessary in order to postpone the syntax
	check to the actual evaluation of the syntactically wrong form.

	* tests/syntax.test: Added some test cases and modified one test
	case.
2003-10-07 22:00:05 +00:00
Dirk Herrmann
e46083d5c5 * lib.scm: Documented the short form for pass-if and expect-fail.
(pass-if, expect-fail): Simplified.
2003-05-30 10:35:05 +00:00
Rob Browning
b4690a661e * lib.scm (pass-if): allow really simple tests where the test code
is also the name like (pass-if (even? 2)).
(expect-fail): allow really simple tests where the test code is
also the test name like (expect-fail (even? 2)).
2003-03-25 02:21:03 +00:00
Mikael Djurfeldt
1a179b03b0 * lib.scm: Move module the system directives `export',
`export-syntax', `re-export' and `re-export-syntax' into the
  `define-module' form.  This is the recommended way of exporting
  bindings.

* srfi-2.scm, srfi-4.scm, srfi-8.scm, srfi-9.scm, srfi-10.scm,
srfi-11.scm, srfi-14.scm, srfi-16.scm: Move module the system
directives `export', `export-syntax', `re-export' and
`re-export-syntax' into the `define-module' form.  This is the
recommended way of exporting bindings.

* goops.scm, goops/active-slot.scm, goops/compile.scm,
goops/composite-slot.scm, goops/describe.scm, goops/dispatch.scm,
goops/old-define-method.scm, goops/save.scm, goops/util.scm: Move
module the system directives `export', `export-syntax',
`re-export' and `re-export-syntax' into the `define-module' form.
This is the recommended way of exporting bindings.

* slib.scm (array-indexes): New procedure.
(*features*): Extend.  (Probably some of these options should be
set elsewhere.)  (Thanks to Aubrey Jaffer.)

* and-let-star-compat.scm, and-let-star.scm, calling.scm,
  channel.scm, common-list.scm, debug.scm, debugger.scm,
  expect.scm, hcons.scm, lineio.scm, ls.scm, mapping.scm,
  null.scm, optargs.scm, poe.scm, popen.scm, pretty-print.scm,
  q.scm, r5rs.scm, rdelim.scm, regex.scm, runq.scm, safe-r5rs.scm,
  safe.scm, session.scm, slib.scm, streams.scm, string-fun.scm,
  syncase.scm, threads.scm: Move module the system directives
  `export', `export-syntax', `re-export' and `re-export-syntax'
  into the `define-module' form.  This is the recommended way of
  exporting bindings.
2001-10-21 09:49:19 +00:00
Thien-Thi Nguyen
bba2d1908a (run-test-exception): Add special handling for
`error'-generated exceptions, which pass key
`misc-error' and leave messages unformatted.
2001-08-01 09:57:01 +00:00
Martin Grabmüller
96e30d2ab2 * tests/alist.test, tests/bit-operations.test,
tests/common-list.test, tests/environments.test, tests/eval.test,
	tests/gc.test, tests/hooks.test, tests/import.test,
	tests/interp.test, tests/list.test, tests/load.test,
	tests/numbers.test, tests/ports.test, tests/r4rs.test,
	tests/version.test, tests/weaks.test, lib.scm, guile-test: Updated
	copyright notice.
2001-07-19 20:30:37 +00:00
Dirk Herrmann
8bc4547c4e * Preserve the original error's stack for re-throwing. 2001-03-05 11:05:02 +00:00
Dirk Herrmann
08c608e10a * extracted the tests from exceptions.test into eval.test and syntax.test.
* added a few test cases.
2001-03-02 01:38:01 +00:00
Dirk Herrmann
88f9ab70d0 * Removed old system to check for exceptions. 2001-02-28 11:48:18 +00:00
Dirk Herrmann
6b4113afc5 * Provide and use new convenience macros to test for exceptions. 2001-02-28 11:25:40 +00:00
Dirk Herrmann
5c96bc39a4 * Make sure that tests return a boolean value. 2001-02-28 08:41:06 +00:00
Dirk Herrmann
ac6849ffee * Cleaned up export list. 2001-02-27 11:10:07 +00:00
Dirk Herrmann
efb07c899c * Fixed things that I had broken with the last patch :-( 2001-01-26 16:49:28 +00:00
Dirk Herrmann
6ad9007abf * lib.scm (pass-if, expect-fail): Generalized.
* * tests/eval.test:  Fixed documentation test.
2000-08-21 08:57:11 +00:00
Dirk Herrmann
57e7f27001 Adopted a couple of nice ideas from Greg. 2000-05-08 17:42:03 +00:00
Jim Blandy
05c4ba0055 * lib.scm: Doc fixes. 2000-03-22 21:18:57 +00:00
Jim Blandy
5f2125be10 Doc fix. 1999-09-20 23:57:44 +00:00
Jim Blandy
69c74140dd * lib.scm (signals-error?, signals-error?*): New macro and function.
* tests/reader.test: Use them.
1999-09-11 18:46:32 +00:00
Jim Blandy
474d9afb8b * lib.scm: Import (test-suite paths).
(data-file): New exported function.
1999-06-15 08:39:39 +00:00
Jim Blandy
5157b4a518 * lib.scm (print-counts): XFAILS are "expected failures", not
"unexpected failures."
1999-06-09 09:41:54 +00:00
Jim Blandy
29055e0647 * lib.scm (full-reporter): The test name is the cadr of the
result, not the cdr.  I'm not macho enough to handle run-time
typechecking.
1999-06-09 08:57:23 +00:00