cmark

My personal build of CMark ✏️

Commit
ab5666eae00102f0ea7753f6c449e9778b14287b
Parent
c5b77c7b01ef6ff035b3afe618de5a6bc353c9cf
Author
John MacFarlane <jgm@berkeley.edu>
Date

pathological_tests: removed timeout stuff.

It breaks on Windows.

Diffstat

1 file changed, 11 insertions, 23 deletions

Status File Name N° Changes Insertions Deletions
Modified test/pathological_tests.py 34 11 23
diff --git a/test/pathological_tests.py b/test/pathological_tests.py
@@ -6,8 +6,6 @@ import argparse
 import sys
 import platform
 from cmark import CMark
-from multiprocessing import Process, Value
-import time
 
 if __name__ == "__main__":
     parser = argparse.ArgumentParser(description='Run cmark tests.')
@@ -55,38 +53,28 @@ pathological = {
     }
 
 whitespace_re = re.compile('/s+/')
-passed = Value('i', 0)
-errored = Value('i', 0)
-failed = Value('i', 0)
+passed = 0
+errored = 0
+failed = 0
 
-def do_cmark_test(inp, regex, passed, errored, failed):
+print("Testing pathological cases:")
+for description in pathological:
+    (inp, regex) = pathological[description]
     [rc, actual, err] = cmark.to_html(inp)
     if rc != 0:
-        errored.value += 1
+        errored += 1
         print(description, '[ERRORED (return code %d)]' %rc)
         print(err)
     elif regex.search(actual):
         print(description, '[PASSED]')
-        passed.value += 1
+        passed += 1
     else:
         print(description, '[FAILED]')
         print(repr(actual))
-        failed.value += 1
-
-print("Testing pathological cases:")
-for description in pathological:
-    (inp, regex) = pathological[description]
-    p = Process(target=do_cmark_test, args=(inp, regex, passed, errored, failed))
-    p.start()
-    p.join(1)
-    if p.is_alive():
-        print(description, '[FAILED (timed out)]')
-        p.terminate()
-        p.join()
-        failed.value += 1
+        failed += 1
 
-print("%d passed, %d failed, %d errored" % (passed.value, failed.value, errored.value))
-if (failed.value == 0 and errored.value == 0):
+print("%d passed, %d failed, %d errored" % (passed, failed, errored))
+if (failed == 0 and errored == 0):
     exit(0)
 else:
     exit(1)