1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-11 22:31:12 +02:00
guile/test-suite/tests
Andy Wingo 8399e7af51 Generic port facility provides buffering uniformly
* libguile/ports.h (struct scm_t_port_buffer): New data type.
  (struct scm_t_port): Refactor to use port buffers instead of
  implementation-managed read and write pointers.  Add "read_buffering"
  member.
  (SCM_INITIAL_PUTBACK_BUF_SIZE, SCM_READ_BUFFER_EMPTY_P): Remove.
  (scm_t_ptob_descriptor): Rename "fill_input" function to "read", and
  take a port buffer, returning void.  Likewise "write" takes a port
  buffer and returns void.  Remove "end_input"; instead if there is
  buffered input and rw_random is true, then there must be a seek
  function, so just seek back if needed.  Remove "flush"; instead all
  calls to the "write" function implicitly include a "flush", since the
  buffering happens in the generic port code now.  Remove "setvbuf", but
  add "get_natural_buffer_sizes"; instead the generic port code can
  buffer any port.
  (scm_make_port_type): Adapt to read and write prototype changes.
  (scm_set_port_flush, scm_set_port_end_input, scm_set_port_setvbuf):
  Remove.
  (scm_slow_get_byte_or_eof_unlocked)
  (scm_slow_get_peek_or_eof_unlocked): Remove; the slow path is to call
  scm_fill_input.
  (scm_set_port_get_natural_buffer_sizes): New function.
  (scm_c_make_port_buffer): New internal function.
  (scm_port_non_buffer): Remove.  This was a function for
  implementations that is no longer needed.  Instead open with BUF0 or
  use (setvbuf port 'none).
  (scm_fill_input, scm_fill_input_unlocked): Return the filled port
  buffer.
  (scm_get_byte_or_eof_unlocked, scm_peek_byte_or_eof_unlocked): Adapt
  to changes in buffering and EOF management.
* libguile/ports.c: Adapt to port interface changes.
  (initialize_port_buffers): New function, using the port mode flags to
  set up appropriate initial buffering for all ports.
  (scm_c_make_port_with_encoding): Create port buffers here instead of
  delegating to implementations.
  (scm_close_port): Flush the port if needed instead of delegating to
  the implementation.
* libguile/filesys.c (set_element): Adapt to buffering changes.
* libguile/fports.c (fport_get_natural_buffer_sizes): New function,
  replacing scm_fport_buffer_add.
  (fport_write, fport_read): Update to let the generic ports code do the
  buffering.
  (fport_flush, fport_end_input): Remove.
  (fport_close): Don't flush in a dynwind; that's the core ports' job.
  (scm_make_fptob): Adapt.
* libguile/ioext.c (scm_redirect_port): Adapt to buffering changes.
* libguile/poll.c (scm_primitive_poll): Adapt to buffering changes.
* libguile/ports-internal.h (struct scm_port_internal): Remove
  pending_eof flag; this is now set on the read buffer.
* libguile/r6rs-ports.c (struct bytevector_input_port): New type.  The
  new buffering arrangement means that there's now an intermediate
  buffer between the bytevector and the user of the port; this could
  lead to a perf degradation, but on the other hand there are some other
  speedups enabled by the buffering refactor, so probably the memcpy
  cost is dwarfed by the cost of the other parts of the ports
  machinery.
  (make_bytevector_input_port, bytevector_input_port_read):
  (bytevector_input_port_seek, initialize_bytevector_input_ports): Adapt
  to new buffering arrangement.
  (struct custom_binary_port): Remove read buffer, as Guile handles that
  now.
  (custom_binary_input_port_setvbuf): Remove; now handled by Guile.
  (make_custom_binary_input_port, custom_binary_input_port_read)
  (initialize_custom_binary_input_ports): Adapt.
  (scm_get_bytevector_some): Adapt to new EOF management.
  (scm_t_bytevector_output_port_buffer): Hold on to the underlying port,
  so we can flush it if it's open.
  (make_bytevector_output_port, bytevector_output_port_write):
  (bytevector_output_port_seek): Adapt.
  (bytevector_output_port_procedure): Flush the port as appropriate, so
  that we get all the bytes.
  (make_custom_binary_output_port, custom_binary_output_port_write):
  Adapt.
  (make_transcoded_port): Don't muck with buffering.
  (transcoded_port_write): Simply forward the write to the underlying
  port.
  (transcoded_port_read): Likewise.
  (transcoded_port_close): No need to flush.
  (initialize_transcoded_ports): Adapt.
* libguile/read.c (scm_i_scan_for_encoding): Adapt to buffering
  changes.
* libguile/rw.c (scm_write_string_partial): Adapt to buffering changes.
* libguile/strports.c: Adapt to the fact that we don't manage the
  buffer.  Probably room for speed improvements here...
* libguile/vports.c (soft_port_get_natural_buffer_sizes): New function.
  Adapt the rest of the file for the new buffering regime.
* test-suite/tests/r6rs-ports.test ("8.2.10 Output ports"): Custom
  binary output ports need to be flushed before you can rely on the
  write! procedure having been called.  Add necessary flush-port
  invocations.
  ("8.2.6  Input and output ports"): Transcoded ports now have an
  internal buffer by default.  This test checks that the characters are
  transcoded one at a time, so to do that, call setvbuf on the
  transcoded port to remove the buffer.
* test-suite/tests/web-client.test (run-with-http-transcript): Fix for
  different flushing regime on soft ports.  (The vestigial flush
  procedure is now called after each write, which is not what the test
  was expecting.)
* test-suite/standalone/test-scm-c-read.c: Update for changes to the C
  interface for defining port types.
* doc/ref/api-io.texi (Ports): Update to discuss buffering in a generic
  way, and to remove a hand-wavey paragraph describing string ports as
  "interesting and powerful".
  (Reading, Writing): Remove placeholder comments.  Document
  `scm_lfwrite'.
  (Buffering): New section.
  (File Ports): Link to buffering.
  (I/O Extensions): Join subnodes into parent and describe new API,
  including buffering API.
* doc/ref/posix.texi (Ports and File Descriptors): Link to buffering.
  Remove unread-char etc, as they are documented elsewhere.
  (Pipes, Network Sockets and Communication): Link to buffering.
2016-04-06 19:21:44 +02:00
..
00-initial-env.test Add optimized tagged integer addition/subtractions for x86_64. 2010-11-19 13:34:43 +01:00
00-socket.test Merge commit 'b9b88351ea' 2014-02-08 14:55:16 +01:00
alist.test test-suite: eq-ness of numbers, characters is unspecified 2013-03-01 11:03:22 -05:00
and-let-star.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
arbiters.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
arrays.test Non-vector 1D arrays print as #1() 2015-02-18 09:32:30 +01:00
bit-operations.test fix bug in ash opcode 2010-03-31 22:29:29 +02:00
bitvectors.test Fix bit-count* bug 2014-07-04 16:52:29 +02:00
brainfuck.test move (test-suite lib) to lower dir; cleans up uninstalled paths. 2012-04-23 21:46:06 +02:00
bytevectors.test Allow decoding of UTF-8 containing U+FFFD, the replacement character. 2015-08-13 01:31:36 -04:00
c-api.test tests: Use NUL instead of /dev/null on MinGW. 2014-06-11 14:36:55 +02:00
chars.test String ports use UTF-8; ignore %default-port-encoding. 2013-08-07 01:22:22 -04:00
coding.test Make temporary file in coding.test work on MS-Windows. 2014-08-13 18:41:15 +03:00
common-list.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
compiler.test Add make-vector opcode 2014-04-21 22:47:33 +02:00
continuations.test with-continuation-barrier calls exit(3) _after_ unwinding 2011-03-30 12:43:50 +02:00
control.test vm: Gracefully handle stack overflows. 2013-12-05 22:19:01 +01:00
coverage.test Mark two coverage tests as XFAIL 2015-01-23 16:15:59 +01:00
cross-compilation.test Merge branch 'stable-2.0' 2014-09-30 03:50:47 -04:00
curried-definitions.test fix curried definitions for value defines 2010-04-08 21:01:52 +02:00
dwarf.test Rename "RTL" to "bytecode" 2013-12-02 21:31:47 +01:00
ecmascript.test String ports use UTF-8; ignore %default-port-encoding. 2013-08-07 01:22:22 -04:00
elisp-compiler.test fix `flet' syntax 2012-02-03 18:53:50 -05:00
elisp-reader.test use correct names for quasiquotation operators 2010-12-07 13:21:02 +01:00
elisp.test test-suite: eq-ness of numbers, characters is unspecified 2013-03-01 11:03:22 -05:00
encoding-escapes.test Change `scm_encoding_error' to pass the port and faulty character. 2011-02-02 18:06:29 +01:00
encoding-iso88591.test Improve handling of locales in the test suite. 2014-02-07 21:49:35 -05:00
encoding-iso88597.test Improve handling of locales in the test suite. 2014-02-07 21:49:35 -05:00
encoding-utf8.test Improve handling of locales in the test suite. 2014-02-07 21:49:35 -05:00
eval-string.test add ice-9 eval-string 2011-03-05 23:16:11 +01:00
eval.test Remove frame-procedure 2015-12-01 11:30:54 +01:00
exceptions.test Convert test-suite/tests/exceptions.test to use hygienic macros. 2013-11-22 22:53:51 -05:00
filesys.test tests: Remove symlink only when it exists. 2013-06-16 16:54:12 +02:00
fluids.test Fix later-bindings-win logic in with-fluids. 2013-02-28 18:43:09 -05:00
foreign.test Foreign procedures are RTL programs 2013-10-18 17:41:33 +02:00
format.test tests: Check 'simple-format' with closed current-output-port. 2014-03-20 09:40:42 +01:00
fractions.test Fix incorrect rationalize tests. 2013-07-21 08:09:46 -04:00
ftw.test test-suite: Skip EACCES' test of file-system-fold' when run as root. 2012-12-10 23:41:06 +01:00
future.test futures: Limit the number of nested futures on the same stack. 2013-03-27 18:09:49 +01:00
gc.test tests: Add more `maybe-gc-flakiness'. 2013-03-22 22:24:27 +01:00
getopt-long.test Implement #:stop-at-first-non-option option for getopt-long 2011-05-26 17:58:18 +01:00
goops.test Add #:static-slot-allocation? 2015-02-06 13:25:17 +01:00
guardians.test Deprecate vector-ref, vector-length, vector-set! on weak vectors 2014-02-07 12:42:44 +01:00
hash.test Test for deleted weak pairs in hash-for-each. 2014-03-12 02:36:35 -04:00
hooks.test Enclose hooks tests in their own module. 2010-01-07 11:10:36 +01:00
i18n.test i18n: Adjust tests for Windows. 2014-06-11 15:03:31 +02:00
iconv.test fix bug where scm_from_utf8_stringn would not detect bad utf-8 2013-01-15 11:01:10 +01:00
import.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
interp.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
keywords.test Fix "coding:" cookies in the test suite. 2010-03-02 23:36:29 +01:00
linker.test fix linker.test 2013-06-10 22:42:46 +02:00
list.test Improve error reporting in 'append!' 2012-10-06 06:04:29 -04:00
load.test primitive-load returns the value(s) of the last expression 2012-01-09 16:15:00 +01:00
match.test move (test-suite lib) to lower dir; cleans up uninstalled paths. 2012-04-23 21:46:06 +02:00
match.test.upstream Update (ice-9 match) from Chibi-Scheme. 2011-10-16 18:36:20 +02:00
modules.test Merge branch 'stable-2.0' 2014-09-30 03:50:47 -04:00
multilingual.nottest Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
net-db.test tests: Have `getaddrinfo' test work for Darwin 8. 2012-02-03 10:30:52 +01:00
numbers.test Fix 'exact-integer?' comment in numbers.test. 2014-01-12 07:47:00 -05:00
optargs.test Report the faulty keyword in errors raised by `scm_c_bind_keyword_arguments'. 2013-06-05 00:25:39 +02:00
options.test fix up options.test 2010-09-25 12:12:45 +02:00
pairs.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
parameters.test current-input-port et al are srfi-39 parameters 2011-12-10 21:37:19 +01:00
peg.bench PEG Renames 2013-01-16 10:11:49 +01:00
peg.test PEG Renames 2013-01-16 10:11:49 +01:00
peval.test Remove add1 and sub1 2015-12-01 11:30:55 +01:00
poe.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
popen-child.scm Fix hanging of popen.test 2010-07-01 22:16:54 +01:00
popen.test Unconditionally build and test the ice-9/popen module. 2014-07-03 19:20:00 +03:00
ports.test Flush buffered reads / writes before seeking 2016-04-04 16:30:57 +02:00
posix.test Untabify some test files. 2014-07-03 21:02:23 +03:00
print.test Merge branch 'stable-2.0' 2014-01-14 23:53:08 -05:00
procprop.test remove @apply memoizer 2013-06-27 22:02:35 +02:00
procs.test Add compose', negate', and `const'. 2010-12-16 23:45:23 +01:00
q.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
r4rs.test Placate a number of `syntax-check' verifications. 2012-01-05 23:38:10 +01:00
r5rs_pitfall.test Rewrite boot-9 map to be recursive and pure 2014-05-01 21:17:28 +02:00
r6rs-arithmetic-bitwise.test Optimize R6RS bitwise operators. 2013-07-21 10:00:48 -04:00
r6rs-arithmetic-fixnums.test Optimize R6RS bitwise operators. 2013-07-21 10:00:48 -04:00
r6rs-arithmetic-flonums.test Fix numerator and denominator handling of signed zeroes and infinities. 2013-08-09 06:09:56 -04:00
r6rs-base.test R6RS `string-for-each' should accept multiple string arguments 2012-11-22 22:26:16 +01:00
r6rs-conditions.test Some tweaks to the R6RS support 2010-11-25 23:04:12 +01:00
r6rs-control.test Implementation and test cases for the R6RS (rnrs control) library. 2010-05-20 21:18:02 -04:00
r6rs-enums.test Enumeration set universe comparisons should be done with `equal?' 2010-11-21 15:35:44 -05:00
r6rs-eval.test Fix typo in license comment. 2010-05-20 21:18:04 -04:00
r6rs-exceptions.test Convert guile exceptions to R6RS conditions in R6RS exception handlers. 2013-11-18 00:35:42 -05:00
r6rs-files.test Untabify some test files. 2014-07-03 21:02:23 +03:00
r6rs-hashtables.test Fix argument passing for external hash functions in `(rnrs hashtables)'. 2010-07-14 01:16:19 -04:00
r6rs-lists.test Fix R6RS `fold-left' so the accumulator is the first argument. 2011-11-01 01:11:46 +01:00
r6rs-ports.test Generic port facility provides buffering uniformly 2016-04-06 19:21:44 +02:00
r6rs-records-inspection.test Implementation for the R6RS (rnrs hashtables) library; 2010-05-20 21:18:02 -04:00
r6rs-records-procedural.test Fix test suite title in comment 2010-05-20 21:18:03 -04:00
r6rs-records-syntactic.test fix r6rs-records-syntactic.test to not shadow a literal 2011-07-01 12:01:58 +02:00
r6rs-unicode.test Implementation and test cases for the R6RS (rnrs unicode) library. 2010-05-20 21:18:03 -04:00
ramap.test Preallocate index list in scm_array_index_map_x 2014-02-10 21:58:28 +01:00
random.test Change uses of scm_is_simple_vector to scm_is_vector 2014-02-08 18:26:49 +01:00
rdelim.test Merge branch 'stable-2.0' 2014-09-30 03:50:47 -04:00
reader.test Merge commit '5af307de43' 2015-01-22 12:50:18 +01:00
receive.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
records.test make-record-type slight refactor 2010-04-19 19:33:57 +02:00
regexp.test Merge commit '0ce224594a' 2014-02-08 14:48:56 +01:00
rnrs-libraries.test R6RS srfi library names should ignore first identifier after the :n 2012-11-25 12:28:41 +00:00
rnrs-test-a.scm move (test-suite lib) to lower dir; cleans up uninstalled paths. 2012-04-23 21:46:06 +02:00
rtl-compilation.test Rename "RTL" to "bytecode" 2013-12-02 21:31:47 +01:00
rtl.test All arities serialize a "closure" binding 2015-12-01 10:57:20 +01:00
session.test Fix procedure-arguments on RTL programs, and tweak session.test 2013-11-08 13:29:03 +01:00
signals.test Sloppier matching in setitimer tests 2014-03-26 10:47:40 +01:00
sort.test Fix likely crash in `stable-sort!' 2011-06-09 22:11:02 +02:00
srcprop.test Add tests to verify that 'read' sets source properties when appropriate 2012-02-15 12:23:12 -05:00
srfi-1.test SRFI-1 'length+' raises an error unless passed a proper or circular list. 2014-06-01 19:19:40 -04:00
srfi-4.test Deprecate general "uniform-vector" interface 2014-02-08 14:28:07 +01:00
srfi-6.test Make SRFI-6 string ports Unicode-capable. 2012-06-20 15:50:27 +02:00
srfi-9.test Adapt srfi-9.test to error reporting improvements; update copyright dates. 2013-09-12 18:14:54 -04:00
srfi-10.test add quasisyntax 2009-11-14 17:25:12 +01:00
srfi-11.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
srfi-13.test Fix 'string-copy!' to work properly with overlapping src/dest. 2014-01-08 21:42:24 -05:00
srfi-14.test Improve handling of locales in the test suite. 2014-02-07 21:49:35 -05:00
srfi-17.test adapt tests to new syntax-error form 2010-11-18 11:04:15 +01:00
srfi-18.test Calculate usecs correctly in thread-sleep! 2014-03-23 21:58:54 +01:00
srfi-19.test Improve handling of locales in the test suite. 2014-02-07 21:49:35 -05:00
srfi-26.test * tests/srfi-26.test: New. 2004-01-21 00:45:48 +00:00
srfi-27.test Add implementation of SRFI 27 2010-09-27 22:15:51 +02:00
srfi-31.test Rewrite SRFI-31 in terms of `syntax-rules'. 2012-09-11 23:39:32 +02:00
srfi-34.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
srfi-35.test test-suite: eq-ness of numbers, characters is unspecified 2013-03-01 11:03:22 -05:00
srfi-37.test SRFI-37: Fix infinite loop when processing short option with no required arg. 2013-03-25 23:25:57 +01:00
srfi-38.test Add implementation of SRFI 38 2010-11-03 00:19:54 +01:00
srfi-39.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
srfi-41.test Add SRFI-41. 2013-03-27 13:37:45 -04:00
srfi-42.test Remove stale test file. 2012-01-30 20:57:42 +01:00
srfi-43.test Implement SRFI-43 Vector Library. 2014-02-01 01:19:49 -05:00
srfi-45.test SRFI-45: add promise? predicate. 2013-03-26 21:22:11 -04:00
srfi-60.test SRFI-60: Reimplement 'rotate-bit-field' on inums to be more portable. 2014-03-11 21:39:26 -04:00
srfi-64-test.scm Implement SRFI-64 - A Scheme API for test suites. 2014-02-01 01:19:55 -05:00
srfi-64.test Implement SRFI-64 - A Scheme API for test suites. 2014-02-01 01:19:55 -05:00
srfi-67.test Placate a number of `syntax-check' verifications. 2012-01-05 23:38:10 +01:00
srfi-69.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
srfi-88.test Fix "coding:" cookies in the test suite. 2010-03-02 23:36:29 +01:00
srfi-98.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
srfi-105.test String ports use UTF-8; ignore %default-port-encoding. 2013-08-07 01:22:22 -04:00
srfi-111.test Implement SRFI-111 Boxes. 2014-01-24 10:50:51 -05:00
statprof.test Merge commit 'cdcba5b2f6' 2015-01-22 14:37:18 +01:00
streams.test Change Guile license to LGPLv3+ 2009-06-17 00:22:09 +01:00
strings.test remove @apply memoizer 2013-06-27 22:02:35 +02:00
structs.test Implement `hash' for structs. 2012-10-12 23:21:39 +02:00
sxml-match-tests.ss sxml-match: Handle multiple-value returns. 2010-05-26 23:41:23 +02:00
sxml.fold.test Remove `fold' from (sxml fold). 2010-04-09 00:32:14 +02:00
sxml.match.test move (test-suite lib) to lower dir; cleans up uninstalled paths. 2012-04-23 21:46:06 +02:00
sxml.simple.test add #:doctype-handler to xml->sxml 2013-01-30 15:29:18 +01:00
sxml.ssax.test update licenses on tests imported from guile-lib 2010-04-07 21:37:50 +02:00
sxml.transform.test update licenses on tests imported from guile-lib 2010-04-07 21:37:50 +02:00
sxml.xpath.test update licenses on tests imported from guile-lib 2010-04-07 21:37:50 +02:00
symbols.test symbols with odd characters print better in #{}# 2011-04-11 13:48:11 +02:00
syncase.test Fix infinite loop in expander 2015-02-13 16:43:01 +01:00
syntax.test Fix syntax.test 2014-12-10 16:25:50 +01:00
texinfo.docbook.test update licenses on tests imported from guile-lib 2010-04-07 21:37:50 +02:00
texinfo.serialize.test texinfo: Add whitespace after periods. 2013-03-22 22:05:23 +01:00
texinfo.string-utils.test texinfo: Add whitespace after periods. 2013-03-22 22:05:23 +01:00
texinfo.test texinfo: fix @url{@@} parsing 2014-11-09 15:56:33 +00:00
threads.test build: Support pthread builds without 'pthread_cancel' support (Android). 2014-07-04 15:52:53 +02:00
time.test Modify socket and time functions for wide strings 2009-08-23 09:29:45 -07:00
tree-il.test Merge branch 'stable-2.0' 2014-09-30 03:50:47 -04:00
types.test (system base types) knows about variables 2015-02-17 10:58:29 +01:00
unicode.test Add (ice-9 unicode) module 2014-09-29 21:54:14 -04:00
vectors.test add vector-move test cases 2011-02-14 20:21:04 +01:00
version.test Relax the `(version)' test. 2010-05-30 22:39:23 +02:00
vlist.test Merge remote-tracking branch 'origin/stable-2.0' 2013-03-28 05:09:53 -04:00
weaks.test Merge commit '9b5da400dd' 2014-02-07 15:36:06 +01:00
web-client.test Generic port facility provides buffering uniformly 2016-04-06 19:21:44 +02:00
web-http.test web: Be less strict when parsing entity tags. 2016-01-07 10:53:57 +01:00
web-request.test fix web-request.test 2011-07-18 10:37:46 +02:00
web-response.test Merge branch 'stable-2.0' 2014-01-21 03:57:04 -05:00
web-uri.test web: Location header is URI-reference; better URI-reference support 2014-11-01 15:36:56 +01:00