dart-sdk/tests/standalone/io/dart_std_io_pipe_test.sh
sgjesse@google.com e40ce105af Fix a number of issues with determining the type of stdio
* Fix checked mode exception when _getSocketType returns an OSError
 * Treat any character device as terminal (this includes /dev/null)
 * Fix detecting of file redirection af file
 * Don't turn an unkonwn device type into an OSError (wth value for an unknown was -1)

Expanded an existing test to catch some of this.

R=ager@google.com

BUG=https://code.google.com/p/dart/issues/detail?id=9637

Review URL: https://codereview.chromium.org//13636003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20960 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 11:13:24 +00:00

18 lines
693 B
Bash
Executable file

#! /bin/bash
# This script expects the following arguments
# $1: Path to dart executable
# $2: Path to dart echoing script
# $3: Argument to dart echoing script (0, 1 or 2)
# $4: File for output from piping stdout and stderr
# $5: File prefix for output from redirecting stdout and stderr to a file.
# $6: Stdio type of stdin
# Test piping and stdio file redirection.
echo "Hello" | $1 $2 $3 pipe pipe pipe 2>&1 | cat - > $4
$1 $2 $3 $6 file file < $4 > $5.stdout 2> $5.stderr
$1 $2 $3 $6 file file < $4 >> $5.stdout 2>> $5.stderr
$1 $2 $3 $6 terminal terminal < $4 > /dev/null 2> /dev/null
$1 $2 $3 $6 terminal pipe < $4 2>&1 > /dev/null
$1 $2 $3 $6 terminal terminal < $4 > /dev/null 2>&1