diff --git a/CMakeLists.txt b/CMakeLists.txt index 900401a..b7997dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/test/test_naming.py b/test/test_naming.py index 1f3d82f..c178ba2 100644 --- a/test/test_naming.py +++ b/test/test_naming.py @@ -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) \ No newline at end of file + unittest.TextTestRunner(verbosity=2).run(suite)