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

Unified Diff: pkg/analysis_server/test/integration/integration_tests.dart

Issue 437383003: Simplify handling of pathnames in integration tests. (Closed) Base URL: https://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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/integration/integration_tests.dart
diff --git a/pkg/analysis_server/test/integration/integration_tests.dart b/pkg/analysis_server/test/integration/integration_tests.dart
index 5488d3fe44a2e2735a01854c7cb284a17fb66927..b2cdd9d59a9a9d76b98098f246818326eda40b2f 100644
--- a/pkg/analysis_server/test/integration/integration_tests.dart
+++ b/pkg/analysis_server/test/integration/integration_tests.dart
@@ -55,17 +55,16 @@ abstract class AbstractAnalysisServerIntegrationTest {
var serverConnectedParams;
/**
- * Write a source file with the given contents. [relativePath]
- * is relative to [sourceDirectory]; on Windows any forward slashes it
- * contains are converted to backslashes.
+ * Write a source file with the given absolute [pathname] and [contents].
*
* If the file didn't previously exist, it is created. If it did, it is
* overwritten.
+ *
+ * Parent directories are created as necessary.
*/
- void writeFile(String relativePath, String contents) {
- String absolutePath = normalizePath(relativePath);
- new Directory(dirname(absolutePath)).createSync(recursive: true);
- new File(absolutePath).writeAsStringSync(contents);
+ void writeFile(String pathname, String contents) {
+ new Directory(dirname(pathname)).createSync(recursive: true);
+ new File(pathname).writeAsStringSync(contents);
}
/**
@@ -73,16 +72,17 @@ abstract class AbstractAnalysisServerIntegrationTest {
* relative to [sourceDirectory]. On Windows any forward slashes in
* [relativePath] are converted to backslashes.
*/
- String normalizePath(String relativePath) {
+ String sourcePath(String relativePath) {
return join(sourceDirectory.path, relativePath.replaceAll('/', separator));
}
/**
- * Send the server an 'analysis.setAnalysisRoots' command.
+ * Send the server an 'analysis.setAnalysisRoots' command directing it to
+ * analyze [sourceDirectory].
*/
- Future setAnalysisRoots(List<String> relativeRoots) {
+ Future standardAnalysisRoot() {
return server.send(ANALYSIS_SET_ANALYSIS_ROOTS, {
- 'included': relativeRoots.map(normalizePath).toList(),
+ 'included': [sourceDirectory.path],
'excluded': []
});
}

Powered by Google App Engine
This is Rietveld 408576698