1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 04:50:09 +00:00

add test in makefile

This commit is contained in:
Lu Wang 2013-06-07 01:15:14 +08:00
parent 66b9c52c98
commit 6e753c1465
2 changed files with 6 additions and 2 deletions

View File

@ -212,3 +212,6 @@ file (GLOB datafiles
)
install (FILES ${datafiles} DESTINATION share/pdf2htmlEX)
install (FILES pdf2htmlEX.1 DESTINATION share/man/man1)
enable_testing()
add_test(test_naming python test/test_naming.py)

View File

@ -251,9 +251,10 @@ class OutputNamingTests(unittest.TestCase):
self.assertEquals(files, ['foo%%.html'])
if __name__=="__main__":
if not os.path.isfile(PDF2HTMLEX_PATH) or not os.access(PDF2HTMLEX_PATH, os.X_OK):
executable = os.path.abspath(os.path.join(os.path.dirname(__file__), PDF2HTMLEX_PATH))
if not os.path.isfile(executable) or not os.access(executable, os.X_OK):
print >> sys.stderr, "Cannot locate pdf2htmlEX executable. Make sure source was built before running this test."
exit(1)
suite = unittest.loader.TestLoader().loadTestsFromTestCase(OutputNamingTests)
unittest.TextTestRunner(verbosity=2).run(suite)
unittest.TextTestRunner(verbosity=2).run(suite)