Description: Allow controlling which pdf2htmlEX executable is chosen for testing
Author: Johannes Schauer <j.schauer@email.de>
Forwarded: not-needed

--- a/test/test_naming.py
+++ b/test/test_naming.py
@@ -16,7 +16,7 @@ DATA_DIR = os.path.join(TEST_DIR, '../sh
 
 # The script should be run in the directory containing the binary
 # The location where the executable is generated by the build
-PDF2HTMLEX_PATH = './pdf2htmlEX'
+PDF2HTMLEX_PATH = os.getenv('PDF2HTMLEX_EXECUTABLE', './pdf2htmlEX')
 
 
 def execute_pdf2htmlex_with_args(args):
@@ -31,7 +31,10 @@ def execute_pdf2htmlex_with_args(args):
     """
     executable = os.path.abspath(PDF2HTMLEX_PATH)
 
-    cmd = [executable, '--data-dir', os.path.abspath(DATA_DIR)]
+    if os.getenv('PDF2HTMLEX_TESTNODATADIR', '').lower() in ['yes', 'true']:
+        cmd = [executable]
+    else:
+        cmd = [executable, '--data-dir', os.path.abspath(DATA_DIR)]
 
     for val in args:
         cmd.append(str(val))
@@ -258,5 +261,6 @@ if __name__=="__main__":
     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)
+    print >> sys.stderr, "Using %s as executable"%executable
 
     unittest.main()
