Commit Graph

1865 Commits

Author SHA1 Message Date
Aske Simon Christensen 8cfe626e31 When runtime == none, treat MissingRuntimeError and Timeout as Pass.
https://github.com/dart-lang/sdk/commit/9f966d5b804be25b95d4e59d2b3bf629ea9e8420
introduced treating RuntimeError as Pass when there is no runtime.
This change additionally treats MissingRuntimeError and Timeout as
Pass, as these results also don't make sense when the code is not run.

Change-Id: Icebc5f4ffa8fe189aa822f2ce063a44e517380f5
Reviewed-on: https://dart-review.googlesource.com/28200
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2017-12-12 10:17:13 +00:00
Martin Kustermann 317c55fa2c Reland "Use batch mode compilation for -cdartkp --strong"
Preliminary testing shows, this increases performance by around 20%. The
main benefit is by re-using a warmed-up VM and not start one from
scratch for every compilation.

Going forward we can do more optimizations, e.g. reading the platform
dill file only once into memory (instead of repeatedly) ...

  => This requires us using the new state-full IKG compiler.

Issue https://github.com/dart-lang/sdk/issues/31585

Change-Id: I2d3448783fc118611baf4671187a897227a65a6c
Reviewed-on: https://dart-review.googlesource.com/28400
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-12 10:14:20 +00:00
Bob Nystrom 3d35875082 Clean up the multitest code.
I had a few minutes while waiting on a build. :)

Change-Id: I8683b7076040c2a4757665ecd6efd9e415d49660
Reviewed-on: https://dart-review.googlesource.com/28000
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-12 01:30:59 +00:00
Bob Nystrom a53e4dd504 Finish migrating stuff out of lib_strong.
Some of these are data files that weren't picked up by the migration
script. Some are files that slipped between blocks of tests.

Change-Id: I184dc4701758b280444d54ec55c225ade30f3276
Reviewed-on: https://dart-review.googlesource.com/26423
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2017-12-11 23:45:23 +00:00
Vyacheslav Egorov e84fa65696 Revert "[vm/testing] Make --strong -c dartk configuration a Dart 2.0 configuration."
This reverts commit 50865e9387.

CQ on Mac is broken.

TBR=kustermann@google.com

Bug:
Change-Id: I41a7cab59c076dba4f25f5904725cca5bb4619c9
Reviewed-on: https://dart-review.googlesource.com/28420
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-11 21:07:43 +00:00
Alexander Markov 0352170a8f [VM] Avoid depending on --kernel-binaries if .dill file is specified
If a .dill file is specified on the VM command line (dart/dart_bootstrap),
and --kernel-binaries is not specified, then this dill file is used as
the source of platform libraries.

It supports the case of AOT-compiling a self-contained .dill file.

Change-Id: I42956a20b98958b9a2440f156fbbef17bfc359f8
Reviewed-on: https://dart-review.googlesource.com/24341
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-11 20:53:46 +00:00
Alan Knight af0b27480a Revert "Use batch mode compilation for -cdartkp --strong"
This reverts commit 8c38a415de.

Bug:
Change-Id: I1b159f2d2d10b51ee843a2ba9a61feb339152338
Reviewed-on: https://dart-review.googlesource.com/28362
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-12-11 18:22:49 +00:00
Martin Kustermann 8c38a415de Use batch mode compilation for -cdartkp --strong
Preliminary testing shows, this increases performance by around 20%. The
main benefit is by re-using a warmed-up VM and not start one from
scratch for every compilation.

Going forward we can do more optimizations, e.g. reading the platform
dill file only once into memory (instead of repeatedly) ...

  => This requires us using the new state-full IKG compiler.

Change-Id: I74db7dbb1aa79289d1045ef41f960215cf5b3b35
Reviewed-on: https://dart-review.googlesource.com/28240
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-11 15:55:31 +00:00
Vyacheslav Egorov 50865e9387 [vm/testing] Make --strong -c dartk configuration a Dart 2.0 configuration.
Switch it to use pkg/vm/tool/dart2 which is the source of truth for what
Dart 2 VM configuration means. Don't pass any additional flags from
tools/test.py itself.

Align pkg/vm/tool/dart2 with what tools/test.py was passing to VM on _2 suites.

Make default invocation `tools/test.py -c dartk --strong -m release,debug`
green by updating status files and skipping suites that are not Dart 2.0
compliant. I have filed issues #31588 for isolate suite and #31587 for
service suite.

Change-Id: I882b28f6a011eabf69c349ff0792b275434e39ff
Reviewed-on: https://dart-review.googlesource.com/27820
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-12-11 12:49:22 +00:00
Morten Krogh-Jespersen e01a98d11f Write exit code on failures.
Bug:
Change-Id: I3ada8f2be879d9a4565d29b16e86b07faa59930a
Reviewed-on: https://dart-review.googlesource.com/25981
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2017-12-11 11:06:37 +00:00
Jens Johansen 88780cc3a9 [test.py] Fix output path so it also works on Windows (take 2)
A path like
E:\b\build\slave\[...]\short27_al_args_concrete_subclass_test\E:\b\[...]
is not going to work on Windows, and while a path like
/whatnot/path/blah//whatnot/path
does work in Linux it doesn't look great.
This should fix it (somewhere else than before).

Bug:
Change-Id: I3e926ceb5a5e510b411328872ddc5da9efdf9f2e
Reviewed-on: https://dart-review.googlesource.com/27740
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-12-08 14:15:55 +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
Jens Johansen 514c0a9938 [test.py] Fix output path so it also works on Windows
A path like
E:\b\build\slave\[...]\short27_al_args_concrete_subclass_test\E:\b\[...]
is not going to work on Windows, and while a path like
/whatnot/path/blah//whatnot/path
does work in Linux it doesn't look great.
This should fix it.

Bug:
Change-Id: I72ef0da3a5fa2d33115745460a3d03f5df506f9f
Reviewed-on: https://dart-review.googlesource.com/27100
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-12-07 11:42:05 +00:00
Alexander Markov 421ed32f54 [VM] Support generating kernel for JIT mode
* The tool pkg/vm/bin/precompiler_kernel_front_end.dart is renamed to
  gen_kernel.dart and extended with --aot option (off by default).

Change-Id: I0aaa6c6b4acd1600beba736193fa2ee2d723a581
Reviewed-on: https://dart-review.googlesource.com/26363
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-06 18:48:50 +00:00
Régis Crelier a38ac7cf12 Resubmit "Set --strong in runtime arguments also when specified in the precompiled configuration"
Update dartkp status files, since --strong is now properly passed to the runtime.

Change-Id: I36dcc04a70f46730b24b5aaa2f118ed9baf42cbd
Reviewed-on: https://dart-review.googlesource.com/26561
Reviewed-by: Régis Crelier <regis@google.com>
2017-12-06 17:25:23 +00:00
Siva Annamalai 74b329035b Revert "Set --strong in runtime arguments also when specified in the precompiled configuration"
This reverts commit 2b62b921a4.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Set --strong in runtime arguments also when specified in the precompiled configuration
> 
> Bug:
> Change-Id: I7296a9d8c8a8f3c0f39f065cbcc0e99f268b32ac
> Reviewed-on: https://dart-review.googlesource.com/26466
> Reviewed-by: Régis Crelier <regis@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

TBR=asiva@google.com,regis@google.com

Change-Id: I6bbfa509ef6b6679ec5030139ad276eb81790138
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/26540
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2017-12-06 02:27:27 +00:00
Siva Annamalai 2b62b921a4 Set --strong in runtime arguments also when specified in the precompiled configuration
Bug:
Change-Id: I7296a9d8c8a8f3c0f39f065cbcc0e99f268b32ac
Reviewed-on: https://dart-review.googlesource.com/26466
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2017-12-06 00:37:27 +00:00
Alexander Markov 2cd25f0210 [VM] Wire up package:vm/kernel_front_end in precompiler2 and test.py
This CL introduces a tool for compiling Dart sources to kernel
files specifically for Dart 2.0 AOT compiler (precompiler).

Internally, the new tool uses package:vm/kernel_front_end which invokes
kernel front-end to produce kernel Program and then runs additional
whole-program transformations specific to AOT.

The new tool is used in pkg/vm/tool/precompiler2 and in tools/test.py
when running tests in '-c dartkp --strong' mode.

This CL re-enables AOT-specific transformations disabled by
6cfc0558ec, so it silences several
tests for https://github.com/dart-lang/sdk/issues/31424#issuecomment-347996235

Closes https://github.com/dart-lang/sdk/issues/31498

Issue: https://github.com/dart-lang/sdk/issues/30480

Change-Id: I4860f2adad17be9dcb1ca4609a4a10ad29ec51cd
Reviewed-on: https://dart-review.googlesource.com/25720
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-04 22:28:39 +00:00
Bob Nystrom 9f966d5b80 When runtime == none, treat RuntimeError as Pass.
Obviously, if there is no runtime, a runtime error is never going to
occur. It's silly to force people maintaining status files to have to
manually handle this case. (There are 28 "runtime != none" clauses in
our status files right now.)

Change-Id: Id94157a9fc2635fe6ee9435ce97156b6c4daed5f
Reviewed-on: https://dart-review.googlesource.com/23144
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2017-12-02 01:52:22 +00:00
Bob Nystrom 46c41309f6 Don't skip browser tests with compile errors.
Change-Id: Ia0a5603d9cbe6d7d5e40843a152a1503dfa4af25
Reviewed-on: https://dart-review.googlesource.com/21563
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-12-02 01:44:02 +00:00
Alexander Markov d282487636 Enable devirtualization optimization when testing dartkp --strong.
Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: I09a93391eaa42ff2c258b33bb229e2ca662463db
Reviewed-on: https://dart-review.googlesource.com/24562
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-29 22:56:40 +00:00
Karl Klose 2d48be6e62 Invoke dartdevk.dart through shell script that locates the 'dart' executable
Change-Id: Id13cc838b67785b12f95d19b480a6a830ad5c003
Reviewed-on: https://dart-review.googlesource.com/24120
Commit-Queue: Alexander Thomas <athom@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2017-11-29 11:27:50 +00:00
Jens Johansen 6e9c74274c Also output --network for testing http server commandline
If for instance running ddc kernel tests via

tools/test.py -mrelease -cdartdevk language_2 -v

one is told that a http server is started with a command line that will
create a http server listening to 0.0.0.0, while generally the one
actually launched by the testing scripts only listen to 127.0.0.1.

This CL adds the extra --network output to the command line given.

Bug:
Change-Id: Ifd9278360efb0b12249fe866c49ed923f7e73b0e
Reviewed-on: https://dart-review.googlesource.com/24102
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-11-29 07:30:40 +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
Bob Nystrom 68dc77f456 Build DDC's SDK as part of the regular build.
This involves a few main pieces:

- Add code to the GN scripts to generate DDC's patched SDK and then
  compile it to summaries and JS in the build output directory.

- Add support to the underlying DDC build scripts to support controlling
  which files are built where.

- Update test.dart to use the DDC SDK from the build directory.

- Update create_sdk to use the built SDK instead of the checked in one.

- Fix various internal DDC tools to build their own copy of the SDK
  (since they can't easily find the one in the build directory because
  it's path if config-specific) and use those.

- Delete the checked DDC SDK JS and summaries.

I think I got everything working. The built Dart SDK looks fine -- it's
identical to one built using the old build scripts.

The various tools and DDC's little test runner I *think* work, but there
may be a bug or two in there. I tried the various things I could and it
seems like they work but it's hard to tell since they may be kind of
broken right now anyway.

Bug:
Change-Id: Iea77915a5c1cc8450f60ebfbdf8c725c7ea2f32c
Reviewed-on: https://dart-review.googlesource.com/18144
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-11-20 23:24:07 +00:00
Sigmund Cherem b69cc7c98b Sort expectations in test.dart --list
This makes it easier to compare the output of two different runs of test.py
--list.

Change-Id: Iabbbd4d6f60b9b7523e2773520a8b2d588c99ae3
Reviewed-on: https://dart-review.googlesource.com/21520
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-11-18 00:51:06 +00:00
Alexander Markov a211134136 [Tests] Update _2 tests for Dart 2.0 fixed-size integers
Also, --limit-ints-to-64-bits is enabled when running tests in _2 test
suites.

This is the re-landing of 92ebd8aefa with
fixes:

* Revert changes in pkg/dev_compiler/test/browser/language_tests.js
  and tests/language/language_dart2js.status as they describe
  'language' test suite, not 'language_2'

* Correct tests/standalone_2/io/fuzz_support.dart as file_fuzz test was
  timing out on Windows and failing on android/arm.

Closes https://github.com/dart-lang/sdk/issues/31396

Change-Id: If9ca77fca300ddc605f17a7be39d1707e9724e25
Reviewed-on: https://dart-review.googlesource.com/21700
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-17 20:28:06 +00:00
Alexander Markov 58ffdbf5fc [VM] Move kernel service to pkg/vm, populate pkg/vm with necessary files
* kernel-service.dart is moved to pkg/vm/bin and renamed to
  kernel_service.dart

* LICENSE, pubspec.yaml and analysis_options.yaml added to pkg/vm.

* Kernel isolate name is corrected to be independent of URI passed
  in --dfe VM option.

Change-Id: I5b7b860297314e240e557af80913e7ac3e6324ad
Reviewed-on: https://dart-review.googlesource.com/21260
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-17 17:45:03 +00:00
Alexander Markov 22218e9b9e Revert "[Tests] Update _2 tests for Dart 2.0 fixed-size integers"
This reverts commit 92ebd8aefa.

Reason: various failures on buildbots.
Change-Id: I03e877e240fdb010d1288baebc124a3e364d1025
Reviewed-on: https://dart-review.googlesource.com/21565
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2017-11-17 00:52:17 +00:00
Alexander Markov 92ebd8aefa [Tests] Update _2 tests for Dart 2.0 fixed-size integers
Also, --limit-ints-to-64-bits is enabled when running tests in _2 test
suites.

Change-Id: I0b75e5e6e7af78adb29401d77ff55e735781ab73
Reviewed-on: https://dart-review.googlesource.com/20960
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-16 22:40:11 +00:00
Paul Berry 39fc40447e Fix subscription types in test_runner.dart.
This should fix the buildbot failure in vm-kernel-linux-release-x64-be.

Change-Id: I4078ff4eb677614684cf07dc70a50641d6926aa1
Reviewed-on: https://dart-review.googlesource.com/20905
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-15 00:51:15 +00:00
Alexander Markov 486d8e20ff [Test tool] Support test-specific environment customization
Change-Id: I129a22db37b5f1daf541dde9898b195045e4916d
Reviewed-on: https://dart-review.googlesource.com/20909
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-15 00:23:24 +00:00
Alexander Markov 0a4b151dc4 [Test tool] Pass --strong to dart_bootstrap, disable experimental opts
In '-c dartkp --strong' mode test tool should pass --strong option to
dart_bootstrap. Otherwise it uses non-strong vm_platform.dill instead
of vm_platform_strong.dill.

Also, experimental strong-mode based optimizations are disabled for now.

Closes https://github.com/dart-lang/sdk/issues/31348
Closes https://github.com/dart-lang/sdk/issues/31335

Change-Id: I2188b9165ae4daa0510e4e566393810b8165291e
Reviewed-on: https://dart-review.googlesource.com/20304
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-11 01:46:01 +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
Jenny Messerly 384678e4b3 port DDC's code_generator to Kernel
Change-Id: I2b6a5f56a69f5d3a965aefc3f8d4550d5940ac5a
Reviewed-on: https://dart-review.googlesource.com/17980
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2017-11-04 22:17:56 +00:00
Jacob Richman 8b221d13a4 Fix ddc debugger_test Fix regression in custom formatters due to change in metadata signatures to use Object.__proto__ instead of a null __proto__.
Bug:
Change-Id: I68fdb980e777b7c3f335fd6b57181134e3159cc3
Reviewed-on: https://dart-review.googlesource.com/17060
Commit-Queue: Jacob Richman <jacobr@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2017-10-31 19:45:27 +00:00
Morten Krogh-Jespersen 63d3a1eae2 Add fast_tests option to test.py to skip slow and timeout.
This should improve running tests on the CQ.

Bug:
Change-Id: I8d749dfccd0611eea4f64d2844c0e7da6bf01502
Reviewed-on: https://dart-review.googlesource.com/17102
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Morten Krogh-jespersen <mkroghj@google.com>
2017-10-30 15:55:14 +00:00
Bob Nystrom ba84855c0a Migrate the lingering language_strong tests over to language_2.
Change-Id: I4d60b650a2146c1d9be0fd0c5f98eac85f9e2eb1
Reviewed-on: https://dart-review.googlesource.com/16333
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2017-10-27 23:44:08 +00:00
Bob Nystrom 65411fe34f Pick default compiler and runtime arguments intelligently.
If you pass "-c" or "-r", but not both, choose a smart default for the
other instead of simply yelling at the user and telling them they
forgot something.

Change-Id: Ic47a20fa8f137a8f6488f16cf883839999e2225b
Reviewed-on: https://dart-review.googlesource.com/16905
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-27 22:11:07 +00:00
Bob Nystrom cf8a477cb7 Support test packages in dartdevk in test.dart.
This allows dartdevk to compile tests that import packages like expect.
There are a few pieces to this:

- Add support to build_pkgs.dart to build the kernel summaries for each
  test package (in addition to the analyzer summaries it already
  builds).

- Plumb that through the dartdevc_test target in the GN build as well.

- While we're at it, use GN to build the ddc_sdk.dill file and have
  test.dart load that one instead of the manually built one from calling
  ./tool/kernel_sdk.dart.

- Add command-line arguments to dartdevk for passing in the path to the
  SDK summary and the other summaries to compile against.

- Fix a little typo in processed_options.dart that was preventing it
  from resolving "package:" URIs.

- In test.dart, when compiling a test, link in the summaries for all of
  the test packages.

At runtime, it still uses the JS for those packages generated from the
old analyzer-based front end since the kernel-based compiler isn't
complete enough to compile any of those packages yet.

With all of this, if I change a test to:

  import "package:expect/expect.dart";

  main() {
    Expect.equals("a", "b");
  }

Then it compiles but fails at runtime. The compiler is completing, but
the generated code has some bugs. I don't know enough to fix them
myself, but here's what I've found out:

- In _libraryToModule(), the Library we get from kernel has a null
  fileUri, so this returns an empty string. That in turn means the
  generated JS tries to use "$" as the module name.

  Using this works around it temporarily:

      if (moduleName.isEmpty) moduleName = library.name;

- In _emitTopLevelNameNoInterop(), it doesn't handle the case where the
  NamedNode is a static method on a class. It just generates the library
  and method name, skipping the class, so "Expect.equals(1, 2)" gets
  compiled to "expect.equals(1, 2)" instead of
  "expect.Expect.equals(1, 2)".

Change-Id: I6bd9d98bc9706965160d8fb7cf70b20eeebab3a8
Reviewed-on: https://dart-review.googlesource.com/16687
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-27 21:25:58 +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
William Hesse fabb04d47c Make test.dart always create a result.log file when --write-result-log is set
Before this, if zero tests were run the file wasn't created.

Bug:
Change-Id: I446a90eeb68dca3ee1fe66d473cd55887c206bc1
R=athom@google.com
CC=mkroghj@google.com
Reviewed-on: https://dart-review.googlesource.com/16527
Reviewed-by: Alexander Thomas <athom@google.com>
2017-10-25 17:27:15 +00:00
William Hesse 1d0cd03ded Skip browser testing on tests with compile-time errors in all cases.
There was an error so these tests were run unless the --report flag was
present. This fixes that error. Testing for compile-time errors in non-browser
cases is sufficient.

Bug:
Change-Id: Ifeed1a3835297a9308a94de15cabfa119604c75a
R=mkroghj@google.com
Reviewed-on: https://dart-review.googlesource.com/14480
Reviewed-by: Morten Krogh-jespersen <mkroghj@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2017-10-25 14:16:41 +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
Alexander Markov 34df7f3599 Wire up strong-aot implementation option
This CL adds handling of previously introduced 'strong-aot'
implementation (target-specific) option into VM target.

After this change, it will be possible to enable strong-mode
whole-program optimizations in Flutter (in addition to standalone VM).

Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: I054b75ce4ba1b9bcf150e0b7f25fa7ca1bdd187e
Reviewed-on: https://dart-review.googlesource.com/15644
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-10-23 16:57:17 +00:00
William Hesse 64c150ab1a Revert "Capture stack traces in asynchronous browser test failures."
This reverts commit ca987d5c01.
This commit was slowing down Safari by a significant factor, causing
timeouts.

Bug:
Change-Id: Iddb3bf4f86664fa823cae5b08f24b3e240b4c67d
Reviewed-on: https://dart-review.googlesource.com/15881
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-23 08:32:13 +00:00
Sigmund Cherem 171d7965d7 Pass through the --strong flag to the vm runtime configuration
R=rnystrom@google.com,whesse@google.com

Change-Id: I83a827b2d681152cc80e8f0d76445e38e954bfc1
Reviewed-on: https://dart-review.googlesource.com/15820
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-10-21 01:12:28 +00:00
Bob Nystrom 9c0a6fd27c Add rudimentary support for dartdevk to test.dart.
It's added as a new compiler, so pass "-c dartdevk" to use it.

It doesn't support any test packages yet, so tests that, say, import
package expect won't compile. I'll work on that next, but it will
require adding some stuff to the build scripts to build .dill files for
those packages.

This does get test.dart invoking the compiler, running the resulting
test, and correctly reporting the result:

- A test that doesn't throw an exception and stays within the bounds of
  what is currently implemented in dartdevk passes.

- A test that compiles correctly but fails at runtime fails with a
  RuntimeError.

- A test that contains a compile error fails with a non-zero exit code
  and is reported as a CompileTimeError.

Change-Id: Icacbf1ff54dfe7aa4d245382d3b0aeb375cf105b
Reviewed-on: https://dart-review.googlesource.com/15420
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-20 16:00:28 +00:00
Morten Krogh-Jespersen b4e1f28e43 Add extra flags to output.
Bug:
Change-Id: I2f947b0ca91c0791fd85ea8e0e8cb8e27b2ee305
Reviewed-on: https://dart-review.googlesource.com/15520
Reviewed-by: William Hesse <whesse@google.com>
2017-10-20 13:34:01 +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