Index: tests/standalone/io/addlatexhash_test.dart |
diff --git a/tests/standalone/io/addlatexhash_test.dart b/tests/standalone/io/addlatexhash_test.dart |
index 582b75adfb3887b37f25483795e29495c39449cb..5c1c74046c400a18077cf5a1bdc2220f8fb2f0b1 100755 |
--- a/tests/standalone/io/addlatexhash_test.dart |
+++ b/tests/standalone/io/addlatexhash_test.dart |
@@ -13,6 +13,16 @@ final scriptDir = path.dirname(path.fromUri(Platform.script)); |
final dartRootDir = path.dirname(path.dirname(path.dirname(scriptDir))); |
final dartRootPath = dartRootDir.toString(); |
+List<String> packageOptions() { |
+ if (Platform.packageRoot != null) { |
+ return <String>['--package-root=${Platform.packageRoot}']; |
+ } else if (Platform.packageConfig != null) { |
+ return <String>['--packages=${Platform.packageConfig}']; |
+ } else { |
+ return <String>[]; |
+ } |
+} |
+ |
// Check that the given ProcessResult indicates success; if so |
// return the standard output, otherwise report the failure |
checkAction(result, errorMessage) { |
@@ -81,13 +91,13 @@ testSameHash(String tmpDirPath) { |
// actions to take |
runAddHash() { |
- var args = [ |
- '--package-root=${Platform.packageRoot}', |
+ var args = packageOptions(); |
+ args.addAll([ |
path.join(dartRootPath, "tools", "addlatexhash.dart"), |
tmpPar8timesPath, |
hashPath, |
listPath |
- ]; |
+ ]); |
return Process.runSync(dartExecutable, args); |
} |
@@ -154,13 +164,13 @@ testSameDVI(String tmpDirPath) { |
Process.runSync("latex", [fileName], workingDirectory: workingDirectory); |
runAddHash() { |
- var args = [ |
- '--package-root=${Platform.packageRoot}', |
+ var args = packageOptions(); |
+ args.addAll([ |
path.join(dartRootPath, "tools", "addlatexhash.dart"), |
tmpSpecPath, |
hashPath, |
listPath |
- ]; |
+ ]); |
return Process.runSync(dartExecutable, args); |
} |