1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00

started repairing test

This commit is contained in:
Joachim Wuttke (l) 2016-09-26 09:35:53 +02:00
parent 271bd3aeb2
commit 4921b4564b
2 changed files with 14 additions and 7 deletions

View File

@ -216,4 +216,4 @@ install (FILES ${PDF2HTMLEX_RESOURCE} DESTINATION share/pdf2htmlEX)
install (FILES pdf2htmlEX.1 DESTINATION share/man/man1) install (FILES pdf2htmlEX.1 DESTINATION share/man/man1)
enable_testing() enable_testing()
add_test(test python ${CMAKE_SOURCE_DIR}/test/test.py) add_test(test python ${CMAKE_SOURCE_DIR}/test/test.py ${CMAKE_BINARY_DIR}/bin/pdf2htmlEX)

View File

@ -9,6 +9,10 @@ import subprocess
class Common(object): class Common(object):
SRC_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SRC_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
print "DEBUG 1: ", __file__
print "DEBUG 2: ", os.path.abspath(__file__)
print "DEBUG 3: ", os.path.dirname(os.path.abspath(__file__))
print "DEBUG 4: ", SRC_DIR
TEST_DIR = os.path.join(SRC_DIR, 'test') TEST_DIR = os.path.join(SRC_DIR, 'test')
DATA_DIR = os.path.join(SRC_DIR, 'share') DATA_DIR = os.path.join(SRC_DIR, 'share')
PDF2HTMLEX_PATH = os.path.join(SRC_DIR, 'pdf2htmlEX') PDF2HTMLEX_PATH = os.path.join(SRC_DIR, 'pdf2htmlEX')
@ -82,6 +86,9 @@ class Common(object):
if __name__ == '__main__': if __name__ == '__main__':
if not len(sys.argv)==2:
print >> sys.stderr, "Usage: python test.py <pdf2htmlEX_executable_path>"
exit(1)
if not os.path.isfile(Common.PDF2HTMLEX_PATH) or not os.access(Common.PDF2HTMLEX_PATH, os.X_OK): if not os.path.isfile(Common.PDF2HTMLEX_PATH) or not os.access(Common.PDF2HTMLEX_PATH, os.X_OK):
print >> sys.stderr, "Cannot locate pdf2htmlEX executable. Make sure source was built before running this test." print >> sys.stderr, "Cannot locate pdf2htmlEX executable. Make sure source was built before running this test."
exit(1) exit(1)