Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: pkg/intl/test/message_extraction/message_extraction_test.dart

Issue 23446002: Remove hack for finding package-root in tests, now available in Platform (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/intl/test/message_extraction/message_extraction_test.dart
diff --git a/pkg/intl/test/message_extraction/message_extraction_test.dart b/pkg/intl/test/message_extraction/message_extraction_test.dart
index 40c664e6accc87dad6fb87e2cfff2328a8d1c645..a040df1d5991b98841627d3af0ead43eab8b207e 100644
--- a/pkg/intl/test/message_extraction/message_extraction_test.dart
+++ b/pkg/intl/test/message_extraction/message_extraction_test.dart
@@ -12,37 +12,8 @@ import '../data_directory.dart';
final dart = Platform.executable;
-// TODO(alanknight): We have no way of knowing what the package-root is,
-// so when we're running under the test framework, which sets the
-// package-root, we use a horrible hack and infer it from the executable.
-final packageDir = _findPackageDir(dart);
-
-/**
- * Find our package directory from the executable. If we seem to be running
- * from out/Release<arch>/dart or the equivalent Debug, then use the packages
- * directory under Release<arch>. Otherwise return null, indicating to use
- * the normal pub packages directory.
- */
-String _findPackageDir(executable) {
- var oneUp = path.dirname(executable);
- var tail = path.basename(oneUp);
- // If we're running from test.dart, we want e.g. out/ReleaseIA32/packages
- if (tail.contains('Release') || tail.contains('Debug')) {
- return path.join(oneUp, 'packages/');
- }
- // Check for the case where we're running Release<arch>/dart-sdk/bin/dart
- // (pub bots)
- var threeUp = path.dirname(path.dirname(oneUp));
- tail = path.basename(threeUp);
- if (tail.contains('Release') || tail.contains('Debug')) {
- return path.join(threeUp, 'packages/');
- }
- // Otherwise we will rely on the normal packages directory.
- return null;
-}
-
-/** If our package root directory is set, return it as a VM argument. */
-final vmArgs = (packageDir == null) ? [] : ['--package-root=$packageDir'];
+/** The VM arguments we were given, most important package-root. */
+final vmArgs = Platform.executableArguments;
/**
* Translate a file path into this test directory, regardless of the
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698