diff --git a/test/functional/setup/build_ksp.py b/test/functional/setup/build_ksp.py index 54b661fe..27b07997 100644 --- a/test/functional/setup/build_ksp.py +++ b/test/functional/setup/build_ksp.py @@ -100,8 +100,12 @@ if __name__ == '__main__': app_name = args.APPNAME header = 'msodbcsql.h' + cwd = os.getcwd() + # make sure all required source and header files are present work_dir = os.path.dirname(os.path.realpath(__file__)) + os.chdir(work_dir) + if not os.path.exists(os.path.join(work_dir, header)): print('Error: {0} not found!'.format(header)) exit(1) @@ -114,4 +118,7 @@ if __name__ == '__main__': compile_KSP(ksp_name) configure_KSP(app_name) + + os.chdir(cwd) + \ No newline at end of file diff --git a/test/functional/setup/run_ksp.py b/test/functional/setup/run_ksp.py index 411807c5..0d0ff897 100644 --- a/test/functional/setup/run_ksp.py +++ b/test/functional/setup/run_ksp.py @@ -32,9 +32,12 @@ if __name__ == '__main__': args = parser.parse_args() app_name = 'ksp_app' - + cwd = os.getcwd() + # first check if the ksp app is present work_dir = os.path.dirname(os.path.realpath(__file__)) + os.chdir(work_dir) + if platform.system() == 'Windows': path = os.path.join(work_dir, app_name + '.exe') executable = app_name @@ -50,3 +53,5 @@ if __name__ == '__main__': os.system('{0} 1 {1} {2} {3} {4}'.format(executable, args.SERVER, args.DBNAME, args.UID, args.PWD)) else: os.system('{0} 0 {1} {2} {3} {4}'.format(executable, args.SERVER, args.DBNAME, args.UID, args.PWD)) + + os.chdir(cwd)