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

Unified Diff: tests/standalone/io/addlatexhash_test.dart

Issue 883793002: Make addlatexhash_test clean up its temp directories. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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: tests/standalone/io/addlatexhash_test.dart
diff --git a/tests/standalone/io/addlatexhash_test.dart b/tests/standalone/io/addlatexhash_test.dart
index dbefe39ff8a352f7a3b08c8b0342c5edd8b6f59f..f6be85b948207900a49461cfaf39db9464b51788 100755
--- a/tests/standalone/io/addlatexhash_test.dart
+++ b/tests/standalone/io/addlatexhash_test.dart
@@ -59,11 +59,7 @@ testSisp() {
// LaTeX source 'addlatexhash_test_src.tex' are identical in groups
// of eight (so we get 8 identical hash values, then another hash
// value 8 times, etc.)
-testSameHash() {
- // set up temporary directory to hold output
- final tmpDir = Directory.systemTemp.createTempSync("addlatexhash_test");
- final tmpDirPath = tmpDir.path;
-
+testSameHash(String tmpDirPath) {
// file names/paths for file containing groups of 8 variants of a paragraph
const par8timesName = "addlatexhash_test_src";
const par8timesFileName = "$par8timesName.tex";
@@ -120,11 +116,7 @@ testSameHash() {
// does not affect the generated output, as seen via dvi2tty and diff.
// NB: Not part of normal testing (only local): latex and dvi2tty are
// not installed in the standard test environment.
-testSameDVI() {
- // set up /tmp directory to hold output
- final tmpDir = Directory.systemTemp.createTempSync("addlatexhash_test");
- final tmpDirPath = tmpDir.path;
-
+testSameDVI(String tmpDirPath) {
// file names/paths for original spec
const specName = "dartLangSpec";
const specFileName = "$specName.tex";
@@ -192,7 +184,20 @@ testSameDVI() {
main([args]) {
testCutMatch();
testSisp();
- testSameHash();
+
+ final tmpDir = Directory.systemTemp.createTempSync("addlatexhash_test");
+ try {
+ testSameHash(tmpDir.path);
+ } finally {
+ tmpDir.delete(recursive: true);
+ }
// latex and dvi2tty are not installed in the standard test environment
- if (args.length > 0 && args[0] == "local") testSameDVI();
+ if (args.length > 0 && args[0] == "local") {
+ final dviDir = Directory.systemTemp.createTempSync("addlatexhash_test");
+ try {
+ testSameDVI(dviDir.path);
+ } finally {
+ dviDir.delete(recursive: true);
+ }
+ }
eernst 2015/01/28 13:04:35 Ah, of course I should have removed those tmp file
}
« 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