Skip to content

Commit b5e63b0

Browse files
Fix version.txt path on macOS
1 parent 02e60cd commit b5e63b0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tests/sources/test_cppcheck.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,13 @@ def setUp(self):
3232
self.extensions = ['c', 'h', 'cpp', 'hpp', 'cc', 'hh', 'c++', 'h++']
3333
if (sys.platform.startswith('linux')):
3434
self.platformOptions = ' -D__linux__'
35-
version_path = os.path.join(self.WEBOTS_HOME, 'resources', 'version.txt')
3635
elif (sys.platform.startswith('win32')):
3736
self.platformOptions = ' -D_WIN32'
38-
version_path = os.path.join(self.WEBOTS_HOME, 'resources', 'version.txt')
3937
else:
4038
self.platformOptions = ' -D__APPLE__'
41-
version_path = os.path.join(self.WEBOTS_HOME, 'Contents', 'Resources', 'version.txt')
42-
with open(version_path, "r") as versionFile:
43-
version = versionFile.read().strip()
39+
40+
with open(os.path.join(self.WEBOTS_HOME, 'resources', 'version.txt'), 'r') as file:
41+
version = file.readlines()[0].strip()
4442
self.platformOptions += ' -DLIBCONTROLLER_VERSION=' + version
4543

4644
def test_cppcheck_is_correctly_installed(self):

0 commit comments

Comments
 (0)