File: libVersions.py

package info (click to toggle)
yade 2026.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,448 kB
  • sloc: cpp: 97,645; python: 52,173; sh: 677; makefile: 162
file content (27 lines) | stat: -rw-r--r-- 1,032 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import unittest
import yade.libVersions


class TestLibVersions(unittest.TestCase):

	def setUp(self):
		pass  # no setup needed for tests here

	def testLibVersions(self):
		# calling them is enough, to make sure they do not throw any errors.
		cmakeVer = yade.libVersions.getAllVersionsCmake()
		cppVer = yade.libVersions.getAllVersionsCpp()
		print("cmake versions: ", cmakeVer)
		print("C++ versions: ", cppVer)
		print("\n")
		yade.libVersions.printAllVersions(True)
		yade.libVersions.printAllVersions(False)
		for key, val in cmakeVer.items():
			if ((key in cppVer) and (len(val) == 2) and (len(cppVer[key]) == 2)):
				print(str(key) + " version reported by by cmake is ", val, " and by C++ is ", cppVer[key])
				if (val[0] != cppVer[key][0]):
					print(
					        '\n\033[93m' + " Warning: " + '\033[0m' + str(key) + " versions are different, CMAKE: " + str(val[0]) +
					        " vs. C++: " + str(cppVer[key][0])
					)
					print(" Something suspicious is going on. Can you help with file py/libVersions.py.in?")