summaryrefslogtreecommitdiff
path: root/test-suite
AgeCommit message (Collapse)AuthorFilesLines
2014-09-30Merge branch 'stable-2.0'Mark H Weaver18-303/+606
Conflicts: benchmark-suite/benchmarks/ports.bm libguile/async.h libguile/bytevectors.c libguile/foreign.c libguile/gsubr.c libguile/srfi-1.c libguile/vm-engine.h libguile/vm-i-scheme.c module/Makefile.am module/language/tree-il/analyze.scm module/language/tree-il/peval.scm module/scripts/compile.scm module/scripts/disassemble.scm test-suite/tests/asm-to-bytecode.test test-suite/tests/peval.test test-suite/tests/rdelim.test
2014-09-29Add (ice-9 unicode) moduleAndy Wingo2-0/+29
* libguile/unicode.c: * libguile/unicode.h: * test-suite/tests/unicode.test: * module/ice-9/unicode.scm: New files. * module/Makefile.am: * libguile/Makefile.am: * test-suite/Makefile.am: * libguile/init.c: Wire new files into the build. * doc/ref/api-data.texi: Add docs.
2014-09-28peval: Handle optional argument inits that refer to previous arguments.Mark H Weaver1-1/+85
Fixes <http://bugs.gnu.org/17634>. Reported by Josep Portella Florit <jpf@primfilat.com>. * module/language/tree-il/peval.scm (inlined-application): When inlining an application whose operator is a lambda expression with optional arguments that rely on default initializers, expand into a series of nested let expressions, to ensure that previous arguments are in scope when the default initializers are evaluated. * test-suite/tests/peval.test ("partial evaluation"): Add tests.
2014-09-17tests: Link test against Gnulib.Ludovic Courtès1-1/+2
Reported by Eli Zaretskii <eliz@gnu.org>. * test-suite/standalone/Makefile.am (test_scm_take_locale_symbol_LDADD): Add libgnu.la, for the 'strdup' replacement.
2014-09-12Add (ice-9 unicode) moduleAndy Wingo2-0/+29
* libguile/unicode.c: * libguile/unicode.h: * test-suite/tests/unicode.test: * module/ice-9/unicode.scm: New files. * module/Makefile.am: * libguile/Makefile.am: * test-suite/Makefile.am: * libguile/init.c: Wire new files into the build. * doc/ref/api-data.texi: Add docs.
2014-08-26Handle ~p in 'format' warnings.Ludovic Courtès1-0/+44
Fixes <http://bugs.gnu.org/18299>. Reported by Frank Terbeck <ft@bewatermyfriend.org>. * module/language/tree-il/analyze.scm (format-string-argument-count): Add case for ~p. * test-suite/tests/tree-il.test ("warnings")["format"]("~p", "~p, too few arguments", "~:p", "~:@p, too many arguments", "~:@p, too few arguments"): New tests.
2014-08-13Make temporary file in coding.test work on MS-Windows.Eli Zaretskii1-1/+4
* test-suite/tests/coding.test (with-temp-file): Instead of hard-coding "/tmp" as the temporary directory, use $TMPDIR or $TEMP from the environment, and fall back on "/tmp" if none of those 2 is defined.
2014-07-04Recognize more ARM targets.Ludovic Courtès1-0/+6
Suggested by Dale P. Smith. * module/system/base/target.scm (cpu-endianness): Add cases for "arm.*eb", "^aarch64.*be", and "aarch64". Change "arm" case to "arm.*". (triplet-pointer-size): Allow underscore as in 'aarch64_be'. * test-suite/tests/asm-to-bytecode.test ("cross-compilation")["armeb-unknown-linux-gnu", "aarch64-linux-gnu", "aarch64_be-linux-gnu"]: New tests.
2014-07-04Fix bit-count* bugAndy Wingo1-0/+4
* libguile/bitvectors.c (scm_bit_count_star): Fix typo introduced in 2005 refactor (!) in which the second arg was erroneously taken from the first arg. * test-suite/tests/bitvectors.test: Add test. * doc/ref/api-compound.texi: Fix doc example for u32vector selector.
2014-07-04build: Support pthread builds without 'pthread_cancel' support (Android).Ludovic Courtès1-1/+12
Reported by Sylvain Beucler <beuc@beuc.net>. * configure.ac: Check for 'pthread_cancel'. * libguile/threads.c (scm_cancel_thread): Conditionalize on !SCM_USE_PTHREAD_THREADS || defined HAVE_PTHREAD_CANCEL. * test-suite/tests/threads.test (require-cancel-thread): New procedure. ("timed joining fails if timeout exceeded", "join-thread returns timeoutval on timeout", "cancel succeeds", "handler result passed to join", "can cancel self"): Use it.
2014-07-04Recognize arm-* target triplets.Ludovic Courtès1-1/+4
Reported by Sylvain Beucler <beuc@beuc.net>. * module/system/base/target.scm (cpu-endianness): Add case where CPU is "arm". * test-suite/tests/asm-to-bytecode.test ("cross-compilation")["arm-unknown-linux-androideabi"]: New test.
2014-07-03Remove trailing whitespace from ports.test.Eli Zaretskii1-6/+6
2014-07-03Untabify some test files.Eli Zaretskii3-274/+274
* test-suite/tests/ports.test: Untabify. * test-suite/tests/posix.test: Untabify. * test-suite/tests/r6rs-files.test: Untabify.
2014-07-03Fix problems with Windows file names that use backslashes.Eli Zaretskii1-0/+11
* libguile/load.c (scm_i_mirror_backslashes): New function. (scm_init_load_path): Call it to produce MS-Windows file names with forward slashes. (FILE_NAME_SEPARATOR_STRING): Define as "/" on all platforms. * libguile/load.h (scm_i_mirror_backslashes): Add prototype. * libguile/init.c (scm_boot_guile): Call scm_i_mirror_backslashes on argv[0]. * libguile/filesys.c (scm_getcwd): Call scm_i_mirror_backslashes on the directory name returned by getcwd. * test-suite/tests/ports.test ("file name separators"): New test.
2014-07-03Unconditionally build and test the ice-9/popen module.Eli Zaretskii1-2/+1
* module/Makefile.am (ICE_9_SOURCES): Add ice-9/popen.scm. (ICE_9_SOURCES) [BUILD_ICE_9_POPEN]: Remove conditional addition of ice-9/popen.scm. (SCRIPTS_SOURCES): Add scripts/autofrisk.scm and scripts/scan-api.scm unconditionally. (SCRIPTS_SOURCES) [BUILD_ICE_9_POPEN]: Remove conditional addition of scripts/autofrisk.scm and scripts/scan-api.scm. * configure.ac: Remove the BUILD_ICE_9_POPEN condition. * test-suite/tests/popen.test (if-supported): Don't test for 'fork feature being supported.
2014-07-02 More fixes for deleting files whose ports are not closed.Eli Zaretskii2-1/+4
* test-suite/tests/r6rs-files.test: Close the port after using it. * test-suite/tests/posix.test ("mkstemp!"): Close the port after using it.
2014-07-02 Fix deletion of ports.test test file on MS-Windows.Eli Zaretskii1-8/+17
* test-suite/tests/ports.test ("fdes->port", "seek") ("truncate-file"): Close every file and port we open, to avoid failure to delete the test file on MS-Windows when the test is completed.
2014-06-29Fix bit-count* bugAndy Wingo1-0/+4
* libguile/bitvectors.c (scm_bit_count_star): Fix typo introduced in 2005 refactor (!) in which the second arg was erroneously taken from the first arg. * test-suite/tests/bitvectors.test: Add test. * doc/ref/api-compound.texi: Fix doc example for u32vector selector.
2014-06-12tests: Improve lack-of-/dev/null detection.Ludovic Courtès1-3/+6
Suggested by Eli Zaretskii <eliz@gnu.org>. * test-suite/test-suite/lib.scm (%null-device): Test for Windows based by checking for a drive letter in the current directory name.
2014-06-11i18n: Adjust tests for Windows.Ludovic Courtès1-10/+27
* test-suite/tests/i18n.test (mingw?): New variable. (%french-locale-name, %french-utf8-locale-name, %turkish-utf8-locale-name, %german-utf8-locale-name, %greek-utf8-locale-name): Add name of corresponding Windows codepage, when MINGW? is true. (under-turkish-utf8-locale-or-unresolved): Add exception for "mingw32". Co-authored-by: Eli Zaretskii <eliz@gnu.org>
2014-06-11i18n: Ignore LC_MESSAGES on MinGW.Ludovic Courtès1-4/+4
* libguile/locale-categories.h (MESSAGES): Add condition on !(defined(LC_MAX) && LC_MESSAGES > LC_MAX). * test-suite/tests/i18n.test ("locale objects")["make-locale (2 args, list)", "make-locale (3 args)", "locale?"]: Use LC_NUMERIC or LC_TIME instead of LC_MESSAGES. Co-authored-by: Eli Zaretskii <eliz@gnu.org>
2014-06-11tests: Use NUL instead of /dev/null on MinGW.Ludovic Courtès3-5/+19
Reported by Eli Zaretskii <eliz@gnu.org>. * test-suite/test-suite/lib.scm (%null-device): New variable. * test-suite/tests/c-api.test (egrep): Use %NULL-DEVICE instead of /dev/null. * test-suite/tests/popen.test ("open-input-pipe")["no duplicate"]: Likewise.
2014-06-04test-guild-compile: Increase sleep time before sending SIGINT.Mark H Weaver1-1/+1
* test-suite/standalone/test-guild-compile: Increase sleep time before sending SIGINT, for slow machines.
2014-06-03'guild compile' doesn't leave temporary files behind it.Ludovic Courtès2-0/+45
* module/scripts/compile.scm (compile): Add 'sigaction' call. * test-suite/standalone/test-guild-compile: New file. * test-suite/standalone/Makefile.am (check_SCRIPTS, TESTS): Add it.
2014-06-01SRFI-1 'length+' raises an error unless passed a proper or circular list.Mark H Weaver1-1/+5
Fixes <http://bugs.gnu.org/17296>. * libguile/srfi-1.c (scm_srfi1_length_plus): Rewrite to raise an error unless passed a proper or circular list, based on code from 'scm_ilength'. * test-suite/tests/srfi-1.test (length+): Add tests.
2014-05-28rdelim: Speed up 'read-string' (aka. 'get-string-all'.)Ludovic Courtès1-2/+8
This yields a 20% improvement on the "read-string" benchmark. * module/ice-9/rdelim.scm (read-string): Rewrite as a 'case-lambda', with a tight loop around 'read-char', and without using 'read-string!'. * test-suite/tests/rdelim.test ("read-string")["longer than 100 chars, with limit"]: New test. * benchmark-suite/benchmarks/ports.bm ("rdelim")["read-string"]: New benchmark.
2014-05-28tests: Add test for <http://bugs.gnu.org/17466>.Ludovic Courtès1-0/+20
* test-suite/tests/r6rs-ports.test ("7.2.8 Binary Input")("http://bugs.gnu.org/17466"): New test.
2014-05-21tests: Add test for _IOLBF.Ludovic Courtès1-0/+24
* test-suite/tests/ports.test ("pipe, fdopen, and _IOLBF"): New test.
2014-05-01Rewrite boot-9 map to be recursive and pureAndy Wingo1-2/+2
* module/ice-9/boot-9.scm (map): Rewrite to be recursive and pure instead of iterative and effectful. At best this is faster; at worst it is slower. In any case it resolves continuation-related issues. * module/srfi/srfi-1.scm (fold): Specialize the two-arg case. (map): Rewrite to be recursive. * test-suite/tests/r5rs_pitfall.test (8.3): Update for new expected map behavior.
2014-04-28Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo4-4/+284
Conflicts: .gitignore doc/example-smob/Makefile doc/ref/api-smobs.texi doc/ref/libguile-concepts.texi doc/ref/libguile-smobs.texi libguile.h libguile/finalizers.c libguile/finalizers.h libguile/goops.c module/language/tree-il/compile-glil.scm module/oop/goops.scm
2014-04-28Add more foreign object interfacesAndy Wingo1-5/+4
* libguile/foreign-object.c: * libguile/foreign-object.h (scm_make_foreign_object_1) (scm_make_foreign_object_2, scm_make_foreign_object_3) (scm_make_foreign_object_n): Change to take void * arguments, and to add a comment to the header indicating that these are convenience constructors. * libguile/foreign-object.c: * libguile/foreign-object.h (scm_foreign_object_unsigned_ref) (scm_foreign_object_unsigned_set_x): New functions, equivalent to the old scm_foreign_object_ref and scm_foreign_object_set_x. * libguile/foreign-object.c: * libguile/foreign-object.h (scm_foreign_object_signed_ref) (scm_foreign_object_signed_set_x): New functions taking scm_t_signed_bits. * libguile/foreign-object.c: * libguile/foreign-object.h (scm_foreign_object_ref) (scm_foreign_object_set_x): New functions that take void*.
2014-04-28New foreign object facility, to replace SMOBsAndy Wingo3-0/+246
* libguile/foreign-object.c: * libguile/foreign-object.h: * module/system/foreign-object.scm: * test-suite/standalone/test-foreign-object-c.c: * test-suite/standalone/test-foreign-object-scm: New files. * test-suite/standalone/Makefile.am: * module/Makefile.am: * libguile/Makefile.am: Add new files. * libguile.h: Add foreign-object.h. * libguile/init.c (scm_i_init_guile): Call scm_register_foreign_object.
2014-04-27Fix foreign slot initialization and accessAndy Wingo1-4/+39
* libguile/goops.c (scm_sys_initialize_object): Refactor initialization so that we don't ref uninitialized slots before initializing them. This allows foreign slots, whose initial value is 0, to be initialized via #:init-form. * module/oop/goops.scm (@slot-ref, @slot-set!): Remove definitions. Change callers to use struct-ref and struct-set!. slot-ref and slot-set! were only marginally more efficient and were much more dangerous. This change allows the standard accessors to work on foreign slots; that was not the case before, as the 'u' fields of the struct were read as if they were 'p' slots. * module/language/tree-il/compile-glil.scm (lambda): Remove support for compiling @slot-ref/@slot-set!. These were private to GOOPS. * test-suite/tests/goops.test ("active-slot"): Update to not expect a ref before initialization. ("foreign slots"): Add tests.
2014-04-25Merge branch 'stable-2.0'v2.1.0Mark H Weaver16-34/+401
Conflicts: GUILE-VERSION NEWS guile-readline/ice-9/readline.scm libguile/async.c libguile/backtrace.c libguile/deprecated.h libguile/gc-malloc.c libguile/gdbint.c libguile/init.c libguile/ioext.c libguile/mallocs.c libguile/print.c libguile/rw.c libguile/scmsigs.c libguile/script.c libguile/simpos.c libguile/snarf.h libguile/strports.c libguile/threads.c libguile/vm-i-scheme.c libguile/vm-i-system.c module/srfi/srfi-18.scm test-suite/Makefile.am test-suite/standalone/test-num2integral.c
2014-04-24Support weak vectors, arrays, and bitvectors in (system base types).Mark H Weaver1-0/+8
* module/system/base/types.scm (%tc7-wvect, %tc7-array, %tc7-bitvector): New variables. (cell->object): Add cases for weak vectors, arrays, and bitvectors.
2014-04-21Add make-vector opcodeAndy Wingo1-1/+7
* libguile/vm-engine.c (make-vector): New opcode. * module/language/cps/compile-bytecode.scm (compile-fun): * module/system/vm/assembler.scm (system): Support the new opcode. (*bytecode-minor-version*): Bump. * libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump. * test-suite/tests/compiler.test ("limits"): Add vector test.
2014-04-21Operations on 8-bit and 12-bit operands shuffle args into rangeAndy Wingo1-1/+33
* module/language/cps/slot-allocation.scm (allocate-slots): Avoid allocating locals in the range [253,255]. * module/system/vm/assembler.scm: List exports explicitly. For operations with limited-range operands, export wrapper assemblers that handle shuffling their operands into and out of their range. (define-assembler): Get rid of enclosing begin. (shuffling-assembler, define-shuffling-assembler): New helpers to define shuffling wrapper assemblers. (emit-mov*, emit-receive*): New functions. (shuffle-up-args): New helper. (standard-prelude, opt-prelude, kw-prelude): Call shuffle-up-args after finishing. * test-suite/tests/compiler.test ("limits"): Add test cases.
2014-04-16More robust coverage testsAndy Wingo1-1/+10
* test-suite/tests/coverage.test ("line-execution-counts"): Allow zero or one count on the loop head.
2014-04-16Change some make-stack tests to use frame-call-representationAndy Wingo1-8/+6
* test-suite/tests/eval.test ("stacks"): Use frame-call-representation.
2014-04-15Fix rtl testsAndy Wingo1-2/+15
* module/system/vm/assembler.scm (write-arities): Add a diagnostic. * test-suite/tests/rtl.test: Fix tests to emit "definition" instructions.
2014-04-15Fix frame-call-representation for primitive applicationsAndy Wingo1-6/+4
* module/system/vm/frame.scm (frame-call-representation): Fix to work for primitives. * test-suite/tests/eval.test ("stacks"): Update expected result for substring.
2014-04-10Remove tests for old Tree-IL CSE moduleAndy Wingo2-307/+1
* test-suite/tests/cse.test: Remove. * test-suite/Makefile.am:
2014-04-08Compile some standalone tests to bytecodeAndy Wingo2-0/+2
* test-suite/standalone/test-out-of-memory: * test-suite/standalone/test-stack-overflow: Compile these files before running them. That way, recursion can check the stack-overflow mechanism instead of the memory allocation mechanism. We compile beforehand as a prepass so as not to impose an rlimit on a Guile that previously ran auto-compilation.
2014-04-04Fix coverage expectationsAndy Wingo1-3/+3
* test-suite/tests/coverage.test ("line-execution-counts"): Update expectations. Since there's nothing to do at the loop header and the renaming of X happens at the end of the loops, the compiled code only sees the loop header once.
2014-04-02(test-suite lib) uses plain old catch, not stack-catchAndy Wingo1-28/+22
* test-suite/test-suite/lib.scm (run-test-exception): Refactor to just use "catch" instead of stack-catch.
2014-03-26Sloppier matching in setitimer testsAndy Wingo1-5/+14
* test-suite/tests/signals.test: Update setitimer tests to sloppily match both times -- it seems that the interval can also be sloppy on some platforms, sadly.
2014-03-26Adapt test-out-of-memory to work on 32-bit systemsAndy Wingo1-4/+6
* test-suite/standalone/test-out-of-memory (*limit*): Reduce limit to 50 MB. Adapt vector test to avoid exceeding maximum vector size on 32-bit systems.
2014-03-23Calculate usecs correctly in thread-sleep!Nathaniel Alderson1-1/+7
* module/srfi/srfi-18.scm (thread-sleep!): Correctly compute microseconds. * test-suite/tests/srfi-18.test: Add test.
2014-03-22Out-of-memory situations raise exceptions instead of abortingAndy Wingo2-0/+63
* libguile/gc.c (scm_oom_fn, scm_init_gc): Install an out-of-memory handler that raises an unwind-only out-of-memory exception. (scm_gc_warn_proc, scm_init_gc): Install a warning proc that tries to print to the current warning port, if the current warning port is a file port. (scm_gc_after_nonlocal_exit): New interface. Should be called after a nonlocal return to potentially collect memory; otherwise allocations could try to expand again when they should collect. * libguile/continuations.c (scm_i_make_continuation): * libguile/eval.c (eval): * libguile/throw.c (catch): * libguile/vm.c (scm_call_n): Call scm_gc_after_nonlocal_exit after nonlocal returns. * libguile/throw.c (abort_to_prompt, throw_without_pre_unwind): Rework to avoid allocating memory. (scm_report_out_of_memory): New interface. (scm_init_throw): Pre-allocate the arguments for stack-overflow and out-of-memory errors. * module/ice-9/boot-9.scm: Add an out-of-memory exception printer. * module/system/repl/error-handling.scm (call-with-error-handling): Add out-of-memory to the report-keys set. * libguile/gc-malloc.c (scm_realloc): Call scm_report_out_of_memory if realloc fails. * libguile/error.h: * libguile/error.c: * libguile/deprecated.h: * libguile/deprecated.c (scm_memory_error): Deprecate. * test-suite/standalone/Makefile.am: * test-suite/standalone/test-out-of-memory: New test case.
2014-03-20tests: Add #undef NDEBUG when using <assert.h>.Ludovic Courtès8-7/+24
* test-suite/standalone/test-loose-ends.c, test-suite/standalone/test-num2integral.c, test-suite/standalone/test-round.c, test-suite/standalone/test-scm-c-bind-keyword-arguments.c, test-suite/standalone/test-scm-c-read.c, test-suite/standalone/test-scm-values.c, test-suite/standalone/test-smob-mark.c, test-suite/standalone/test-srfi-4.c: Add #undef NDEBUG.