summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin Torres <devin@devintorr.es>2014-11-03 20:40:12 -0600
committerDevin Torres <devin@devintorr.es>2014-11-03 20:40:12 -0600
commit12e8acf6fa037e85c4338a71fcc1a169f1cbbc05 (patch)
tree0d1579bf058ad3d5ddeff6a750df82bf3adc82a6
parenta88343c593a87d1d5c43ff2498e2a479e749cbee (diff)
parent9585febb58d43d81748774a13720ec5152d2bea7 (diff)
downloadrust-hoedown-12e8acf6fa037e85c4338a71fcc1a169f1cbbc05.tar.gz
Merge pull request #140 from uranusjr/test-windows
Make tests work on Windows
-rw-r--r--Makefile.win5
-rwxr-xr-xtest/runner.py11
2 files changed, 10 insertions, 6 deletions
diff --git a/Makefile.win b/Makefile.win
index cda24b9..ce5ffa2 100644
--- a/Makefile.win
+++ b/Makefile.win
@@ -34,3 +34,8 @@ clean:
.c.obj:
$(CC) $(CFLAGS) /c $< /Fo$@
+
+# Testing
+
+test: hoedown.exe
+ python test\runner.py
diff --git a/test/runner.py b/test/runner.py
index 4102fad..7cbb27d 100755
--- a/test/runner.py
+++ b/test/runner.py
@@ -49,19 +49,18 @@ def _test_func(test_case):
HOEDOWN + flags + [os.path.join(TEST_ROOT, test_case['input'])],
stdout=subprocess.PIPE,
)
- hoedown_proc.wait()
+ stdoutdata = hoedown_proc.communicate()[0]
+
got_tidy_proc = subprocess.Popen(
- TIDY, stdin=hoedown_proc.stdout, stdout=subprocess.PIPE,
+ TIDY, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
)
- got_tidy_proc.wait()
- got = got_tidy_proc.stdout.read().strip()
+ got = got_tidy_proc.communicate(input=stdoutdata)[0].strip()
expected_tidy_proc = subprocess.Popen(
TIDY + [os.path.join(TEST_ROOT, test_case['output'])],
stdout=subprocess.PIPE,
)
- expected_tidy_proc.wait()
- expected = expected_tidy_proc.stdout.read().strip()
+ expected = expected_tidy_proc.communicate()[0].strip()
# Cleanup.
hoedown_proc.stdout.close()