diff --git a/pkg/testing/analysis_options.yaml b/pkg/testing/analysis_options.yaml new file mode 100644 index 00000000000..c36c46ed517 --- /dev/null +++ b/pkg/testing/analysis_options.yaml @@ -0,0 +1,9 @@ +# Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file +# for details. All rights reserved. Use of this source code is governed by a +# BSD-style license that can be found in the LICENSE file. + +analyzer: + strong-mode: true + errors: + # Allow having TODOs in the code + todo: ignore diff --git a/pkg/testing/lib/src/analyze.dart b/pkg/testing/lib/src/analyze.dart index af328f7aeac..fc32fd4ec25 100644 --- a/pkg/testing/lib/src/analyze.dart +++ b/pkg/testing/lib/src/analyze.dart @@ -158,9 +158,9 @@ Future analyzeUris( if (uris.isEmpty) return; String topLevel; try { - topLevel = Uri - .directory(await git("rev-parse", ["--show-toplevel"])) - .toFilePath(); + topLevel = new Uri.directory( + await git("rev-parse", ["--show-toplevel"]).trimRight()) + .toFilePath(windows: false); } catch (e) { topLevel = Uri.base.toFilePath(windows: false); } diff --git a/pkg/testing/test/analyze_test.dart b/pkg/testing/test/analyze_test.dart new file mode 100644 index 00000000000..4756ada0482 --- /dev/null +++ b/pkg/testing/test/analyze_test.dart @@ -0,0 +1,12 @@ +// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import "package:testing/src/run_tests.dart" as testing show main; + +main() { + // This method is async, but keeps a port open to prevent the VM from exiting + // prematurely. + return testing.main( + ["--config=pkg/testing/testing.json", "--verbose", "analyze"]); +} diff --git a/pkg/testing/testing.json b/pkg/testing/testing.json index 408ac55f887..722834dd8ba 100644 --- a/pkg/testing/testing.json +++ b/pkg/testing/testing.json @@ -1,6 +1,10 @@ -{ "Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file":0, - "for details. All rights reserved. Use of this source code is governed by a":0, - "BSD-style license that can be found in the LICENSE.md file.":0, +{ +"":"Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file", +"":"for details. All rights reserved. Use of this source code is governed by a", +"":"BSD-style license that can be found in the LICENSE.md file.", + + "packages": "../../.packages", + "suites": [ { "name": "dart_vm", @@ -15,10 +19,14 @@ ] } ], + "analyze": { + "options": "analysis_options.yaml", + "uris": [ + "bin/", "lib/", - "bin/run_tests.dart" + "test/" ] } }