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

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: Make suggested changes 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..d52d0558babe290d373d585a5fae6f1b56a0bf3c 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";
@@ -189,10 +181,24 @@ testSameDVI() {
}
}
+runWithTempDir(void test(String tempDir)) {
Bill Hesse 2015/01/28 13:41:34 Changed name of function to runWithTempDir. It is
+ final tempDir = Directory.systemTemp.createTempSync("addlatexhash_test");
+ try {
+ test(tempDir.path);
+ }
+ finally {
+ tempDir.delete(recursive: true);
+ }
+}
+
+
main([args]) {
testCutMatch();
testSisp();
- testSameHash();
+
+ runWithTempDir(testSameHash);
// 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") {
+ runWithTempDir(testSameDVI);
+ }
}
« 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