File: run.py

package info (click to toggle)
txt2tags 3.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,160 kB
  • sloc: python: 3,002; sh: 45; makefile: 35
file content (30 lines) | stat: -rw-r--r-- 694 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#
# txt2tags fatal errors tester (http://txt2tags.org)
# See also: ../run.py ../lib.py
#
# All these bugs are already fixed on the current version.
# In older releases they dump an ugly Error Traceback.
#


import glob
import sys

sys.path.insert(0, "..")
import lib

del sys.path[0]


def run():
    # test all .t2t files found
    for infile in glob.glob("*.t2t"):
        basename = infile.replace(".t2t", "")
        outfile = basename + ".html"
        print("  Testing %s ..." % basename, end=" ")
        cmdline = lib.TXT2TAGS + [infile]
        output = lib.get_output(cmdline)
        if not output:
            lib.mark_ok(outfile)
        else:
            lib.mark_failed(outfile)