Skip to content

Commit 02e60cd

Browse files
Set LIBCONTROLLER_VERSION macro for source tests
1 parent c3b73e7 commit 02e60cd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/sources/test_cppcheck.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,16 @@ 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')
3536
elif (sys.platform.startswith('win32')):
3637
self.platformOptions = ' -D_WIN32'
38+
version_path = os.path.join(self.WEBOTS_HOME, 'resources', 'version.txt')
3739
else:
3840
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()
44+
self.platformOptions += ' -DLIBCONTROLLER_VERSION=' + version
3945

4046
def test_cppcheck_is_correctly_installed(self):
4147
"""Test Cppcheck is correctly installed."""

0 commit comments

Comments
 (0)