Commits

Ned Batchelder committed 2b51eb4

Try to make this test impervious to platform differences.

Comments (0)

Files changed (3)

test/farm/html/gold_other/_ned_coverage_trunk_test_farm_html_othersrc_other.html

-<!doctype html PUBLIC "-//W3C//DTD html 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
-<title>Coverage for c:\ned\coverage\trunk\test\farm\html\othersrc\other</title>
-<link rel='stylesheet' href='style.css' type='text/css'>
-<script src='jquery-1.3.2.min.js'></script>
-<script>
-function toggle_lines(btn, cls) {
-    var btn = $(btn);
-    if (btn.hasClass("hide")) {
-        $("#source ."+cls).removeClass("hide");
-        btn.removeClass("hide");
-    }
-    else {
-        $("#source ."+cls).addClass("hide");
-        btn.addClass("hide");
-    }
-}
-</script>
-</head>
-<body>
-<div id='header'>
-    <div class='content'>
-        <h1>Coverage for <b>c:\ned\coverage\trunk\test\farm\html\othersrc\other</b> :
-            <span class='pc_cov'>100%</span>
-        </h1>
-        <h2 class='stats'>
-            1 statements
-            <span class='run hide' onclick='toggle_lines(this, "run")'>1 run</span>
-            <span class='exc' onclick='toggle_lines(this, "exc")'>0 excluded</span>
-            <span class='mis' onclick='toggle_lines(this, "mis")'>0 missing</span>
-        </h2>
-    </div>
-</div>
-
-<div id='source'>
-<table cellspacing='0' cellpadding='0'>
-<tr>
-<td class='linenos' valign='top'>
-<p class='pln'>1</p>
-<p class='pln'>2</p>
-<p class='pln'>3</p>
-<p class='stm run hide'>4</p>
-    
-</td>
-<td class='text' valign='top'>
-<p class='pln'><span class='com'># A file in another directory.&nbsp; We&#39;re checking that it ends up in the</span><span class="strut">&nbsp;</span></p>
-<p class='pln'><span class='com'># HTML report.</span><span class="strut">&nbsp;</span></p>
-<p class='pln'><span class="strut">&nbsp;</span></p>
-<p class='stm run hide'><span class='key'>print</span><span class='op'>(</span><span class='str'>&quot;This is the other src!&quot;</span><span class='op'>)</span><span class="strut">&nbsp;</span></p>
-    
-</td>
-</tr>
-</table>
-</div>
-
-</body>
-</html>

test/farm/html/gold_other/blah_blah_other.html

+<!doctype html PUBLIC "-//W3C//DTD html 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Coverage for c:\ned\coverage\trunk\test\farm\html\othersrc\other</title>
+<link rel='stylesheet' href='style.css' type='text/css'>
+<script src='jquery-1.3.2.min.js'></script>
+<script>
+function toggle_lines(btn, cls) {
+    var btn = $(btn);
+    if (btn.hasClass("hide")) {
+        $("#source ."+cls).removeClass("hide");
+        btn.removeClass("hide");
+    }
+    else {
+        $("#source ."+cls).addClass("hide");
+        btn.addClass("hide");
+    }
+}
+</script>
+</head>
+<body>
+<div id='header'>
+    <div class='content'>
+        <h1>Coverage for <b>c:\ned\coverage\trunk\test\farm\html\othersrc\other</b> :
+            <span class='pc_cov'>100%</span>
+        </h1>
+        <h2 class='stats'>
+            1 statements
+            <span class='run hide' onclick='toggle_lines(this, "run")'>1 run</span>
+            <span class='exc' onclick='toggle_lines(this, "exc")'>0 excluded</span>
+            <span class='mis' onclick='toggle_lines(this, "mis")'>0 missing</span>
+        </h2>
+    </div>
+</div>
+
+<div id='source'>
+<table cellspacing='0' cellpadding='0'>
+<tr>
+<td class='linenos' valign='top'>
+<p class='pln'>1</p>
+<p class='pln'>2</p>
+<p class='pln'>3</p>
+<p class='stm run hide'>4</p>
+    
+</td>
+<td class='text' valign='top'>
+<p class='pln'><span class='com'># A file in another directory.&nbsp; We&#39;re checking that it ends up in the</span><span class="strut">&nbsp;</span></p>
+<p class='pln'><span class='com'># HTML report.</span><span class="strut">&nbsp;</span></p>
+<p class='pln'><span class="strut">&nbsp;</span></p>
+<p class='stm run hide'><span class='key'>print</span><span class='op'>(</span><span class='str'>&quot;This is the other src!&quot;</span><span class='op'>)</span><span class="strut">&nbsp;</span></p>
+    
+</td>
+</tr>
+</table>
+</div>
+
+</body>
+</html>

test/farm/html/run_other.py

 
 runfunc(html_it, rundir="src", addtopath="../othersrc")
 
+# Different platforms will name the "other" file differently. Rename it
+import os, glob
+
+for p in glob.glob("otherhtml/*_other.html"):
+    os.rename(p, "otherhtml/blah_blah_other.html")
+
 # HTML files will change often.  Check that the sizes are reasonable,
 #   and check that certain key strings are in the output.
 compare("gold_other", "otherhtml", size_within=10)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.