Commit Graph

2501 Commits

Author SHA1 Message Date
sgjesse@google.com 3d8e19a43f Simulate data and close callbacks on a synchronous file input stream
A input stream obtained from File.openInputStream() can now be used
with code that expects data and close callbacks.

Before the input stream obtained from File.openInputStream() did not
generate any callbacks.

R=ager@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//8819021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2166 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-07 08:57:31 +00:00
sgjesse@google.com 8a78fd878e Skip test ChunkedStreamTest on dartium
TBR=ager@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//8839006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2165 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-07 08:45:36 +00:00
sgjesse@google.com 731e8d91af Add chunked input stream
The chunked input stream can deliver data fron an input stream as
fixed sized blocks of data.

R=ager@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//8818009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2163 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-07 08:00:19 +00:00
ager@google.com 456d63c6ab Add support for client/dartc compilation only tests.
These tests do not fit in that nicely. They have an interesting
way of finding out what are test cases. They use the .dart
suffix in the status file.

Implement directory createTempSync.

R=whesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8799009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2067 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-05 13:34:12 +00:00
whesse@google.com df0f131782 Fix standalone/FileTest
BUG=dart:657
TEST=standalone/FileTest

Review URL: http://codereview.chromium.org//8776047

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2020 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-02 13:57:23 +00:00
sgjesse@google.com 775438288d Add line handler to string stream
This adds the line handler to the string stream to provide callbacks
when a line is known to be available.

This change also refactors parts of the string stream to avoid
converting decoded char codes to a string before checking for line
break sequences. With this change the string decoder tracks all line
breaks.

There is still room for improvement as e.g. the coping of the list of
char codes when reading lines can be avoided by using anoher offset.

R=ager@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//8772008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2016 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-02 11:59:02 +00:00
ager@google.com 3bf558018e Allow single-dash options to be specified without a space before value.
./tools/test.dart -mdebug,release

Make the patterns given to the test script more restrictive. A pattern
has to specify the test suite as the first component. The rest is used
as a pattern on all tests within that suite:

./tools/test.dart -mrelease leg co19/leg

will run the leg tests and the co19 tests that contains the substring
'leg' somewhere in the full path name of the test.

R=whesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8772007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2014 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-02 11:50:05 +00:00
ager@google.com 2995930544 Allow varying case in the expected outcome (Pass, PASS).
R=whesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8775007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1981 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 13:18:30 +00:00
ager@google.com a7e26a2575 Fix HTTP sample implementation to actually wait for connections before attempting to write.
R=sgjesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8776001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1971 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 11:44:29 +00:00
iposva@google.com eb1b2880bb - "#library warning" fixit: Add #library where it could be expected.
Review URL: http://codereview.chromium.org//8764019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1968 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 05:56:26 +00:00
dgrove@google.com 75eaa7d815 Add '#library' to tests that need a #import or #source.
Review URL: http://codereview.chromium.org//8764018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1967 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-01 05:54:22 +00:00
ager@google.com 38c6bf8659 Support batch running of dartc tests.
R=whesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8729030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1890 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-29 12:38:14 +00:00
sgjesse@google.com 286d5dff90 Change handling of accepting socket connections
The accept method have been removed from the ServerSocket class and
the signature for the connectionHandler callback have been changed to
provide the accepted socket as an argument.

This is to avoid the possibility for accept to return null even in the
case of pending connection. This could happen if an error like EAGAIN,
EWOULDBLOCK and EINTR was returned by it OS accept call and previously
there was no way of propagating this without returning null from the
Dart call to accept.

R=ager@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//8726031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1889 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-29 12:02:01 +00:00
sgjesse@google.com 45fe59bcef Refactor some of the duplicated code in the tests using a socket server
This is a first step in making these tests easier to understand.

R=ager@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//8662038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1838 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-24 12:11:04 +00:00
ager@google.com fed5e6d99c Add truncate operation to File API.
R=whesse@google.com
BUG=264
TEST=

Review URL: http://codereview.chromium.org//8679005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1800 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 15:42:20 +00:00
sgjesse@google.com 8ecb231e80 Fix running process tests on Windows
TBR=ager@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//8679008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1799 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 15:32:39 +00:00
sgjesse@google.com b0e17c1cad Fix refactoring bug
TBR=ager@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//8676011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1798 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 15:15:20 +00:00
sgjesse@google.com d7c8c1f1e4 Fix a number of issues with the process handling
1. Ignore the signal SIGPIPE on Linux and Mac OS

When reading from or writing to a closed pipe the signal SIGPIPE
is raised. The default handling of this is to terminate the
program. When signal SIGPIPE is ignored the read and write
returns EPIPE.

2. Wrong return type for stdio getter

3. When there is an error on a socket mark it as closed

4. Mark the pipe used for process exit status as a one way pipe

5. Add tests to test stdin, stdout and stderr in Dart scripts

R=ager@google.com

BUG=dart:536, dart:454
TEST=

Review URL: http://codereview.chromium.org//8662006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1793 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 14:49:18 +00:00
ager@google.com 5d7ee32c6e Update test scripts to deal with current VM behavior on optional constructor arguments.
Find binaries in tests based on the platform we are running on.

R=sgjesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8662004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1779 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 10:22:48 +00:00
whesse@google.com f40da67d2b Add Directory.createTemp() to asynchronously create a temporary directory.
BUG=
TEST=

Review URL: http://codereview.chromium.org//8588029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1741 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-22 13:06:39 +00:00
iposva@google.com ea500c9260 - Remove uses of the dart_bin binary.
Review URL: http://codereview.chromium.org//8597016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1725 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-21 23:50:35 +00:00
ager@google.com ea78edb762 Attempt to fix buildbot.
Having multiple tests write and delete the same file is not such
a great idea. :-)

R=whesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8549021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1655 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-18 13:11:08 +00:00
ager@google.com eb2ed9e25f Implement delete on File objects.
R=whesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8598011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1652 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-18 12:27:56 +00:00
ager@google.com 0bbe9566c6 Enable language and isolate tests using the dart test runner.
Refactor the test_config.dart files. Have a standard implementation
of a test suite that can be easily customized to cover all the
current suites.

R=whesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8589020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1611 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-17 12:25:01 +00:00
ager@google.com 0b8097c578 Start extracting common test_config.dart functionality into a utility library.
R=whesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8574052

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1607 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-17 09:39:13 +00:00
ager@google.com 7124c5046b Test for immutable Lists in ListSet API methods.
Using the file and socket API it was possible to modify immutable
arrays.

R=sgjesse@google.com,turnidge@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8575004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1604 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-17 06:57:39 +00:00
ager@google.com c4fb2b2f4d Implement setPosition on File to seek to a byte position.
R=sgjesse@google.com
BUG=dart:263
TEST=standalone/FileTest

Review URL: http://codereview.chromium.org//8578003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1573 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-16 15:50:55 +00:00
ager@google.com 17c3c9b8c2 Optimize the processing of test options.
Read the entire file in one go and find all matches of the regexps.
This reads the file with the assumption that one byte is a char.
For the things we are looking for that will be ok.

No need to pass special options to get a larger new space. We
run corelib, standalone and co19 in roughly 10sec on my machine.
With the python version we are at 6sec.

R=whesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8486009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1569 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-16 14:48:44 +00:00
ager@google.com 2b62a139f2 Enable co19 test suite on dart test scripts.
Updated the TestExpectations class to be able to deal with the
odd matching rules that are used for co19.

Currently we are using a lot of memory when running all of these
tests. I have optimized the test expectation part quite a bit.
The thing that seems bad now if the processing of all the lines
of every simple test to find DartOptions. We need to work on that.

R=whesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8539044

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1563 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-16 12:27:06 +00:00
sgjesse@google.com 5950638350 Better handling of stdin/stdout/stderr
When using stdout/stderr it is no longer necessary to explicitly
close the streams for the program to terminate. The automatic
close is handled by always closing the associated receive port
for write only streams when not waiting for any events. If a
close or error handler is installed for stdout/stderr these will
still keep the program alive.

For stdin better handling of the difference between sockets and
pipes have been immplemented. As a special case for stdin when
reading from a terminal the a POLLIN signal with 0 available
bytes is treated as end-of-file. This will trigger when pressing
ctrl-d in a terminal as POLLHUP is not set in that situation.

R=ager@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//8533005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1507 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-14 14:47:58 +00:00
whesse@google.com 9873986daf tools/test.dart: Enable // DartOptions= lines in Dart test runner.
BUG=
TEST=tools/test.dart

Review URL: http://codereview.chromium.org//8565006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1503 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-14 12:28:54 +00:00
ager@google.com 211968eb7a Implement test selection.
Make it very simple and flexible. I don't think we need to make
it more restrictive than this.

R=whesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8566001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1502 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-14 11:28:54 +00:00
whesse@google.com 29294f393b tools/test.dart: Handle VMOptions lines in test files.
BUG=
TEST=tools/test.dart

Review URL: http://codereview.chromium.org//8536013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1461 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 14:44:41 +00:00
ager@google.com 1191c37e56 Enable frog testing components.
Respect timeout command-line option.

Use option names with underscores understood by all components.

Improve compact progress report using stdout access.

R=whesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8537010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1460 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 14:08:07 +00:00
whesse@google.com 636a5d6df7 tools/test.dart: Implement --checked option.
BUG=
TEST=tools/test.dart

Review URL: http://codereview.chromium.org//8537009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1455 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 11:44:06 +00:00
ager@google.com 6b73da258c Implement 'compact' progress indicator.
At this point it is not that compact because print always prints
a newline and therefore we cannot reuse the same line in the output.
I will update that when we have access to stdout stream.

Removed asserts that fail when test script is run from runtime
directory.

Removed debugging output from status file parsing.

R=whesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8523009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1452 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 10:24:02 +00:00
ager@google.com 5d40fb2a9f Fix type mismatch errors. Environments do not only contain strings.
R=whesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8539009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1451 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 09:37:08 +00:00
ager@google.com 187e1cd2ab Use the configuration for determining the binary to use for testing.
So far supporting components vm and dartc.

Also, use the actual configuration for status file parsing.

R=whesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8540002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1450 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 09:27:51 +00:00
sigmund@google.com e024570e01 Adding frogium: a frog-chromium architecture that runs tests in chromium that
were compiled with frog.

Review URL: http://codereview.chromium.org//8523024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1440 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 02:07:02 +00:00
iposva@google.com 57a14228e3 - Don't run meaningless tests.
Review URL: http://codereview.chromium.org//8526021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1435 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 00:28:27 +00:00
whesse@google.com 02b001fbaf tools/test.dart: Read test expectations from the status file, and pass them to the test runner.
BUG=
TEST=tools/test.dart

Review URL: http://codereview.chromium.org//8514003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1407 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-10 17:13:45 +00:00
ager@google.com a427f80ccc Getting started on options parsing.
Support the most common options. So far only the --tasks/-j option
is actually used.

R=whesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8508054

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1405 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-10 16:14:06 +00:00
ager@google.com 9c4626a481 Increase TestRunnerTest timeout to two seconds.
There has been one timeout (debug, checked) because it took 1.1 seconds.

R=sgjesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8508050

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1385 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-10 07:51:20 +00:00
whesse@google.com 55ad9b0e7b Make tools/test.dart read standalone.status status file when running tests.
BUG=
TEST=tools/test.dart

Review URL: http://codereview.chromium.org//8507010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1358 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-09 15:50:39 +00:00
ager@google.com c7125db824 Simplify SIGCLD handler on linux and mac.
Handle all dead processes on sigal. This avoids hanging because we
missed some process terminations when they happened simultaneously.

R=sgjesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8506010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1354 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-09 13:35:14 +00:00
whesse@google.com 9eb9cd72c6 Disable TestRunnerTest in standalone.status, file bug 383.
BUG=383
TEST=standalone/TestRunnerTest

Review URL: http://codereview.chromium.org//8502022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1320 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-08 17:05:33 +00:00
whesse@google.com 70da4ae316 Add asynchronous test suite runner to Dart rewrite of test scripts.
BUG=
TEST=

Review URL: http://codereview.chromium.org//8492013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1316 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-08 15:21:47 +00:00
ager@google.com 0a03298fea Fix hang when opening sockets on ports that are not available.
Fix TimeoutTest to use free ports instead of using the same port
always. This does not work because tests are run in parallel and
we can have more than one instance of TimeoutTest running.

R=sgjesse@google.com,whesse@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8498009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1310 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-08 13:26:51 +00:00
sgjesse@google.com 37b6f2328a Fix handling of async IO from pipes on Windows
The handling of async IO on Windows wrongly casted everything to a socket connection. For named pipe based connections this caused reading of invalid memory.

Moved some of the functions to a common superclass and only call showdown for socket connections. For named pipe based connections the Dart part of the code will never send shutdown commands as named pipe based connections start out being closed in one direction and closing the other direction causes a close command.

R=ager@google.com

BUG=dart:363
TEST=

Review URL: http://codereview.chromium.org//8503006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1308 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-08 13:13:26 +00:00
jrgfogh@google.com a2ddc4243a Process tests work across platforms.
Review URL: http://codereview.chromium.org//8365032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1301 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-08 12:16:16 +00:00