Commit Graph

229 Commits

Author SHA1 Message Date
Alexander Thomas f9e9f37068 [testing] Pass the experiment flags to all batch runners
Sometimes, the batch runners need the experiment flags set. This is
especially true when running in NNBD mode which needs to be enabled in
the VM running the batch runner as well as in the test code.

Previously this was only done for the CFE batch runner, this CL moves
the logic to apply to all compilation commands using batch runners.

Change-Id: I9358ae7cfed4f082075ef91b59408edcb2912361
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131831
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2020-01-16 12:24:14 +00:00
Alexander Thomas d6d921ba12 [infra] Fix cfe NNBD builder
* Correct mistake in the named configuration.
* Add missing test directories to the fileset.
* Add configurations for all operating systems (for local testing).
* Avoid duplicate experiments specified by both configuration and test.
* Pass experiment flags also to VM running the batch runner.

Change-Id: I47f2c1b07e91e2f8120a2712ce362689b68e9ce4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130900
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-01-09 20:16:27 +00:00
Robert Nystrom 5eb585cfaf Make selector argument parsing smarter.
Allow a selector that starts with "tests/" or ends with ".dart" mainly
to make tab-completion in the command line usable.

Change-Id: I53cb4d365df79d2708e062ff245fb825fea9239c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129001
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-12-20 21:24:15 +00:00
Nicholas Shahan 171059d276 [test_runner] Avoid potential errors using the wrong SDK fork in paths
Followup from comments in https://dart-review.googlesource.com/c/sdk/+/128570

Change-Id: I12c1f157154d0bc30e08d0b0f5631946fc00f361
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128774
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-12-18 20:44:47 +00:00
Nicholas Shahan e71af58fef [test_runner] Only skip analyzer configurations with NNBD on language_2
We have reached the point where we no longer want to skip these tests when
running DDC.

Change-Id: I7680414f8652526d1fec3d4d9ff00ce34dbe5331
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128804
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-18 18:40:31 +00:00
Robert Nystrom cb2cbb7074 Enable "omit_local_variable_types" lint in test_runner and fix violations.
Also turned a couple of "final" locals to "var" to be consistent with others.
Removed a no-longer valid analysis option.

Change-Id: I741989b20199ba8f1e86e464e1cf994137332fad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128500
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-12-17 19:48:54 +00:00
Nicholas Shahan 3fc1fe9af9 [test_runner] Pass non-nullable experiment flag to VM
It seems that we need to pass this flag to the VM now based on the
following message that appears when trying to run tests with the
experiment enabled:

```
VM initialization failed: Snapshot not compatible with the current VM
configuration: the snapshot requires 'release no-dwarf_stack_traces
use_bare_instructions nnbd-experiment' but the VM has
'release no-dwarf_stack_traces use_bare_instructions'
```

Alternatively, we could use the script from the sdk_nnbd/bin/ directory
where the experiment is hardcoded on, but that could be more confusing
when we unfork. WDYT?

Bug: #38665
Change-Id: I033e9e2e4a38f04c5cb8227efeee5a66826b46e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128570
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-17 19:21:10 +00:00
Sigmund Cherem 8ad8abfb74 Enable strong/weak strict checking in ddc runtime from the test runner
Change-Id: Ia7bad573f07ba7327907ab29d1301c2d004cbe0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128363
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-12-13 19:11:53 +00:00
Ryan Macnak 3678a3bd42 [build] Use separate out directories for each sanitizer.
Bug: https://github.com/dart-lang/sdk/issues/39611
Change-Id: Ie0aeaff758234220c2f0267b462d14f4c076bdf6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127821
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-12-11 18:12:47 +00:00
Nicholas Shahan 5069f7a8c6 [test_runner] Temporarily remove some packages from the DDC config
Allows us to more easily start running tests that use the NNBD sdk and do not
depend on these packages. We can add them back when they are migrated or can
easily be opted out and they build without errors.

Also cleans up a little of the ddk/ddc split and the location of the package
.dill files when running without --use-sdk.

Change-Id: I12fcbf18b47ad3189040f7e42c3ce9a4a06ed838
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127966
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-12-11 00:45:49 +00:00
Alexander Thomas 7fcaafbb3e [infra] Move IE registry settings from Puppet to the test runner
Removing puppet rules allows GCE VMs to be provisioned without Puppet.
This will reduce the startup time for new GCE VMs.

Bug: https://crbug.com/871818
Change-Id: I33d9ff9ccf423d5291b94b74b2e86a6cb757b976
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127241
Reviewed-by: William Hesse <whesse@google.com>
2019-12-09 13:43:28 +00:00
Karl Klose 413867d678 [infra] Add a script to convert multi-tests to the new static error test framework
The script verifies that the multi-test only contains static annotations
and that converting it to a single test produces the same error messages
as testing the sub-tests generated by the multi-test.

If that is the case, it uses
  pkg/test_runner/tool/update_static_error_tests.dart
to insert the expected errors and removes the multi-test markers.

Additionally, a copy of the '/none' test and of all the sub-tests with an
'OK' marker are created to preserve the testof runtime behavior.

Change-Id: I6eb67246f209dfbdf9b4ba8705c368c6f1978938
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124128
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2019-12-04 11:25:19 +00:00
Robert Nystrom 361d96227b Remove support for negative tests from the test runner.
- Remove the `retry` field from `BrowserTestCommand` since it isn't read and the only criteria to assign it was whether a test was a negative test

Change-Id: I4ff431ccf3fcd4c754fccbfdc6c89fc1ce5fa66f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125841
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2019-11-22 00:20:58 +00:00
Robert Nystrom 11d523dfe1 Add a test suite for "co19", which will be the NNBD-migrated co19 tests.
It doesn't do anything useful yet because the forked co19 tests aren't
getting pulled into the repo, but once gclient syncs them to
tests/co19, this should start doing something.

Change-Id: I5ee54f9afc19353c7a7a379178df1084c6f2e8d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125681
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-11-20 10:04:28 +00:00
Robert Nystrom 582cec84f4 Set up new test suites for migrating the tests to NNBD.
- Copies corelib_2/a*    -> corelib/
- Copies language_2/ab*  -> language/
- Copies lib_2/math/     -> lib/math/
- Copies standalone_2/a* -> standalone/

And also copies over and renames all of the status files in those
directories.

Then it migrates those tests to be static error free in NNBD.

Finally, adds support to the test_runner for the new suites.

Note that this review is split into multiple patchsets. The first
patchset is a straight copy of the existing files. Then the later
patchsets have the interesting changes.

Change-Id: Icec2ff850a3aee30b653066ac184495d1e3814d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125467
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-11-19 00:18:43 +00:00
Karl Klose ec0d042955 [infra] Support multiple named configurations in test infrastructure
This change allows to run test.dart and pkg/test_runner with multiple arguments
for the -n option to run tests for multiple configurations with one invocation.

Change-Id: If62e0bfc364460fa415c7f700f7e449b0de56987
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122395
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2019-11-08 08:06:36 +00:00
Samir Jindel c885bdde1d [vm] DBC is obsolete. Remove dead code.
Change-Id: Ica33af158cca53c8e951e4b2582de83660e8a60d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121851
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-27 18:18:29 +00:00
Alexander Thomas e62c7ae3bb [infra] Add legacy AST mode builder to the test-matrix.json
This also removes the now redundant bytecode testing from the dartkb
builders.

Replace the useKernelBytecode boolean option with a more flexible
genKernelOptions string list option.

See also See also https://dart-review.googlesource.com/c/sdk/+/122321/ for the
corresponding Luci config updates.

Change-Id: Iabb207bc02637b758c42c00ae9175bd52f46559f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122320
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-25 15:11:00 +00:00
Martin Kustermann e82fedc345 [vm] Remove deprecated (and untested) ARMv5 support from the VM
Since we have no CQ/CI test coverage of ARMv5 and none of our customers
uses it, a breaking change request was made (see issue further down).

The breaking change has been approved and a corresponding email has been
sent out:

https://groups.google.com/a/dartlang.org/forum/?nomobile=true#!topic/announce/vRQja7di3FQ

This CL removes any armv5 related code from our codebase.

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

Change-Id: I9abf32f1980ca19a9cf882b43c9966b2127f89e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122540
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-10-23 14:44:33 +00:00
Karl Klose 5814319bf9 [infra] Remove support for run.json
Change-Id: I5d8b02df2d2dad6b53e6365a9d004bed07f4c59f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122387
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2019-10-22 11:40:14 +00:00
Ben Konyi 0b045aea2b [ VM ] Removed tests/standalone along with any references in build bot / test runner configurations
Deleted irrelevant tests and migrated valid tests to Dart 2

Change-Id: If37611e051b7e2f128c53267f606d480d7fe23a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121902
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-10-17 00:41:16 +00:00
Robert Nystrom aab88791b8 Change experiment flag name in test runner and test config.
Use "enable-experiment" to be consistent with other tools.

Change-Id: If9598f667517443a4f61ef91955ff57a477f0a5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121681
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-10-14 23:24:58 +00:00
Robert Nystrom 4a2adf5734 Allow an unspecified error expectation to match multiple errors.
Fix #38792.

Change-Id: I6fc98538f75ed03612cd25ba4f0c12054819a3fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121406
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2019-10-14 23:11:58 +00:00
Robert Nystrom 90ff37e011 Plumb the configuration's experiments flags through to tools.
Both a test file and now a test configuration can specify that
experiment flags should be enabled. Since they both can, passing those
to the tools is a little tricky because we need to merge the two
command line arguments. It's made worse by the fact that this corner of
test_runner is riddled with poorly factored code.

This doesn't fix the redundant code, but does merge and pass the flags
through. Right now, it parses them from the test file by looking for
them in the SharedOptions line, which is where they currently appear.

That's pretty hacky. Eventually, we should change these tests to use:

// Requirements=

Fixes #38386, #38387, #38388, and #38389.

Change-Id: I1aea1482b30b9ba19c427319f895822d81ee12ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121262
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-10-11 20:33:36 +00:00
Karl Klose eaeedd1988 [infra] Remove class UniqueObject
Object as a base class already behaves the way we want.

Change-Id: Ic769ed5d413f016a6f6258d0b0e2b94ebaf5cc8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120664
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2019-10-11 11:31:57 +00:00
Robert Nystrom 965b8cb1d8 Use the forked NNBD SDK in the test runner.
If the current test configuration enables the "non-nullable" experiment,
the test runner will read from the NNBD build directory instead of the
normal one.

This only kicks in when the experiment is enabled by the
*configuration*. If the test file enables it using:

  // SharedOptions=--enable-experiment=non-nullable

It has no effect on which directory is used. I think the right fix for
this is to use a different mechanism for these tests to specify that
they require NNBD. I'll send an email about that.

Change-Id: I4be2de8d0f7301c93dfb3f7e81c12372fc5d154a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121143
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-10-10 22:55:44 +00:00
Robert Nystrom 7e20ae579a Skip non-NNBD tests in NNBD test configurations.
Change-Id: I9845ca7bb8f50e0f4497f45d94550f6c8e2210c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121161
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-10-10 22:44:54 +00:00
Samir Jindel 8c5236f55e [vm/ffi] Fix host-target word mismatch breaking AOT callbacks in ARM_X64.
Addresses https://github.com/dart-lang/sdk/issues/38718

Change-Id: If416feb182da1d3a13d4a78770c9e240a0fe17cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120584
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-10-07 14:49:31 +00:00
Samir Jindel db352304ec [vm] Test AOT on Android with the 64->32 bit cross-compiler.
We introduce a new architecture ARM_X64, which is the same as ARM except that
the host-targeting-host binaries are compiled for X64 instead of X86.

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

Change-Id: I00a2b1cc71948adec9f66c7b2ee61e9e5ac53d2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120121
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-07 10:35:45 +00:00
Samir Jindel 85948bd799 [vm/elf] Run strip --strip-unneeded on ELF snapshots during testing.
Android's strip can make incorrect assumptions about the ELF it's processing,
which has caused bugs leaking into Flutter:

- https://github.com/dart-lang/sdk/issues/37146
- https://github.com/flutter/flutter/issues/41010

These kinds of bugs may be difficult to reproduce and have subtle effects.
We should run strip ourselves on the CQ to catch them earlier.

Change-Id: I1ba39aa7996749f90d3f7373f668c797d2e300d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118388
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-09-27 13:24:46 +00:00
Samir Jindel ee1ab89987 [vm/infra] Fix compiler_configuration to use existing cross-compiler.
Also fix the ELF loader to allow segment alignment >page size.

Change-Id: Icc4c2eaae44171e74cc41d9f2b06701acad86a90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118983
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-09-27 11:56:55 +00:00
Samir Jindel 9a683de40d [vm] Support testing assembly snapshots for ARM.
We have had several bugs propagate to Flutter end-users due to our lack of testing of
AOT Assembly snapshots on ARM (SIMARM_X64 in particular), causing reverts of SDK commits
and disrupting the Dart -> Flutter roll.

This leverages our custom ELF loader to load the generated ELF objects, which cannot be
loaded by dlopen() because they are marked with the ARM ABI.

For example, see:
  - https://github.com/flutter/flutter/issues/40114
  - https://github.com/flutter/flutter/issues/41228

Also do some tree-shaking of the snapshot writers for dart_precompiled_runtime.

Fixes https://github.com/dart-lang/sdk/issues/38433.

Change-Id: I5990769c623b8a13131b1848349af2c0a026272b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118569
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-09-25 17:09:16 +00:00
Karl Klose 209180d280 Treat the case that the reported error location has length 0
Change-Id: I419dc317098beda89991df57ec599b681043070b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117701
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2019-09-23 06:46:39 +00:00
Robert Nystrom 7516af7237 Add support for test requirements.
This gives us a way to specify that a test is only meaningful for
certain NNBD modes and should be skipped on other configurations. My
hope is we can extend this for other platform capabilities and then
eventually use this to express "skips" instead of relying on status
files for them.

Change-Id: I99548c326ee6fbe6db64e28e7f7f07d2fc1fd23c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117080
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-09-13 00:27:30 +00:00
Robert Nystrom 0d1636e0b2 Simplify how the list of TestCases for each TestConfiguration is made.
- Make it synchronous. I did some benchmarking and the async didn't seem
  to make a measurable difference and made the code harder to follow.
- Fix a bunch of small-scale idiom things: "var", names, etc.
- Move TestCase.hash into TestFile since that lets us access it before
  we've created a TestCase.
- Remove dead code.
- Make it clearer which functions work with TestFiles and which with
  TestCases.
- Clarify the code that determines whether or not to enqueue a test.

The last point is the motivating one. Soon, I'll be extending this code
to take NNBD into account when determining which tests to skip, so I
wanted to clean it up some first.

Change-Id: I488ed6c7d2453535968ac43389a2fd8370ead57d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116662
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-09-11 23:05:59 +00:00
Robert Nystrom 3f7805a90e Make the NNBD command-line options less, uh, half-baked.
- Better name than "optedIn".
- Actually hook up the command-line option to the configuration.
- Add tests, which would have caught the previous mistake.
- Don't allow comma-separated values for "--progress" and "--nnbd".
- Remove unused dead "--strong" option.

Change-Id: I57d7cb0d81af50d662dcf3f7f4c9ca1f2b102f2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116544
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-09-10 22:39:19 +00:00
Dmitry Stefantsov ccb6ba948b [cfe] Gather constraints from both possibilities for FutureOr
Closes #37778.

Bug: http://dartbug.com/37778.
Change-Id: Ia8828c27ccc912831a0fea8a473c547184c99229
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115243
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-09-10 09:50:30 +00:00
Robert Nystrom 981be87206 Add configuration options and flags for controlling NNBD mode.
This data is parsed by configurations and allowed as command-line
options to the test runner, but isn't currently plumbed through to any
of the tools. That's the next step.

Change-Id: I7931a11502a1c460e28b2a4a13d8722d8ad6974d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115767
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-09-06 01:17:07 +00:00
Robert Nystrom 9ff104efd6 Move StaticError and StaticErrorParser to a separate file.
test_file.dart was getting kind of unwieldy.

Change-Id: Ic1fd496f837f5f9b0150a640845d29c42a350c58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115772
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-09-06 01:16:48 +00:00
Robert Nystrom 6a8c988fc4 Simplify the computeCompilerArguments().
I was reading through this code to think about how to push the NNBD and
experiment flags in and this seemed like an easy improvement to do
while I was here.

Change-Id: I78b8989e0b4b552eb99a52c02cdd2cd619ebb219
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115612
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-09-05 19:05:17 +00:00
Robert Nystrom 89ad636b58 Remove the old "preview Dart 2" flags from the test runner.
Dart 2 shipped a year ago, so we're pretty well past a "preview". :)

Change-Id: I6c5d21ae4181e4228cc1fc49b6344cdb8fc43794
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115544
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2019-09-05 16:59:43 +00:00
Jens Johansen 9f57cf71d7 Add a blacklist to spelling tests; spell-check all packages and sdk with blacklist
Change-Id: I5bf3d5784d2ba48568a2699bb09ae39a85be17c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115214
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-09-03 12:39:24 +00:00
Samir Jindel 2e2d5bcca6 [vm] Make v8_snapshot_profile_writer_test less flaky and avoid user error with crossword config.
Fixes https://github.com/dart-lang/sdk/issues/37834

Change-Id: Ida9010a8294f2ab6e06969c671575f80c58b6697
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114850
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-08-29 12:03:43 +00:00
Robert Nystrom 1f10afc628 Don't use explicit error locations for CFE-only errors.
The CFE currently does not report the length in an error location, just
the starting position. When the static error update tool inserts an
error marker for an error reported only by the CFE, it doesn't know
what length to use.

It used to deal with this by always writing an explicit error location
like:

    // [error line 1, column 9]

Those are kind of ugly and brittle, though. This changes it to treat
the error as implicitly having length 1. This way, it can just output:

    //       ^

When validating an error expectation against a report CFE error, the
length is ignored anyway (since the CFE doesn't report it). In order to
ensure that the parsed output of the tool matches the reported data that
produced it, the parser also ignores the length when parsing an error
expectation for a CFE-only error with length one.

Fix #37991.

Change-Id: I20e109142546b7e82a5f796a1a40613b90dc89bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114745
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-08-29 01:02:45 +00:00
Robert Nystrom 48d8c00410 Handle shifted line number of static error updater.
This rarely comes into play because most static error markers don't
have an explicit line number. (This is by design so that shifts don't
cause diff churn.) But in some cases, the line number is written. When
that happens, the number may be wrong because previous added or removed
errors can shift the output line from where the original error was
reported.

Compensate for that. Fix #37990.

Change-Id: Ie306465c11d3b6a1de5ed158ad63167b4a5d4797
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114594
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-08-28 18:39:11 +00:00
Robert Nystrom de1b868fab Clean up the Command code.
- Remove the pointless static factory methods. Most of them only had a
  single callsite and in either case, they accomplished nothing useful
  since the underlying classes are already public.

- Make index final.

- Make indexedCopy() and remove the unused (and wrong!) base
  implementation.

- Define an abstract createOutput() method on Command and have all
  Command classes implement that to return an output for themselves.
  This is a better object-oriented design than a monolithic
  createCommandOutput() function full of "is ___" checks.

- Remove CleanDirectoryCopyCommand and MakeSymlinkCommand. They were
  unused.

- Change VmBatchCommand to VMBatchCommand to follow the style guide.

- Capitalize "L" in JSCommandLineCommand.

There are no behavioral changes. This stuff was just bugging me.

Change-Id: I2493f6afe0ee129e9c24e3f8289d37fe6dd4f802
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114465
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-08-28 18:32:41 +00:00
Alexander Markov 1765a19b03 [Test tool] Pass bytecode option to generate debugger stops
In order to test debugger functionality on vm-dartkb-*-simarm64 bots
we need to pass 'debugger-stops' bytecode generation option to kernel
compiler.

We don't have debugger functionality in PRODUCT mode, so 'debugger-stops'
(and 'local-var-info') are omitted.

Change-Id: I6453f9277862816d127e68f802cfe8db1e4b6c64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114720
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-28 00:24:32 +00:00
Ryan Macnak 78bd2bbaca [test] Re-enable background compilation in debug mode.
Bug: https://github.com/dart-lang/sdk/issues/30016
Change-Id: Ifeba852c612f576d145b806779e64f4dc8079a72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114464
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-08-27 17:20:17 +00:00
Robert Nystrom 53883c6044 Best static error test failure output on crashes and unspecified errors.
Change-Id: I6ffeef1618788183c3de841c154665c11d714df3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114461
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2019-08-26 10:18:04 +00:00
Robert Nystrom 527cf27633 Smarter error reporting in static error tests.
The old code to report the difference between a tests's expected and
actual errors was easily confused by missing or unexpected errors.
Those would misalign the lists of errors causing all subsequent errors
to be reported as wrong. This fixes that. Before, this test containing
a single unexpected error:

  main() {
    int a = "s";
    //      ^^^
    // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT

    unknownFunction();

    int b = "s";
    //      ^^^
    // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT

    int c = "s";
    //      ^^^
    // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT
  }

Would cause the test runner to output:

  incorrect static errors:
  Error at line 6, column 3, length 15
  - Expected on line 8 but was on 6.
  - Expected on column 11 but was on 3.
  - Expected length 3 but was 15.
  - Expected error code STATIC_TYPE_WARNING.INVALID_ASSIGNMENT but was STATIC_TYPE_WARNING.UNDEFINED_FUNCTION.

  Error at line 8, column 11, length 3
  - Expected on line 12 but was on 8.

  reported unexpected static errors:
  Error at line 12, column 11, length 3
  STATIC_TYPE_WARNING.INVALID_ASSIGNMENT

Oof. Now it prints:

  static error failures:
  Unexpected static error at line 6, column 3, length 15:
  - Had error code STATIC_TYPE_WARNING.UNDEFINED_FUNCTION.

Change-Id: I1b22b2a542c6f8049f92fda3627ae69144bfd52a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114240
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-08-22 23:32:53 +00:00