Commit Graph

132 Commits

Author SHA1 Message Date
Bob Nystrom ba2e4aff24 Some minor clean-up in test.dart.
- Fix fuzzy arrow errors.
- Default the Dart repo URI so it doesn't always need to be explicitly
  set.
- Run dartfmt on everything.
- Move some members out of the garbage bin "TestUtils" class:
  - Move the stuff around the Dart repo directory to a new Repository
    class.
  - Move absolute() into Path where it belongs.
  - Move workingDirectory in Path since it is a Path.
  - Delete the random number stuff since it was apparently unused.

Change-Id: I3dab3a4f1713b7a749e64b6776149d05a0ce1b69
Reviewed-on: https://dart-review.googlesource.com/14502
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2017-10-19 19:05:58 +00:00
Jenny Messerly ef3ac59dd6 add a dartdevk command that compiles with the new front end
This ports a fairly large part of DDC's Analyzer-based code generator,
however most nodes are not supported yet.

The goal is to preserve all functionality of code that was ported,
except for deprecated features (e.g. mirrors, fuzzy arrows, libraryRoot).

Change-Id: I3b10d5773c7c10a740fa336720243b03c6b82529
Reviewed-on: https://dart-review.googlesource.com/10705
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-16 21:13:52 +00:00
Janice Collins 51cc9689b3 Remove corelib and corelib_strong and migrate last two remaining tests.
This includes a migration of linked_hash_map_from_iterable_test and
stacktrace_current_test, which were migrated without changes.

BUG=
R=rnystrom@google.com, whesse@google.com

Review-Url: https://codereview.chromium.org/3004073002 .
2017-09-01 08:11:15 -07:00
Jennifer Messerly 676cf46c44 Fix DDC buildbot so it is green
This is an attempt to get DDC's bot (https://travis-ci.org/dart-lang/sdk) green and restore test coverage, without affecting the Analyzer --strong buildbot. DDC and Analyzer can generally use the same status entries, as they are running nearly identical strong mode analysis. This fixes DDC's test builder to understand status codes in the same way analyzer does, as that was causing mismatch in statuses.

This does not fix the problem that we're skipping tests instead of recording the status. So there is a bit of test coverage lost, but it restores most of DDC's coverage. We can tackle the skips either in a follow up, or as we migrate tests from *_strong to *_2.

This is a partial revert of  "Revert status file changes from 58a6227198d2aa927df19f1b4862f8d0017d6da4" in commit 7be946cf3d.

Review-Url: https://codereview.chromium.org/2990213002 .
2017-08-02 19:57:56 -07:00
Jennifer Messerly 58a6227198 Use status files for DDC's presubmit script/travis bot
This only handles compile time errors & compiler crashes. It does not yet support status files at runtime, that is still hard coded in language_tests.js. Some preliminary support for runtime status is there, but it's not enabled yet.

This also updates *_strong.status to reflect current test behavior. It looks like those files have not been triaged in a while.

R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2987093002 .
2017-08-01 16:36:17 -07:00
Jennifer Messerly 925295d7af remove unittest as a test status, instead record this at test build time
this will help integrate with existing .status files

R=vsm@google.com

Review-Url: https://codereview.chromium.org/2991073002 .
2017-07-31 14:25:11 -07:00
Bob Nystrom f334284967 Squashed commit of the following:
commit 4ed5f6f9d34510c3f0d6a3e5db9f8bac3290e464
Merge: 075833b fb613c0
Author: Bob Nystrom <rnystrom@google.com>
Date:   Fri Jul 21 16:08:11 2017 -0700

    Merge branch 'master' into ddc-tests-2

commit 075833bbdb33d2642f4df1ca501805f0a97a96e7
Author: Bob Nystrom <rnystrom@google.com>
Date:   Thu Jul 20 18:08:25 2017 -0700

    Include migrated "_2" test directories in DDC's codegen_test.

    This required a couple of other changes too:

    - I renamed "not_yet_strong_tests.dart" to "compile_error_tests.dart"
      because it includes some tests that have been made strong mode clean,
      but still generate static errors due to bugs in analyzer or ddc.
    - Reworded the test failure messages to take the above into account.
    - I cleaned up the failure reporting code a bit. There was some
      redundancy and unreachable code.
    - Triaged the "_2" tests to mark the ones that are failing at compile
      time or runtime appropriately. Good news! The big integers tests
      compile now! Of course, they don't actually *run* correctly on the
      web...
2017-07-21 16:12:23 -07:00
Vijay Menon 9cbd5bdc2e Output errors for tests that fail to compile
This makes it easier to fix strong mode errors in tests.

R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2971443002 .
2017-07-05 09:37:14 -07:00
Jennifer Messerly d26bb56575 fix #27971, implement generic function RTTI
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2832913003 .
2017-04-21 15:40:44 -07:00
Vijay Menon 21c38e6c8c Various DDC fixes for windows
This gets most tests compiling and running on Windows.

Fixes #27450
Fixes #27797
Fixes #28752

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2833633002 .
2017-04-20 11:30:57 -07:00
Vijay Menon 1975c8431a Migrate async tests to strong
No modifications to the actual tests

R=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2802973005 .
2017-04-07 12:46:12 -07:00
Jennifer Messerly e4e7dffadb fix #29182, generate top level const fields lazily
This fixes an ordering issue, but also may help load time.

R=vsm@google.com

Review-Url: https://codereview.chromium.org/2797443007 .
2017-04-04 16:18:46 -07:00
Vijay Menon d8c8a7b327 Mark tests no longer expected crash
Brian: looks like these started working on a recent CL of yours.

TBR=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2769333003 .
2017-03-24 08:46:21 -07:00
Jennifer Messerly f021a7019b fixes #27586, prefer downwards context type in generic inference
fixes #27625, Object constraints were not tracked in inference
fixes #27933, pin return type from downwards inference

We now prefer to pick the bound (lower or upper) that had some information on, and it also improves inference error messages somewhat (still a ways to go).

The way this works is we now have a type representing an unknown type: ?. We use ? when performing downward inference steps, instead of `dynamic`. This allows more accurate tracking of type constraints.

For example: given:

    var x = await Future.wait([a, b]);

Future.wait<T>'s argument type is Iterable<Future<T>>. Since we didn't know T, we previously pushed down Iterable<Future<dynamic>>. The dynamic caused loss of information. Now we push down Iterable<Future<?>>, allowing us to infer the right type there.

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

Review-Url: https://codereview.chromium.org/2456803004 .
2017-03-17 16:59:56 -07:00
Vijay Menon 406a82723f Fix expectations
TBR=rnystrom@google.com

Review-Url: https://codereview.chromium.org/2744853002 .
2017-03-10 08:53:08 -08:00
Vijay Menon 2acb2eb669 Update for latest tests and sdk
TBR=leafp@google.com

Review-Url: https://codereview.chromium.org/2731333002 .
2017-03-06 09:36:14 -08:00
Jennifer Messerly 0e00b3e5c8 fix #28008, fix #28009 implement FutureOr<T>
This implements FutureOr<T> in strong mode, otherwise it's ignored (treated as `dynamic`.

Also fixes strong mode's inference subtype function incorrectly treating `void` as a malformed type. This had the consequence of allowing `void` to be inferred as a type argument.

R=leafp@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2647833002 .
2017-01-25 15:32:57 -08:00
Bob Nystrom 590a188066 Use "Object" as the reified type of covariant override parameters.
This ensures the runtime type is of the tear-off expression's static
type, even when accessed through a superclass.

I also moved the two tests into a subdirectory so they are easier to
find. (It is inscrutable to me why we would have a single directory
with 1,868 test files in it.) That involved enabling recursive
directory listing in codegen_test, which exposed a couple of things.

Fix #27484.

R=leafp@google.com

Review-Url: https://codereview.chromium.org/2641543003 .
2017-01-18 14:48:42 -08:00
Vijay Menon 0703ec5b1a Track crashing tests
tbr'ing to fix bots

TBR=brianwilkerson@google.com,rnystrom@google.com

Review-Url: https://codereview.chromium.org/2629173003 .
2017-01-12 16:00:15 -08:00
Vijay Menon 038a66b305 Regen DDC error expectations
Is this due to recent inference changes?

TBR=jmesserly@google.com,leafp@google.com

Review-Url: https://codereview.chromium.org/2619923002 .
2017-01-09 15:32:05 -08:00
Dan Rubel 55ef6e193c support --options flag and other analysis options flags in DDC
This updates DDC options processing to support:
* --options /path/to/analysis/options/file.yaml
* --enable-strict-call-checks
* --supermixin
* --no-implicit-casts
* --no-implicit-dynamic

As well as general refactoring and cleanup of DDC options processing

R=vsm@google.com

Review-Url: https://codereview.chromium.org/2598593003 .
2017-01-04 18:15:21 -05:00
Dan Rubel 13bd1ad0bf DDC/AnalyzerCLI common cmdline option processing
Refactor DDC and Analyzer CLI command line option processing
to use common createContextBuilderOptions method
and ContextBuilderOptions to hold common options.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2584293003 .
2016-12-19 16:24:20 -05:00
danrubel e321439470 cleanup Analyzer CLI and DDC arg parsing
This removes the need to split arguments on '='
before calling the extractDefinedVariables method.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2581723002 .
2016-12-15 12:16:20 -05:00
danrubel eea098a315 fix DDC codegen test
TBR

Review-Url: https://codereview.chromium.org/2579693002 .
2016-12-14 22:24:39 -05:00
danrubel 1d4334739c update DDC to use analyzer extractDefinedVariables
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2578463004 .
2016-12-14 20:43:53 -05:00
Bob Nystrom 6c757957db Move the dev_compiler strong mode tests into sdk/tests/.
DDC's codegen test copies those files to a local "gen" directory so
that it can do stuff like splitting out the multitests before it
compiles them to JS.

I left all of that alone, so the rest of DDC's test infrastructure is
unchanged. The very first step that builds the "gen" directory just
copies from sdk/tests/..._strong/... instead and the rest is good to go.

I did not move not_yet_strong_tests.dart somewhere more accessible yet
because I'm not sure if kernel needs it or where it should go.

I did not create any status files because DDC doesn't need them and
there are no test suites for the new directories for the other
platforms.
2016-12-09 11:09:55 -08:00
Vijay Menon 201c5b9297 Fix runtime strong mode error in ListMixin
R=jacobr@google.com

Review URL: https://codereview.chromium.org/2544163002 .
2016-12-01 15:41:46 -08:00
Brian Wilkerson 3e51e6d3c9 Fix reference to validate method
R=paulberry@google.com

Review URL: https://codereview.chromium.org/2536233002 .
2016-11-29 09:57:27 -08:00
Jennifer Messerly 365d9a000a fix #27784 and fix #27785, fromEnvironment constants in DDC
R=vsm@google.com

Review URL: https://codereview.chromium.org/2503803004 .
2016-11-16 12:20:43 -08:00
Jennifer Messerly 2e8d011ca3 fix #27607, add dev_compiler summary to the SDK and move JS files
R=vsm@google.com

Review URL: https://codereview.chromium.org/2474523003 .
2016-11-01 18:17:43 -07:00
Vijay Menon 68d2121fd0 Use .packages instead of pubspec.yaml
This runs tests against sdk versions of packages instead of whatever
random version we have in pubspec.yaml.

Travis may be unhappy with the lack of a pubspec.yaml.  Here's the try:

https://travis-ci.org/dart-lang/sdk/builds/163270204

R=jmesserly@google.com, rnystrom@google.com

Review URL: https://codereview.chromium.org/2371113004 .
2016-09-28 09:49:31 -07:00
Jacob Richman d858c4f2ae Fix build break.
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/2346573002 .
2016-09-14 13:07:34 -07:00
John Messerly 48817e61f7 fix strong mode messages in pkg/dev_compiler
R=vsm@google.com

Review URL: https://codereview.chromium.org/2314193002 .
2016-09-07 09:06:24 -07:00
John Messerly c1139934a7 fix #626, add AMD module format and make it default
R=nweiz@google.com, vsm@google.com

Review URL: https://codereview.chromium.org/2249233002 .
2016-08-25 09:39:36 -07:00
Vijay Menon 0516f9f545 Regression test dart:mirrors
About 50 tests pass right now.  A bunch more fail.

See #199

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/2256393002 .
2016-08-19 08:27:20 -07:00
John Messerly 43fe94ae35 remove unused test expectation files
R=vsm@google.com

Review URL: https://codereview.chromium.org/2246353002 .
2016-08-16 08:19:18 -07:00
John Messerly 36273565e3 fixes #610, incorrect help output
R=nweiz@google.com

Review URL: https://codereview.chromium.org/2244703003 .
2016-08-12 15:06:41 -07:00
John Messerly 0aa5cbd128 fix #620, infer the input files from sources
also simplifies build of packages used by our tests
this caused a bunch of tests that use parts to start passing

R=nweiz@google.com

Review URL: https://codereview.chromium.org/2234343003 .
2016-08-11 13:19:36 -07:00
John Messerly c1e97b495f fix #603, support mock objects
if noSuchMethod is used to implement an abstract member, this will be detected and appropriate code will be generated.

R=leafp@google.com

Review URL: https://codereview.chromium.org/2158173003 .
2016-07-19 13:24:02 -07:00
Leaf Petersen 0315595d60 Check in codegen test expectations.
Codegen output is checked into repository to make codegen regressions
more visible (especially readability regressions).

BUG=
R=rnystrom@google.com

Review URL: https://codereview.chromium.org/2128353002 .
2016-07-07 15:57:22 -07:00
Vijay Menon e8e19b4c5a Verify status of statically failing tests
This should catch tests that suddenly start failing (or passing).

This is an admittedly contrived approach to track compilation failures in
the same runtime logic: the statically failing tests are now compiled
to a trivial output that throws a particular exception.  Ideally, we
wouldn't run these, but it's beneficial to keep status in the same
place.

On my laptop, this only adds ~8s to presubmit (which takes ~2:30 min).

Ideas on alternative approaches welcome.  :-)

R=jmesserly@google.com, leafp@google.com

Review URL: https://codereview.chromium.org/2079373002 .
2016-06-22 06:25:48 -07:00
Leaf Petersen 40c7ac9038 Wire up class hierarchy for recursive inheritance
BUG=
R=jacobr@google.com

Review URL: https://codereview.chromium.org/2033543002 .
2016-06-01 19:21:45 -07:00
John Messerly f0517c4deb Enable strong mode in DDC, fix all warnings/errors
R=leafp@google.com

Review URL: https://codereview.chromium.org/2016483002 .
2016-05-26 11:13:32 -07:00
Bob Nystrom 1e5b3af2e0 Move generated files to gen/.
- The generated SDK goes into gen/patched_sdk.
- Expanded multitests go into gen/codegen_tests.
- Compiled tests go into gen/codegen_output.

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1988503002 .
2016-05-18 13:48:10 -07:00
Vijay Menon d15a603538 Allow the SDK to be set via a summary file
The generated summary file matches the generated DDC sdk - i.e., it
does not include dart:io.  I modified the codegen_tests to the summary
and had to prune the parts of unittest that relied on dart:io.

Paul / Konstantin: can one of you please look at the summary part?

Bob: can you please look at the unittest changes?

R=rnystrom@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1982853002 .
2016-05-16 17:10:08 -07:00
Vijay Menon 88870d0194 Migrate dart2js stubs for dart:io
Modifies tests to use our SDK.  Didn't prune io dependences to make
sure the stubs above work.  :-)

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1976103003 .
2016-05-16 08:23:41 -07:00
Bob Nystrom 851cbb0fb3 Delete stale .js or .err files when generating codegen output.
This ensures that, for example, if you fix a test to no longer have
errors, then the old ".err" file is removed.

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1978983002 .
2016-05-13 16:34:13 -07:00
Harry Terkelsen 382996f41c update dart:math
BUG=
R=rnystrom@google.com

Review URL: https://codereview.chromium.org/1967773005 .
2016-05-12 09:03:11 -07:00
Bob Nystrom e535970604 Update dart:convert and dart:core Uri.
I started trying to get the convert tests all cleaned up and passing
but realized I was going down a rathole. So, for now, all of the slow
or failing ones are just skipped.

BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org/1965563003 .
2016-05-10 10:25:38 -07:00
Jacob Richman 9520e96340 Switch to actual unittest, stack trace, and path packages. Tag tests as failing that were ignored due to the incomplete unittest library. Make running of unittests a bit more robust by wrapping them inside a mocha test to avoid unpredictable behavior due to interleaving async mocha and unittests.
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1956513004 .
2016-05-06 12:28:44 -07:00