The check normalises newlines from "actualContents", but "expectedContents" could also contain \r\n on Windows (at least it does for me), so this just normalises both.
The additional await/async is to prevent "Test failed after it already completed" warnings because this code is inside the call to test() (and not wrapping it, like the other .main() calls in the file).
Change-Id: Iac034efaf1a8a6dad4a21dc67a2dfdb74092dd22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307301
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
When running tests from analysis_server using "dart test", the Platform.script is a temporary file and this code fails like:
```
00:01 +0 -1: FlutterSnippetCompletionWithoutNullSafetyTest | test_snippets_flutterStateless_notAvailable_notTopLevel [E]
Bad state: Unable to find sdk/pkg/ in /var/folders/b1/ftm2whhj4mb3_c4nfjhq23z00000gn/T/dart_test.kernel.VYZHoV/test.dart_1.dill
```
This change allows using the working directory to find `pkg` if all of the previous attempts fail, before giving up.
Change-Id: Idb29029e6f14ec4bab3569018771ed0e10586ecc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
With the parser code in the same library as the DOM classes, the
`pkg/analyzer/tool/messages/generate.dart` program, which generates all
of the diagnostic classes and diagnostics, _depends_ on a library
with a `parse` method which depends on these diagnostic classes (in
order to report errors while parsing HTML). This means that if
there is any existing error (like an unknown identifier) in the
existing error codes, it is impossible to generate the error codes.
Since we don't need the `parse` method to generate diagnostics, we
split up the library and remove the indirect dependency.
Separating the parser code out removes the loop.
Change-Id: Ifb9e9fd979e341ae64a1ed49aaf3758d3dcf1dee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
These will replace eventually FileState.exported/importedFiles,
because only libraries or augmentation can have them. Also, we will
build Export/ImportElement(s) from them, when google3 switches to
using AnalysisDriver.buildPackageBundle(), so we are free to make
changes to the way linker works.
Change-Id: I66674dc7720aa704cfc36d16fc78e17dd05a8b93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246681
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
It should not be necessary to ever run `pub get` for a package which is
not published. All packages used in the SDK are controlled by a single
package config, so it's not necessary to declare versions or paths for
any packages.
Remove all dependency overrides.
R=devoncarew@google.com
Change-Id: Icb328813b471f35ee4c99995f4e90aac4d8ed438
Tested: Covered by existing static analysis.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244767
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
* Add team "groups" in tools/OWNERS_<group name>.
* Add top-level OWNERS as a fallback.
* Add OWNERS for all top-level directories.
* Add OWNERS to all packages.
For additional background information see go/dart-sdk-owners.
TEST=No op until code-owners is enabled.
Bug: b/200915407
Change-Id: I7fe6116cc599c749cd50ca16151d6d6a801d99d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229147
Reviewed-by: Jonas Termansen <sortie@google.com>
Specifically, to include replacement ranges, which we did not test
consistently, and to merge all check that we have into one matcher
instead of having two limited methods looking for suggestions.
I started initially looking at https://github.com/dart-lang/sdk/issues/34672,
and realized that it is somewhat scary to make more invasive changes
without checks for replacement ranges.
Change-Id: I303cd066989f2a137013ac8dac0614b24e52071d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/225800
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
It appears that invoking exit with a value other than either zero (0) or
254 causes the test infrastructure to interpret the failure as a failure
in the infrastructure, turning the bot purple rather than red. Thowing
an exception is interpreted correctly, so I believe that this change will
cause a need to regenerate to show up as a red bot.
Change-Id: I01e9fc2bfe09fac3da2a9aade69fabf3abd17179
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216260
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
When running tests using `test.py`, multiple tests are run in parallel
by different processes, which means multiple processes may be trying
to format text at the same time. To avoid them clobbering each
others' data, we need to ensure that formatText uses a different
temporary file path each time it runs. The easiest way to do this is
with the `Directory.createTempSync` method.
I have an upcoming CL that increases the amount of code generation
done by the analyzer; this fix is necessary to ensure that it passes
trybots reliably.
Change-Id: I92e2f2fcaec9032da90e8c271371d3e4cea59ab3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214780
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>