From edbe4cb2fbf9569fd8b94171bd98cc2ab1475ef7 Mon Sep 17 00:00:00 2001 From: John McNamara Date: Wed, 16 Feb 2022 21:01:52 +0000 Subject: [PATCH] Fix to allow functional tests to run on Windows. --- test/functional/base_test_class.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/functional/base_test_class.py b/test/functional/base_test_class.py index bc5ea1fe..8f3c219a 100644 --- a/test/functional/base_test_class.py +++ b/test/functional/base_test_class.py @@ -7,6 +7,7 @@ import unittest import os +import sys from helper_functions import _compare_xlsx_files @@ -28,8 +29,14 @@ class XLSXBaseTest(unittest.TestCase): def run_exe_test(self, exe_name, exp_filename=None): """Run C exe and compare output xlsx file with the Excel file.""" + # Create the executable command + if sys.platform == 'win32': + command = r'cd test\functional\src && %s.exe' % exe_name + else: + command = 'cd test/functional/src && ./%s' % exe_name + # Run the C executable to generate the "got" xlsx file. - got = os.system("cd test/functional/src; ./%s" % exe_name) + got = os.system(command) self.assertEqual(got, self.no_system_error) # Create the path/file names for the xlsx/xlsm files to compare.