Chromium Code Reviews| 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); |
| + } |
| } |