summaryrefslogtreecommitdiff
path: root/t/io
Commit message (Collapse)AuthorAgeFilesLines
* revert recent changes to eintr.tDavid Mitchell2011-06-161-60/+10
| | | | | | | | | | | Revert "[perl #92828] eintr.t hangs on FreeBSD" This reverts commit 6e59d93aee950461947904b4f24a7f52c6c85f58. Revert "eintr.t: skip based on capability rather than OS" This reverts commit df375c6d048b938ecdeaecc7b264a7f1a190120a. My attempt to skip based on capability hung freebsd, and my attempt to fix that failed. Give up for now.
* [perl #92828] eintr.t hangs on FreeBSDDavid Mitchell2011-06-151-0/+29
| | | | | | | My commit df375c6d048b938ecdeaecc7b264a7f1a190120a attempted to convert t/io/eintr.t from OS-based skipping to capability-based skipping, but it only tested whether reads from pipes are interruptible. Some OSes (like FreeBSD) only hang on write; so probe for that too.
* [perl #90130] Allow CORE::* without feature.pmFather Chrysostomos2011-06-111-1/+6
| | | | | This commit allows feature.pm-enabled keywords to work with CORE::* even outside the scope of ‘use feature’.
* eintr.t: skip based on capability rather than OSDavid Mitchell2011-06-091-10/+31
| | | | | | | | | | | | | The t/io/eintr.t tests require read/write system to calls to be interruptible (to see if anything nasty can be done by the signal handler). Many platforms aren't interruptible, which means the tests would hang. We currently work round this by skipping based on a hard-coded list of OSes (such as win32, VMS etc). Change this so that we instead do an initial test as to whether they are interruptible, and if not, skip the whole test file.
* [perl #92258] <$fh> hangs on a glob copyFather Chrysostomos2011-06-051-1/+7
| | | | | | | | | Opening a file handle to \$glob causes assertion failures (under debugging) or hangs or other erratic behaviour without debugging. This might even crash in some cases. It never really worked properly, but it didn’t start hanging apparently until 5.12.2 and 5.14.0.
* skip t/io/eintr.t on production releasesDavid Mitchell2011-05-031-1/+6
| | | | | | | We already skip this test file on many platforms which don't have interruptible IO system calls. Extend this to unconditionally skip if it's an even (production) release version, so that we don't get false positives for other platforms we didn't know about.
* [perl #88420] BOM support on Windows broken in 5.13.11Jan Dubois2011-04-131-0/+14
| | | | | | | When Perl reads the script in text mode, then the tell() position on the script handle may include stripped carriage return characters. Therefore the file position after reading the first line of the script may be one larger than the length of the input buffer.
* Improve comment for skipped test on Solaris in t/io/eintr.tAndy Dougherty2011-03-221-0/+1
|
* Skip t/io/eintr.t for Solaris 8 as wellAndy Dougherty2011-03-221-1/+2
| | | | (see tickets perl #85842 and #84688).
* Read Perl code on Windows in text mode by default.Jan Dubois2011-03-161-0/+81
| | | | | | | | | | | | | | | | | | | | | | | We used to read Perl code in binary mode to make life easier for ByteLoder to include binary data in a source file. To maintain the illusion of text mode for the DATA handle the filehandle was transformed from binary mode to text mode when the parser reached the __END__ or __DATA__ tokens. This however never worked correctly, as the positions returned by tell(DATA) were still based on reading part of the stream in binary mode. And even worse, flushing all filehandles before calling system(), backticks, or fork() would actually reposition the DATA filehandle incorrectly, so future reads from it returned the wrong data. http://rt.perl.org/rt3/Ticket/Display.html?id=28106 contains several bug reports that are all related to this problem. The new t/io/data.t file contains the failing code samples from those bugs. This patch changes the default build option for Windows to text mode. ByteLoader will have to deal with this internally, e.g. by rewinding DATA and switching to binary mode itself.
* Rename test.pl's skip_all_without_extension to *_dynamic_extension().Nicholas Clark2011-03-122-4/+2
| | | | | | All callers were using it with dynamic extensions, and also had a skip_all_if_miniperl() for the same extension. Merge the two tests into one function to save repetition.
* Skip eintr.t on FreeBSD (see perl #85842 and #84688).Craig A. Berry2011-03-111-1/+3
| | | | | | | | | It appears that a larger PerlIO buffer combined with writing to a pipe triggers an alternate write mechanism in FreeBSD called a direct write, which is not interruptible by signals. That's somewhat speculative and has not been confirmed by someone with knowledge of FreeBSD internals, but we do know the test hangs, so it's best not to run it for now.
* Refactor 4 tests to use skip_if_miniperl().Nicholas Clark2011-03-071-2/+1
|
* Refactor the startup logic in fflush.t to use skip_all()Nicholas Clark2011-03-071-10/+5
| | | | | | | | | The tautological 3 way logic if (...) { print "1..7\n" } elsif (...) { print "1..7\n" } else { ... } had actually been in the test since it was first added in a43cb6b7285a7b60, although it was initially "1..4\n" in each block. Also use plan(), and set test.pl's idea of the current test before exiting.
* Refactor 5 tests to use skip_all(), instead of generating TAP locally.Nicholas Clark2011-03-072-10/+5
|
* Add skip_all_without_perlio() to test.pl, and use it in 8 tests.Nicholas Clark2011-03-076-17/+9
| | | | | It's a common idiom in the tests. This makes it easier to find, read, and remove.
* Ensure that t/io/{print,read,say}.t load Errno at BEGIN time.Nicholas Clark2011-03-063-7/+8
| | | | | | | | | If Errno is loaded after the compiler has parsed the C<exists &Errno::EBADF> later in the script, then the intent of that test is subverted - &Errno::EBADF does not exist, at least as far as the typeglob bound to that op is concerned, and the test for $! is skipped. I suspect that these have been skipping since the implementation of Errno was changed in 42607a60df6df19b in May 2010 to reduce its memory footprint by 55%.
* Tidy perlio_open.t, by using test.pl skip_all* functions where appropriate.Nicholas Clark2011-03-061-13/+3
| | | | This reduces the startup boilerplate code by more than half.
* Add skip_all_without_extension() to test.pl, for the common skip idiom.Nicholas Clark2011-03-061-3/+2
| | | | Use it in t/io/layers.t to skip if Encode is not built.
* Tidy t/io/layers.tNicholas Clark2011-03-061-16/+8
| | | | | | Skip under minitest using skip_all_if_miniperl(). skip_all() once rather than skipping every test if Encode is not built, or PerlIO is not available.
* Tidy t/io/crlf.tNicholas Clark2011-03-061-5/+4
| | | | | Skip a test under minitest using skip_if_miniperl(). Use eq(), like() and unlike() where appropriate, instead of ok().
* Tidy t/io/binmode.tNicholas Clark2011-03-061-15/+13
| | | | | | | Remove redundant C<use Config;> If C<find PerlIO::Layer 'perlio'> fails, use skip() rather than ok() to skip. Make the indenting on 2 inconsistent lines consistent with the rest of the file. Die if Errno can't be loaded, unless it's miniperl.
* Under minitest, tests requiring File::Spec->devnull(), as it may not be built.Nicholas Clark2011-03-061-24/+35
| | | | | Although File::Spec is pure Perl, it is part of the Cwd distribution, and that isn't built for minitest. So we can't rely on it.
* In t/ avoid using File::Spec for paths only used by Perl.Nicholas Clark2011-03-061-2/+1
| | | | | | All platforms Perl builds on can already support Unix-style paths (given that make_ext.pl is using them). This makes 7 more tests pass under minitest, which doesn't build File::Spec, because it's part of an XS module.
* Skip the test for #77684 under minitest, as it requires PerlIO::scalarNicholas Clark2011-02-231-1/+2
|
* In t/io/open.t, skip the tests for loading IO::File when running under miniperlNicholas Clark2011-02-211-1/+2
| | | | This is analogous to skipping all of t/op/iofile.t under miniperl.
* Add skip_all_if_miniperl() to test.pl, and use it in 6 test scriptsNicholas Clark2011-02-211-0/+1
| | | | All require dynamic loading to work, so all should be skipped under minitest.
* [perl #38456] binmode FH, ":crlf" only modifies top crlf layerLeon Timmermans2011-01-271-3/+15
| | | | | When pushed on top of the stack, crlf will no longer enable crlf layers lower in the stack. This will prevent unexpected results.
* Fix typos (spelling errors) in t/*.Peter J. Acklam) (via RT2011-01-071-1/+1
| | | | | | | # New Ticket Created by (Peter J. Acklam) # Please include the string: [perl #81916] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81916 >
* close the produced test file so win32 can unlink itTony Cook2010-12-281-0/+1
| | | | Previously runs would leave a GLOB(0x...) file in t/
* Replaced '1 while unlink' with 'unlink_all' in t/io/perlio.tBrad Gilbert2010-12-081-5/+5
|
* Replaced 'unlink' with 'unlink_all' in t/io/nargv.tBrad Gilbert2010-12-081-1/+1
|
* Replaced '1 while unlink' with 'unlink_all' in t/io/fs.tBrad Gilbert2010-12-081-1/+1
|
* Replaced '1 while unlink' with 'unlink_all' in t/io/argv.tBrad Gilbert2010-12-081-1/+1
|
* Skip t/io/eintr.t on Cygwin, too - hangsJerry D. Hedden2010-11-301-1/+1
|
* Filehandle method calls load IO::File on demandDavid Golden2010-11-292-1/+36
| | | | | | | | | | | | | | | | | | | | | When a method call on a filehandle would die because the method can not be resolved and L<IO::File> has not been loaded, Perl now loads IO::File via C<require> and attempts method resolution again: open my $fh, ">", $file; $fh->binmode(":raw"); # loads IO::File and succeeds This also works for globs like STDOUT, STDERR and STDIN: STDOUT->autoflush(1); Because this on-demand load only happens if method resolution fails, the legacy approach of manually loading an IO::File parent class for partial method support still works as expected: use IO::Handle; open my $fh, ">", $file; $fh->autoflush(1); # IO::File not loaded
* document why eintr.t needs to be skipped on Win32David Mitchell2010-11-291-0/+3
|
* disable t/io/eintr.t on windowsDavid Mitchell2010-11-281-1/+1
| | | | | Apperently it's causing smokers to hang, so skip until I find out what's happening.
* Skip eintr.t on VMS.Craig A. Berry2010-11-281-0/+5
| | | | | | | | It's doing select() on a pipe, but only sockets work with select(), and the read() on a pipe is not interruptible by an alarm. That's probably because our pipe implementation is doing mailbox reads at AST level but the alarm signal is also an AST and can't interrupt another AST at the same mode.
* Make PerlIO marginally reentrantDavid Mitchell2010-11-261-0/+126
| | | | | | | | | | | | | | | | | | | | | | Currently if an operation on a file handle is interrupted, and if the signal handler accesses that same file handle (e.g. closes it), then perl will crash. See [perl #75556]. This commit provides some basic infrastructure to avoid segfaults. Basically it adds a lock count field to each handle (by re-purposing the unused flags field in the PL_perlio array), then each time a signal handler is called, the count is incremented. Then various parts of PerlIO use a positive count to change behaviour. Most importantly, when layers are popped, the PerlIOl structure is cleared, but not freed, and is left in the chain of layers. This means that callers still holding pointers to the various layers won't access freed structures. It does however mean that PerlIOl structs may be leaked, and possibly slots in PL_perlio. But this is better than crashing. Not much has been done to give sensible behaviour on re-entrancy; for example, a buffer that has already been written once might get written again. Fixing this sort of thing would require a large-scale audit of perlio.c.
* localize $@ during binmode (RT#78844)David Golden2010-11-061-1/+0
|
* Added test for RT#78844David Golden2010-11-061-1/+9
|
* Use STDOUT in defout.t to suppress that ‘#foo’ under TEST/harnessFather Chrysostomos2010-10-291-5/+9
|
* Cleanup output from t/io/defout.t RT#78572Jerry D. Hedden2010-10-261-3/+4
| | | | | | | | | | t/io/defout.t pollutes the output of 'make test': t/io/defout....................................................$a; # write ok The attached patch fixes this.
* Revert "[PATCH] Cleanup output from t/io/defout.t RT#78572"Father Chrysostomos2010-10-261-4/+5
| | | | This reverts commit 4d2eb54d4d30c9c5b093de9a57c324d5551c58fe.
* [PATCH] Cleanup output from t/io/defout.t RT#78572Jerry D. Hedden2010-10-261-5/+4
| | | | | | | | | | | | t/io/defout.t pollutes the output of 'make test': t/io/defout....................................................$a; # write ok The attached patch fixes this. Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
* [perl #77810] Scalars vs globsFather Chrysostomos2010-10-241-8/+9
| | | | | | | | | | Stop *{} from returning globs with the SVf_FAKE flag on. It removes three tests from t/op/gv.t (that I added) that test buggy edge cases that can no longer occur. It also modifies tests in t/io/defout.t to keep them passing. I am not sure that test script serves any purpose any more.
* [perl #77684] Restore the 5.10/12 behaviour of open $fh, ">", \$glob_copyFather Chrysostomos2010-09-131-1/+11
| | | | | | | | | This restores the perl 5.10/12 behaviour, making open treat \$foo as a scalar reference if it is a glob copy (SvFAKE). It also fixes an existing assertion failure that the test now trig- gers. PerlIOScalar_pushed was not downgrading the sv before set- ting SvCUR.
* [perl #77492] open $fh, ">", \*glob causes SEGVFather Chrysostomos2010-09-011-1/+14
| | | | | PerlIO_layer_from_ref must not treat a real glob as a scalar. This function was not updated when SVt_PVGV was moved before SVt_PVLV.
* Restore errno if signal handler changes itLubomir Rintel2010-07-261-0/+30
| | | | | It's way too easy to forget to "local $!" in signal handlers and changing $! when signal hits between two ops is probably never useful.