Commit Graph

123 Commits

Author SHA1 Message Date
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
Stephen Adams be0d779177 Add corelib tests
99 have compile errors
265 generate code
94 fail

We will triage after updating the sdk.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1945153002 .
2016-05-04 11:09:28 -07:00
Stephen Adams 990c7dbb8f Write .err file alongside .txt if no .js
BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/1949933002 .
2016-05-04 10:39:17 -07:00
Stephen Adams 75d6cde61b Split status by lib
Also
- allow failing tests to be run and checked for failure

BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1946853002 .
2016-05-03 16:48:28 -07:00
Jacob Richman efa2303c64 Add all dart:html tests from the sdk to test/codegen. All tests are added except for js_array_test.dart and js_dart_to_string_test.dart which have to be stripped out for now due to failures.
BUG=
R=vsm@google.com

Review URL: https://codereview.chromium.org/1930043002 .
2016-04-28 12:30:25 -07:00
Vijay Menon 3483e1974c Qualify library names in packages
Partially addresses #504.  This is WIP, but wanted your thoughts.

Comment / questions:
- The current js_ast ImportDeclaration assumes a legal identifier I think.
  E.g., this gets lowered:
  import { src$interfaces } from "matcher"

- Should we thread package root through ModuleCompiler to let it packagify urls?

- How should we handle non-package urls?  Pass in an explicit root dir
  and go relative?

R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1917863005 .
2016-04-27 21:03:58 -07:00
John Messerly 0c148ecef4 Implement modular compilation
Highlights
* compile one module at a time
* use summaries to speed up compiles
* use command runner so we can add more commands later
* some long needed renames and file organization
* various other technical debt has been addressed

Lowlights
* lost node.js runner/tests (node output format still supported)
* possibly lost some closure support/workarounds (format still supported)
* needs more end-to-end tests of the new system

R=vsm@google.com

Review URL: https://codereview.chromium.org/1879373004 .
2016-04-14 11:28:12 -07:00
Vijay Menon d54ed38046 Work around dart:html inconsistency
We're hitting a runtime bug on requestAnimationFrame when we compile
against the latest dart:html in the analyzer (45) but run against the
DDC one (based on 39).

Adding the new type name by hand as a workaround until we roll, but
longer term we'll need to compile and run against the same sdk.

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

Review URL: https://codereview.chromium.org/1849133003 .
2016-04-01 09:06:58 -07:00
John Messerly e8bee43919 More analyzer updates, and handle negative_tests
Also fixes node_test to not overwrite main SDK log

R=vsm@google.com

Review URL: https://codereview.chromium.org/1840203002 .
2016-03-29 15:16:44 -07:00
John Messerly 73159b6c1e Remove code that requires whole-program compile
This change removes functionality that is not part of the core Dart Dev
Compiler, in particular those features that were not designed for
incremental/modular compilation.

For a while, the primary way to use DDC will be as a compiler invoked by
a build system, e.g. make or bazel or some node.js based-build system.

We'd love to see the user functionality provided by these return.
In particular, a well designed server+watcher system would be a huge
boost to productivity!

I'll see about moving over HTML reporting to Analyzer CLI. It has a lovely UI.
Thanks to everyone who contributed these features.

The following features were removed:

* DDC transformer. Transformers require whole world, in memory files.
* DDC server. The server has its own mini-build system.
* Various kinds of reporting. These should be moved to Analyzer CLI.

Note: batch compiler and the node runner are left for now.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1788973002 .
2016-03-15 11:30:50 -07:00