summaryrefslogtreecommitdiff
path: root/test-suite/tests
AgeCommit message (Collapse)AuthorFilesLines
2012-01-29paper over some "lexical vars are collectable" flakinessAndy Wingo1-11/+23
* test-suite/tests/gc.test ("gc"): Hack around flakiness in "lexical vars are collectable" on some architectures.
2012-01-26Implement `local-eval', `local-compile', and `the-environment'Andy Wingo1-2/+93
* 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-26Add warnings for unsupported `simple-format' options.Ludovic Courtès1-26/+55
* module/language/tree-il/analyze.scm (format-analysis)[check-simple-format-args]: New procedure. Use it. Add support for applications of <module-ref>. * module/system/base/message.scm (%warning-types): Handle the `format simple-format' warning. * module/language/scheme/spec.scm (scheme)[make-default-environment]: Use `simple-format' as the default `format'. * test-suite/tests/tree-il.test ("warnings")["format"]: Explicitly use (@ (ice-9 format) format) where needed. ("simple-format"): New test prefix.
2012-01-25fix "lexical vars are collectable" testAndy Wingo1-3/+6
* test-suite/tests/gc.test ("gc"): Fix "lexical vars are collectable" test. (Previously, the binding was getting inlined, so we weren't testing what we meant to test. Besides that, the value was a constant, not a closure, so it wasn't collectable in the first place!)
2012-01-25fix values miscompilation in push context with RAAndy Wingo1-2/+19
* module/language/tree-il/compile-glil.scm (flatten-lambda-case): Fix miscompilation of `values' in a push context with RA. * test-suite/tests/tree-il.test: Add low-level test for this miscompilation.
2012-01-23FFI: Fix `set-pointer-finalizer!' to leave the type cell unchanged.Ludovic Courtès1-1/+7
This is a followup to 690a0112e55823aa8b862daeddcf44cea97e7917 ("Remove the "has finalizer?" bit from pointer objects.") * libguile/foreign.c (scm_set_pointer_finalizer_x): Leave the type cell unchanged. Before, `equal?' would break on pointers on which `set-pointer-finalizer!' had been called. * test-suite/tests/foreign.test ("make-pointer")["equal? modulo finalizer (set-pointer-finalizer!)"]: New test.
2012-01-23Adjust tests that relied on the output of the hash table printer.Ludovic Courtès1-8/+11
* libguile/hashtab.c (scm_i_hashtable_print): Use `SCM_UNPACK', not `SCM2PTR'. * test-suite/tests/hash.test: Adjust tests that rely on the output of the printer to just check for the suffix of the hash table's external representation.
2012-01-22Relax `asm-to-bytecode.test' for when target CPU == native CPU.Ludovic Courtès1-2/+18
* test-suite/tests/asm-to-bytecode.test (native-cpu, native-word-size): New procedures. (test-target): When the target is the native CPU, use the native word size instead of WORD-SIZE.
2012-01-16Skip `tr_TR' tests on Solaris 2.10.Ludovic Courtès1-3/+5
* test-suite/tests/i18n.test (under-turkish-utf8-locale-or-unresolved): Special-case Solaris 2.10.
2012-01-14Have `statprof.test' fail gracefully when samples could not be collected.Ludovic Courtès1-24/+30
* test-suite/tests/statprof.test ("statistical sample counts within expected range"): Throw unresolved when one of A-DATA, B-DATA, and C-DATA is #f, which means samples were not collected for this one.
2012-01-12Disable statprof tests on platforms that lack `ITIMER_PROF' support.Ludovic Courtès1-2/+16
* test-suite/tests/statprof.test (when-implemented): New macro. ("statistical sample counts within expected range", "accurate call counting"): Use it.
2012-01-10Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo9-25/+189
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-10Merge commit 'f78a1ccede02ccad89d6c91a6b297f1f14a30907'Andy Wingo5-18/+125
2012-01-10Merge commit 'cc8afa2b361635953dfba7f10e4193b1f243a50f'Andy Wingo3-3/+21
Conflicts: module/ice-9/psyntax-pp.scm module/language/tree-il/peval.scm
2012-01-09Make sure `regexp-quote' tests use Unicode-capable string ports.Ludovic Courtès1-3/+12
* test-suite/tests/regexp.test (with-unicode): New macro. ("regexp-quote"): Wrap all `regexp-quote' calls in it. This fixes tests on machines where the default port encoding is US-ASCII.
2012-01-09i18n: Disable Turkish locale tests on FreeBSD 8.Ludovic Courtès1-2/+6
* test-suite/tests/i18n.test (under-turkish-utf8-locale-or-unresolved): Check %HOST-TYPE and throw `unresolved' on FreeBSD 8.
2012-01-09primitive-load returns the value(s) of the last expressionAndy Wingo1-3/+17
* libguile/load.c (scm_primitive_load): Return the values yielded from evaluating the last expression in the file. * test-suite/tests/load.test ("return value of `load'"): Add tests.
2012-01-08ftw: Add an `error' parameter to `file-system-fold'.Ludovic Courtès1-9/+138
* module/ice-9/ftw.scm (errno-if-exception): New macro. (file-system-fold): Add an `error' parameter. Wrap `opendir' and STAT calls in `errno-if-exception' and call ERROR when appropriate. (file-system-tree): Provide an `error' procedure. Return #f when FILE-NAME is unreadable. (scandir): Provide an `error' procedure. * test-suite/tests/ftw.test (%top-builddir): New variable. (make-file-tree, delete-file-tree): New procedures. (with-file-tree): New macro. ("file-system-fold"): Update tests to add an `error' procedure. ["ENOENT", "EACCES", "dangling symlink and lstat", "dangling symlink and stat"]: New tests. ("file-system-tree")["ENOENT"]: New test. ("scandir")["EACCES"]: New test. * doc/ref/misc-modules.texi (File Tree Walk): Update `file-system-fold' documentation.
2012-01-05Fix the exception type of the (begin) test.Ludovic Courtès1-3/+5
* test-suite/tests/syntax.test (exception:zero-expression-sequence): New variable. ("begin")["legal (begin)"]: Rename to "valid (begin)". ["illegal (begin)"]: Ditto. Expect `exception:zero-expression-sequence'.
2012-01-05Placate a number of `syntax-check' verifications.Ludovic Courtès3-3/+3
- "filesystem" -> "file system" - remove doubled words - use EXIT_* macros instead of literal numbers - update `syntax-check' exclusion files
2012-01-05Fix erroneous check in `set-procedure-properties!'.Ludovic Courtès1-2/+8
* libguile/procprop.c (scm_set_procedure_properties_x)[SCM_ENABLE_DEPRECATED == 1]: Pass arguments to `scm_assq' in the right order, and check its return value with `scm_is_true'. Reported by Mike Gran <spk121@yahoo.com>.
2012-01-05Raise an error for (begin) when `--disable-deprecated'.Ludovic Courtès1-3/+4
* module/ice-9/psyntax.scm (define-expansion-constructors)[begin-form]: Emit a syntax-violation error for empty sequences when --disable-deprecated. * test-suite/tests/syntax.test (pass-if-syntax-error): Fix typo in error message.
2012-01-04Rework c-api.test to use test libMike Gran1-13/+14
The failure path for the c-api.test had been to call the undefined function 'fail', instead of logging the error like the other tests. * test-suite/tests/c-api.test: modified
2011-12-22New array-map! and array-for-each testsDaniel Llorens1-1/+72
* ramap.test: New tests. - array-map! with noncompact arrays and more than one argument. - array-for-each with noncompact arrays and more than two arguments.
2011-12-22fix generalized-vector-{ref,set!} for slicesAndy Wingo1-1/+17
* libguile/generalized-vectors.c (scm_c_generalized_vector_ref): (scm_c_generalized_vector_set_x): Fix for the case in which base was not 1, lbnd was not 0, or inc was not 1. * test-suite/tests/arrays.test (array): Add a test. Thanks to Daniel Llorens for the report.
2011-12-22HTTP: Fix qstring writing of cache-extension valuesAndy Wingo1-0/+16
* module/web/http.scm ("Cache-Control"): Write string values using the default val writer, to get quoting correct. * test-suite/tests/web-http.test (pass-if-round-trip): New helper. ("general headers"): Check that cache-extensions round trip properly.
2011-12-22Extend handling of "Cache-Control" header.Daniel Hartwig1-0/+2
* module/web/http.scm ("Cache-Control"): Value for `max-stale' is optional. Strict validation for value-less directives (`no-store', etc.). String values optional for "cache-extension" directives. * test-suite/tests/web-http.test: Value for `max-stale' is optional.
2011-12-21peval fix: (cons 1 #nil) is not (list 1)Andy Wingo1-0/+5
* module/language/tree-il/peval.scm (peval): (cons FOO #nil) is not (cons FOO '()). * test-suite/tests/tree-il.test ("partial evaluation"): Add a test.
2011-12-21document invalidity of (begin) as expression; add back-compat shimAndy Wingo1-3/+4
* doc/ref/api-control.texi (begin): Update to distinguish between splicing begin and sequencing begin. * module/ice-9/psyntax.scm (expand-expr): Add a back-compatibility shim for `(begin)'. * module/ice-9/psyntax-pp.scm: Regenerate. * test-suite/tests/syntax.test: Update to run illegal (begin) test only if we are not including deprecated features.
2011-12-19ftw: Include sub-directories in the result of `scandir'.Ludovic Courtès1-0/+12
* module/ice-9/ftw.scm (scandir)[skip]: Keep NAME in the resulting list. * test-suite/tests/ftw.test ("scandir")["top-srcdir"]: New test.
2011-12-19Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo2-7/+112
Conflicts: libguile/feature.c m4/gnulib-cache.m4 module/ice-9/deprecated.scm module/language/tree-il/peval.scm
2011-12-19ftw: Clarify the behavior of `scandir' for flat files and unreadable dirs.Ludovic Courtès1-1/+4
* module/ice-9/ftw.scm (scandir)[leaf]: Only add NAME when RESULT is a pair. [down]: Ignore RESULT. Start with #f instead of the empty list. * test-suite/tests/ftw.test ("scandir")["flat file"]: New test. * doc/ref/misc-modules.texi (File Tree Walk): Update `scandir' documentation accordingly.
2011-12-18ftw: Add `scandir'.Ludovic Courtès1-0/+8
Suggested by Nala Ginrut <nalaginrut@gmail.com>. * module/ice-9/ftw.scm (scandir): New procedure. * test-suite/tests/ftw.test ("scandir"): New test prefix. * doc/ref/misc-modules.texi (File Tree Walk): Document `scandir'.
2011-12-13Add `file-system-fold' and `file-system-tree' to (ice-9 ftw).Ludovic Courtès1-2/+96
* module/ice-9/ftw.scm (file-system-fold, file-system-tree): New procedures. * test-suite/tests/ftw.test (%top-srcdir, %test-dir): New variables. ("file-system-fold", "file-system-tree"): New test prefixes. * doc/ref/misc-modules.texi (File Tree Walk): Document `file-system-tree' and `file-system-fold'.
2011-12-13Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo2-0/+78
Conflicts: configure.ac
2011-12-10current-input-port et al are srfi-39 parametersAndy Wingo1-0/+61
* libguile/ports.c (scm_init_ports): Export the port fluids to Scheme, temporarily. * module/ice-9/boot-9.scm (fluid->parameter): Turn `current-input-port' et al into srfi-39 parameters, backed by the exported fluids, then remove the fluids from the guile module. (%cond-expand-features): Add srfi-39. * module/srfi/srfi-39.scm: Re-export features from boot-9. * test-suite/tests/parameters.test: Add tests.
2011-12-06peval: Truncate multiple values when extending the environment.Ludovic Courtès1-0/+17
Reported by Cédric Cellier <rixed@happyleptic.org>. * module/language/tree-il/peval.scm (truncate-values): New procedure. (make-operand): Call `truncate-values' SOURCE. * test-suite/tests/tree-il.test ("partial evaluation"): New tests for multiple value truncation.
2011-12-06Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo2-2/+86
Conflicts: libguile/deprecation.c libguile/load.c libguile/print.c
2011-12-06fix asm-to-bytecode.testAndy Wingo1-4/+3
* test-suite/tests/asm-to-bytecode.test (%objcode-cookie-size) (test-target): The objcode version embedded in the cookie is not an effective version, so elide it from the test.
2011-12-06allow URIs of the form file:///etc/hostsAndy Wingo1-2/+17
* module/web/uri.scm (parse-authority): Allow empty authorities, so that we accept URIs of the form, file:///etc/hosts. * test-suite/tests/web-uri.test ("string->uri"): Add tests.
2011-12-05add srfi-39 parameters to boot-9Andy Wingo1-0/+69
* module/ice-9/boot-9.scm (<parameter>, make-parameter, parameter?) (parameter-fluid, parameter-converter, parameterize): New top-level bindings, implementing SRFI-39 parameters. Currently, current-input-port and similar procedures are not yet parameters. * test-suite/Makefile.am: * test-suite/tests/parameters.test: Add tests, taken from srfi-39 tests.
2011-12-01Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo6-83/+189
Conflicts: configure.ac libguile/fluids.c libguile/gc.c libguile/gc.h libguile/objcodes.c libguile/procprop.c libguile/vm.c module/ice-9/psyntax-pp.scm module/ice-9/psyntax.scm
2011-11-26FFI: Hold a weak reference to the procedure passed to `procedure->pointer'.Ludovic Courtès1-0/+16
* libguile/foreign.c (scm_procedure_to_pointer): Keep a weak reference to PROC. * test-suite/tests/foreign.test ("procedure->pointer")["procedure is retained"]: New test.
2011-11-23web-http.test validates headersDaniel Hartwig1-2/+3
* test-suite/tests/web-http.test (pass-if-parse): Validate header values as well.
2011-11-22Complete cross-compilation support.Ludovic Courtès1-1/+59
* module/system/base/target.scm (%target-endianness, %target-word-size): New fluids. (%native-word-size): New variable. (with-target): Set these fluids. (cpu-endianness, cpu-word-size, triplet-cpu, triplet-vendor, triplet-os): New procedures. (target-cpu, target-vendor, target-os): Use them. (target-endianness, target-word-size): Refer to the corresponding fluid. * libguile/objcodes.c (target_endianness_var, target_word_size_var): New global variables. (NATIVE_ENDIANNESS): New macro. (target_endianness, target_word_size, to_native_order): New functions. (make_objcode_from_file): Use `scm_bytecode_to_native_objcode' instead of `scm_bytecode_to_objcode'. (bytecode_to_objcode): New function, based on `scm_bytecode_to_objcode', with the addition of an `endianness' and `word_size' parameters. (scm_bytecode_to_objcode): Use it. (scm_bytecode_to_native_objcode): New function. (scm_write_objcode): Use `target_word_size' and `target_endianness'. Convert OBJCODE's len and meta-len to native byte order. (scm_init_objcodes): Initialize `target_endianness_var' and `target_word_size_var'. * libguile/objcodes.h (scm_bytecode_to_native_objcode): New declaration. * libguile/vm.c (really_make_boot_program): Use `scm_bytecode_to_native_objcode' instead of `scm_bytecode_to_objcode'. * test-suite/tests/asm-to-bytecode.test (%objcode-cookie-size): New variable. (test-target): New procedure. ("cross-compilation"): Add `test-target' calls and the "unknown target" test.
2011-11-22Fix `validate-target' in (system base target).Ludovic Courtès1-2/+25
* module/system/base/target.scm (validate-target): Accept any tuple with at least 3 parts. * test-suite/tests/asm-to-bytecode.test (test-triplet): New procedure. ("cross-compilation"): New test prefix.
2011-11-20Allow overlapping regions to be passed to `bytevector-copy!'.Ludovic Courtès1-2/+9
Reported by Dmitry Chestnykh <dmitry@codingrobots.com>. Fixes <http://debbugs.gnu.org/10070>. * libguile/bytevectors.c (scm_bytevector_copy_x): Use `memmove', not `memcpy'. * test-suite/tests/bytevectors.test ("2.2 General Operations")["bytevector-copy! overlapping"]: New test. * doc/ref/api-data.texi (Bytevector Manipulation): Mention possible overlapping.
2011-11-17eval.test workAndy Wingo1-71/+43
* test-suite/tests/eval.test ("stacks"): Enable another test, fix to use with-throw-handler, and remove a duplicate test, now that there is no difference between subrs and gsubrs.
2011-11-16FFI: Add a `procedure->pointer' test.Ludovic Courtès1-0/+10
* test-suite/tests/foreign.test ("procedure->pointer")["procedures returning a pointer"]: New test.
2011-11-16Re-enable a couple of evaluator tests.Ludovic Courtès1-3/+2
These tests had been disabled as part of b7742c6b7132544b9d6cd9cb32c09e2084ad9e52 ("new evaluator, y'all"). * test-suite/tests/eval.test ("define set procedure-name")["closure"]: Change to `pass-if' since it now works, as a result of ee15aa46e3fb29e609bd7c431e8f2676f6573d57 ("set names of functions defined at the toplevel from `eval'"). ("stacks")["arguments of a gsubr stack frame"]: Remove (throw 'unresolved).