Commit Graph

160 Commits

Author SHA1 Message Date
Lasse R.H. Nielsen 973a1a0219 Remove uses of upper-case constants in remaining SDK code.
This includes Fasta, tools and observatory, so the checked-in SDK must
have the lower-case constants.

Change-Id: I8380ad041ad058f7d02ae19caccfecd434d13d75
Reviewed-on: https://dart-review.googlesource.com/50201
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-04-16 16:11:57 +00:00
Mike Fairhurst dcdd12cc1a Fix fasta progress checking script: collect stdout from passing tests
Required a new flag for test.py; passing tests may have multiple test
cases and to collect that we need the stdout. So you can now pass
--print_passing_stdout to get that.

Parse the result, doing some dances to handle

MM:SS +PP -FF Some tests failed

vs

MM:SS +PP All tests passed!

With even an extra line-ending in the latter case.

Bug:
Change-Id: Ic0b5591b4867508edd3f23a61a7764aa88762be6
Reviewed-on: https://dart-review.googlesource.com/24701
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-08 00:21:29 +00:00
Bob Nystrom 1e6e72af79 Refactor some code around TestSuite.
I was working on adding support for treating RuntimeError as Pass if
runtime == none and I noticed a lot of dead or redundant code, so
cleaned it up some.

Change-Id: I0be451a7075d99bc07d1407883861fb06d777c02
Reviewed-on: https://dart-review.googlesource.com/22800
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-22 16:56:17 +00:00
Erik Ernst 40b6741778 Adds support for syntax error in tests to test.py.
This CL modifies the Dart source used from test.py such that it takes
`syntax error` into account as an expected outcome in test files (so
that we can have `//# 01: syntax error` with a similar meaning as
`//# 01: compile-time error`).

For all tools except the spec_parser, `syntax error` is the same
outcome as `compile-time error`; that is, nobody else will see the
difference.

For the spec_parser, `syntax error` is the outcome where parsing has
failed; `compile-time error` is taken to mean some other compile-time
error, i.e., the spec_parser is expected to _succeed_ when the
expected outcome is `compile-time error`.

Test files in language and language_2 have been adjusted to use the
outcome `syntax error` where appropriate.

The status files in language and language_2 for the spec_parser have
been adjusted such that they fit all the new `syntax error` outcomes
in test files.

Other status files have been adjusted in a few cases where tests were
corrected (because a compile-time error which was clearly not intended
to be a syntax error turned out to be caused by a typo, which means
that the actual compile-time error has never been tested).

The spec grammar Dart.g was adjusted in a few cases, when some bugs
were discovered. In particular, the treatment of Function has been
changed: It is now known by the parser that Function does not take
any type arguments. This makes no difference for developers, because
they cannot declare a type named Function anyway, but it means that
a number of tricky parsing issues were resolved.

Dart.g was also adjusted to allow `qualified` to contain three
identifiers, which is an old bug (preventing things like metadata on
the form `@p.C.myConst`).

Change-Id: Ie420887d45c882ef97c84143365219f8aa0d2933
Reviewed-on: https://dart-review.googlesource.com/18262
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2017-11-06 08:56:09 +00:00
Morten Krogh-Jespersen 27ddeb0b2a Update test.py to write an empty result.log when all tests are known.
This will make sure that the result.log file will always exist, even if no tests
are run. This also means that the delete result.log step for recipes can be
removed.

Bug:
Change-Id: Idf097acb990b047146a874715f992657deacf65a
Reviewed-on: https://dart-review.googlesource.com/16483
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Morten Krogh-jespersen <mkroghj@google.com>
2017-10-26 10:38:31 +00:00
Bob Nystrom 746336ba10 Improve test output:
- Clean up browser test failure output. Instead of barfing a giant blob
  of JSON, show just the runtime error and its stack trace. In verbose
  and on the buildbots, it still shows all the events, but even there
  they are formatted nicely.

- Don't redundantly show the failure summary when most of the output is
  already failure text.

- Color the failure summary end message.

Change-Id: I49724b204be55a297fc5e723b80b32e0e00748f0
Reviewed-on: https://dart-review.googlesource.com/15767
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2017-10-23 19:03:48 +00:00
Bob Nystrom c341575a53 Colorize section headers and slightly clean up test output.
Of course, if you're not using the color formatter, it stays uncolored.
But this gets rid of some unnecessary empty lines and section headers
that have no content.

Change-Id: I5b83345c583b79468af84f4e67a12ee757a3105f
Reviewed-on: https://dart-review.googlesource.com/14720
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2017-10-19 21:45:57 +00:00
Zachary Anderson 6140210df2 [Fuchsia] Don't refer to python in the test harness
There's no python on Fuchsia.

Change-Id: I9fcb64d6ec625a79c00860104512211ebe66f330
Reviewed-on: https://dart-review.googlesource.com/9784
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-09-29 21:03:54 +00:00
Morten Krogh-Jespersen fb0b2c5a73 Adding info about negative tests to result log
Bug:
Change-Id: Ic868ca637477bce4a7857304ce6b23aa4ea30817
Reviewed-on: https://dart-review.googlesource.com/8420
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Morten Krogh-jespersen <mkroghj@google.com>
2017-09-26 10:19:31 +00:00
Morten Krogh-Jespersen a90bb3a104 Revert "Revert "Adding option to print out status files for a configuration.""
This reverts commit f50c2c2b6a.

Bug:
Change-Id: I895c1e498b58999127ebb6d7656c12fba1cb338b
Reviewed-on: https://dart-review.googlesource.com/5422
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Morten Krogh-jespersen <mkroghj@google.com>
2017-09-13 12:52:18 +00:00
William Hesse f50c2c2b6a Revert "Adding option to print out status files for a configuration."
This reverts commit 0fcffaaeb5.

Bug:
Change-Id: I8852ce88c190e420615314b7fe95bf9d69a5f8d1
TBR=mkroghj@google.com
Reviewed-on: https://dart-review.googlesource.com/5361
Reviewed-by: William Hesse <whesse@google.com>
2017-09-13 09:11:32 +00:00
Morten Krogh-Jespersen 0fcffaaeb5 Adding option to print out status files for a configuration.
This will help other tools to use the same status files at test.py
uses.

Bug:
Change-Id: Ib01d0c8368089a35682d0d79e257b8df01e54de6
Reviewed-on: https://dart-review.googlesource.com/3941
Reviewed-by: William Hesse <whesse@google.com>
2017-09-13 08:30:38 +00:00
Morten Krogh-Jespersen 955ce3e05b Removing compilationSkipped from result json log.
Change-Id: Ifc4a0d64a15f2de3f65808a40fb8cf8275937982
Reviewed-on: https://dart-review.googlesource.com/3600
Reviewed-by: William Hesse <whesse@google.com>
2017-09-06 13:27:22 +00:00
Morten Krogh-Jespersen 70e3e8aac1 Added json result of test output to output debug directory.
R=whesse@google.com

Review-Url: https://codereview.chromium.org/3005013002 .
2017-09-04 10:13:27 +02:00
Bob Nystrom 58b96b7e60 Don't print "Necessary status file updates:" if there are none.
Also cleaned up the surrounding code to be more idiomatic.

R=jcollins@google.com

Review-Url: https://codereview.chromium.org/3007583002 .
2017-08-28 16:31:23 -07:00
Bob Nystrom 796eb21071 Move the status file parser into its own package.
This required munging a bit of test.dart code too to tease out some
dependencies, but the changes are minor. I considered moving all of
test.dart out into a package and making the status file library a
public one that other packages in the repo could import but this seemed
like the less intrusive change.

R=bkonyi@google.com

Review-Url: https://codereview.chromium.org/2984203002 .
2017-07-25 15:29:59 -07:00
Bob Nystrom a6ca718e98 Simplify Command classes.
- Get rid of separate CommandBuilder class and singleton pattern. It
  was being passed around explicitly even though half of the places
  that received a CommandBuilder as a parameter still directly called
  CommandBuilder.instance instead of using it.
- Get rid of Command caching. As far as I can tell, it makes no
  measurable difference in runtime performance or memory usage. Even
  with a large invocation of a lot of configurations and tests, the
  Command classes don't seem to be a significant use of memory.
- Shorten the factory names. "get" adds no value, and we know it
  returns a "Command" since it's on Command.

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2933973002 .
2017-06-15 14:19:03 -07:00
Bob Nystrom 19cb0cafb7 Simplify test_suite.dart.
- Get rid of baseCommand, which is only ever an empty list.
- Move some utility classes out of the giant test_suite.dart.

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2915843003 .
2017-06-09 16:46:49 -07:00
Bob Nystrom 7e2d9ac85d Revert "Revert "Replace the configuration map with a typed object.""
This reverts commit 8bada4873a.

R=nweiz@google.com

Review-Url: https://codereview.chromium.org/2919573003 .
2017-05-31 15:39:23 -07:00
Bob Nystrom 8bada4873a Revert "Replace the configuration map with a typed object."
This reverts commit 06f75fe5cd.

Review-Url: https://codereview.chromium.org/2914893003 .
2017-05-31 15:08:21 -07:00
Bob Nystrom 06f75fe5cd Replace the configuration map with a typed object.
This is a pretty massive change but my hope is it will make
test.dart easier to maintain going forward. Instead of
passing around a stringly-typed Map<String, dynamic> all
throughout the program, we parse the options and then create
a Configuration object that has typed getters for all of the
various bits of configuration data.

This is a little tedious because it means declaring a new
option requires also declaring a corresponding field in the
Configuration class and passing it through the constructor.
I think it's worth it.

Also, enum-like configuration properties like architecture
and runtime now have their own classes as well. Moved a
bunch of stuff from TestUtil into those classes now that
there is an object to hang those methods off of.

In the process, I found a few typos in string literals where
the code wasn't correctly looking up a configuration
property.

Added more sanity checking and validation to status file
parsing. You will get an error at parse time if you try to
refer to a variable that isn't in the whitelist of known
variables. Also, you'll get an error if you try to compare
a variable to a value that it isn't expected to have.

Many other small-scale cleanups.

Aside from the status file validation, this should behave
mostly the same as current test.dart except that tests
may be enqueued in a slightly different order. The
rewritten code for expanding configurations iterates
through the architecture, runtime, etc. options in a
slightly different order.

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2901923003 .
2017-05-31 14:47:31 -07:00
Bob Nystrom 7ce978bf91 Tighten types in test.dart even more.
This removes all implicit casts and many implicit uses of dynamic. It
adds a gratuitous number of explicit "as" casts and arguably makes the
code worse.

This is an interim step towards replacing the big configuration map
with an actual typed object. These "as" casts should help catch places
where the configuration object is being used and where the code will
need to be changed to use a new object.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2903703002 .
2017-05-30 14:02:24 -07:00
Bob Nystrom 92267afc66 Refactor and clean up the status file parsing code. - Make the parser less error tolerant. The expression parser used to ignore any unrecognized tokens, which means a status like "RuntimeError CompileError" (not the missing comma) was parsed as simply "RuntimeError", which seems bad. Now it reports an error. Fixed a couple of status files that thought they were setting statuses that they weren't (!).
- Separate out parsing a status file from applying the environment to
  determine which sections are active. This makes it possible to, for
  example, generate expectation sets for multiple environments without
  having to reparse each time.

- Simplify expression parsing. Remove set expressions since they weren't
  used for anything useful. A test's expectations are a simple
  comma-separated list and don't need anything beyond that. Merge
  Scanner and Tokenizer since the latter was a glorified function.

- Make more names private so that it's clearer what's used outside of
  various libraries.

- Generally modernize the style.

- Add *lots* of documentation.

Again, there should be no behavioral changes. I ran:

  ./tools/test.py -m release,debug -c none,dart2js,dart2analyzer -r none,vm,d8 corelib

Before and after the change and verified that the output was the same
(aside from timing).

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2891753003 .
2017-05-18 12:42:52 -07:00
Bob Nystrom c269ef53a5 Revert "Re-apply status file parser changes from 0b7728da1bef08c1c1e092005d9fd8c8bff5fa6c."
This reverts commit a881aed354.

TBR.

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2888213002 .
2017-05-17 13:45:40 -07:00
Bob Nystrom a881aed354 Re-apply status file parser changes from 0b7728da1b.
R=whesse@google.com

Review-Url: https://codereview.chromium.org/2880203004 .
2017-05-17 13:04:35 -07:00
Bob Nystrom 01e5b1b40c Revert "Refactor and clean up the status file parsing code."
This reverts commit 0b7728da1b.

R=nbosch@google.com

Review-Url: https://codereview.chromium.org/2885623002 .
2017-05-15 15:58:05 -07:00
Bob Nystrom 0b7728da1b Refactor and clean up the status file parsing code.
- Make the parser less error tolerant. The expression parser used to
  ignore any unrecognized tokens, which means a status like
  "RuntimeError CompileError" (not the missing comma) was parsed as
  simply "RuntimeError", which seems bad. Now it reports an error.
  Fixed a couple of status files that thought they were setting statuses
  that they weren't (!).

- Separate out parsing a status file from applying the environment to
  determine which sections are active. This makes it possible to, for
  example, generate expectation sets for multiple environments without
  having to reparse each time.

- Simplify expression parsing. Remove set expressions since they weren't
  used for anything useful. A test's expectations are a simple
  comma-separated list and don't need anything beyond that. Merge
  Scanner and Tokenizer since the latter was a glorified function.

- Make more names private so that it's clearer what's used outside of
  various libraries.

- Generally modernize the style.

- Add *lots* of documentation.

Again, there should be no behavioral changes. I ran:

  ./tools/test.py -m release,debug -c none,dart2js,dart2analyzer -r none,vm,d8 corelib

Before and after the change and verified that the output was the same
(aside from timing).

BUG=
R=whesse@google.com

Review-Url: https://codereview.chromium.org/2875203005 .
2017-05-15 15:42:15 -07:00
Bob Nystrom e0180925f6 Tighten up a bunch of types in test.dart.
This doesn't get rid of all implicit dynamic and casts, but it covers
many of them.

Also did some minor modernization when I noticed it:

- Using "var" for local variables where inference does the right thing.
- camelCase for variable names.
- More collection literals.

There are (or should be!) zero behavioral changes.

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2863253002 .
2017-05-15 15:26:40 -07:00
William Hesse d6ca1a5def Report IE11 timeouts in debug log, not as failing tests.
BUG=https://github.com/dart-lang/sdk/issues/28955
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2875683002 .
2017-05-11 11:18:42 +02:00
Bob Nystrom 0592404cc3 Re-add missing space in test failed message.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2866273002 .
2017-05-09 11:16:42 -07:00
Bob Nystrom 9cd2f83ef7 Small-scale clean ups in test.dart, mainly around test_progress.
Stuff like:

- Use core lib methods like padLeft() now that they exist.
- Use collection literals (!).
- Use getters where appropriate.
- Make Formatter enum-like since it has no interesting instance state.

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2855073002 .
2017-05-03 16:50:45 -07:00
Bob Nystrom 53b2ef34ca Move test.dart into testing/dart.
This is mainly so that all of the code relating to test.dart is in one
directory tree so things like "Find All Usages" work a little better.
It felt weird to me to have a .dart file two directories up importing a
bunch of stuff within "testing/dart/".

Also cleaned up the affected code since it could use a little love. I'm
working on getting test.dart running DDC tests, but from poking around,
it seems like it could use some housekeeping as well.

R=vsm@google.com, whesse@google.com

Review-Url: https://codereview.chromium.org/2848103002 .
2017-05-02 16:48:28 -07:00
Jacob Richman 119b2d58ce Format all files under tools and utils directory.
BUG=
R=terry@google.com

Review-Url: https://codereview.chromium.org/2827793002 .
2017-04-20 09:08:31 -07:00
Martin Kustermann affb786582 Enable support for coredump archiving on windows
BUG=https://github.com/dart-lang/sdk/issues/28648
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2692883002 .
2017-02-14 16:34:31 +01:00
Bob Nystrom e826303741 Get rid of --use-repository-packages and --use-public-packages.
The former doesn't seem to tell us anything useful, and is broken. The
latter is no longer needed as a flag without the former. The pkgbuild
suite implies it and other suites don't support it.

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2673133002 .
2017-02-06 10:40:53 -08:00
Vyacheslav Egorov e8f456edd5 Buildbot: Only archive core dumps from unexpected crashes.
Change UnexpectedCrashDumpArchiver to generate coredumps file in the current
directory. Each line of this file specifies a core and a binary to be
uploaded in the following format:

              test-name,core-file,binary-file

CoreDumpArchiver reads this file and uploads the first 10 crash dumps.

R=kustermann@google.com
BUG=

Review-Url: https://codereview.chromium.org/2645963004 .
2017-01-20 17:44:51 +01:00
Vyacheslav Egorov 84820ba05e Fix analyzer warnings in tools/testing/dart/test_progress.dart
R=kustermann@google.com
BUG=

Review-Url: https://codereview.chromium.org/2642153002 .
2017-01-19 17:49:52 +01:00
Vyacheslav Egorov 6c9ca0cd2b Buildbot: Change --copy-crashdumps to do the actual archiving to CloudStorage.
This flag now both enables core dump collection by setting appropriate rlimits
and takes care of archiving cores and crashed binaries.

R=kustermann@google.com

Review-Url: https://codereview.chromium.org/2640093005 .
2017-01-19 17:25:39 +01:00
Vyacheslav Egorov e9483132ed Revert "Buildbot: Change --copy-crashdumps to do the actual archiving to CloudStorage."
This reverts commit dec352c1ac.

Bots are completely broken

BUG=
TBR=kustermann@google.com

Review-Url: https://codereview.chromium.org/2640823005 .
2017-01-19 16:17:23 +01:00
Vyacheslav Egorov dec352c1ac Buildbot: Change --copy-crashdumps to do the actual archiving to CloudStorage.
This flag now both enables core dump collection by setting appropriate rlimits
and takes care of archiving cores and crashed binaries.

BUG=
R=kustermann@google.com

Review-Url: https://codereview.chromium.org/2644593002 .
2017-01-19 16:13:28 +01:00
Asger Feldthaus 902d9ee7e8 Do some housekeeping in tools/testing/dart
- Fix dartanalyzer warnings about unused variables and missing returns
- Remove trailing whitespace
- Add a dummy pubspec.yaml so editors recognize it as a Dart project

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2633213003 .
2017-01-17 16:02:45 +01:00
William Hesse 523ceac525 Fix type error in test.dart script.
BUG=
R=eernst@google.com

Review URL: https://codereview.chromium.org/2264003002 .
2016-08-22 11:50:05 +02:00
Aleksei Semenov c9081ea4df initial support for running tests against dart analyzer in strong mode (#27033) 2016-08-09 10:58:15 +02:00
William Hesse 7e9a9804d9 Add suppression to test.dart for flaky content_shell crashes
BUG=https://github.com/dart-lang/sdk/issues/26739
R=kustermann@google.com

Review URL: https://codereview.chromium.org/2081173002 .
2016-06-27 14:44:11 +02:00
William Hesse c63b10b611 Format the test scripts in /tools/testing/dart using dartfmt 1.16.0-dev.3.0.
R=ahe@google.com

Review URL: https://codereview.chromium.org/1859973002 .
2016-04-06 14:49:18 +02:00
kevmoo@google.com 9df5e56e9f tools: fix break in test_progress
TBR

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42832 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-13 19:46:24 +00:00
kevmoo@google.com 3fdea4f366 Outputing comma-separated report with percentages
Merged:

http://crrev.com/832583003
http://crrev.com/843553004

R=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42831 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-13 19:27:47 +00:00
kevmoo@google.com 8cd05a8b90 tools: Refactored SummaryReport and move it to its own library
R=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42826 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-13 17:46:52 +00:00
kevmoo@google.com 47de553025 tools/testing: move code into individual libraries
R=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42108 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-04 15:32:57 +00:00
kevmoo@google.com 61b056964a tools: removed unused members, tiny cleanup
R=ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42106 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-04 13:56:14 +00:00