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

Side by Side Diff: pkg/analysis_server/test/integration/integration_tests.dart

Issue 423143002: Remove package root hack from the analysis server integration testing (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/pkg.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.integration.analysis; 5 library test.integration.analysis;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:convert'; 9 import 'dart:convert';
10 import 'dart:io'; 10 import 'dart:io';
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 * Start the server. If [debugServer] is true, the server will be started 504 * Start the server. If [debugServer] is true, the server will be started
505 * with "--debug", allowing a debugger to be attached. 505 * with "--debug", allowing a debugger to be attached.
506 */ 506 */
507 static Future<Server> start({bool debugServer: false}) { 507 static Future<Server> start({bool debugServer: false}) {
508 // TODO(paulberry): move the logic for finding the script, the dart 508 // TODO(paulberry): move the logic for finding the script, the dart
509 // executable, and the package root into a shell script. 509 // executable, and the package root into a shell script.
510 String dartBinary = Platform.executable; 510 String dartBinary = Platform.executable;
511 String scriptDir = dirname(Platform.script.path); 511 String scriptDir = dirname(Platform.script.path);
512 String serverPath = normalize(join(scriptDir, '..', '..', 'bin', 512 String serverPath = normalize(join(scriptDir, '..', '..', 'bin',
513 'server.dart')); 513 'server.dart'));
514 String repoPath = normalize(join(scriptDir, '..', '..', '..', '..'));
515 String buildDirName;
516 if (Platform.isWindows) {
517 buildDirName = 'build';
518 } else if (Platform.isMacOS) {
519 buildDirName = 'xcodebuild';
520 } else {
521 buildDirName = 'out';
522 }
523 // TODO(paulberry): this is a guess
524 String dartConfiguration = 'ReleaseIA32';
525 String buildPath = join(repoPath, buildDirName, dartConfiguration);
526 String packageRoot = join(buildPath, 'packages');
527 List<String> arguments = []; 514 List<String> arguments = [];
528 if (debugServer) { 515 if (debugServer) {
529 arguments.add('--debug'); 516 arguments.add('--debug');
530 } 517 }
531 arguments.add('--package-root=$packageRoot'); 518 arguments.add('--package-root=${Platform.packageRoot}');
532 arguments.add(serverPath); 519 arguments.add(serverPath);
533 return Process.start(dartBinary, arguments).then((Process process) { 520 return Process.start(dartBinary, arguments).then((Process process) {
534 Server server = new Server._(process); 521 Server server = new Server._(process);
535 process.stdout.transform((new Utf8Codec()).decoder).transform( 522 process.stdout.transform((new Utf8Codec()).decoder).transform(
536 new LineSplitter()).listen((String line) { 523 new LineSplitter()).listen((String line) {
537 String trimmedLine = line.trim(); 524 String trimmedLine = line.trim();
538 server._recordStdio('RECV: $trimmedLine'); 525 server._recordStdio('RECV: $trimmedLine');
539 var message; 526 var message;
540 try { 527 try {
541 message = JSON.decoder.convert(trimmedLine); 528 message = JSON.decoder.convert(trimmedLine);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 * Record a message that was exchanged with the server, and print it out if 650 * Record a message that was exchanged with the server, and print it out if
664 * [debugStdio] has been called. 651 * [debugStdio] has been called.
665 */ 652 */
666 void _recordStdio(String line) { 653 void _recordStdio(String line) {
667 if (_debuggingStdio) { 654 if (_debuggingStdio) {
668 print(line); 655 print(line);
669 } 656 }
670 _recordedStdio.add(line); 657 _recordedStdio.add(line);
671 } 658 }
672 } 659 }
OLDNEW
« no previous file with comments | « no previous file | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698