This revision was automatically updated to reflect the committed changes. Closed by commit rL354047: [dotest] Fix compiler version number comparison (authored by friss, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits.
Changed prior to commit: https://reviews.llvm.org/D58219?vs=186782&id=186873#toc Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58219/new/ https://reviews.llvm.org/D58219 Files: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py =================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py @@ -37,6 +37,7 @@ # System modules import abc import collections +from distutils.version import LooseVersion from functools import wraps import gc import glob @@ -1352,13 +1353,13 @@ if (version is None): return True if (operator == '>'): - return self.getCompilerVersion() > version + return LooseVersion(self.getCompilerVersion()) > LooseVersion(version) if (operator == '>=' or operator == '=>'): - return self.getCompilerVersion() >= version + return LooseVersion(self.getCompilerVersion()) >= LooseVersion(version) if (operator == '<'): - return self.getCompilerVersion() < version + return LooseVersion(self.getCompilerVersion()) < LooseVersion(version) if (operator == '<=' or operator == '=<'): - return self.getCompilerVersion() <= version + return LooseVersion(self.getCompilerVersion()) <= LooseVersion(version) if (operator == '!=' or operator == '!' or operator == 'not'): return str(version) not in str(self.getCompilerVersion()) return str(version) in str(self.getCompilerVersion())
Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py =================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py @@ -37,6 +37,7 @@ # System modules import abc import collections +from distutils.version import LooseVersion from functools import wraps import gc import glob @@ -1352,13 +1353,13 @@ if (version is None): return True if (operator == '>'): - return self.getCompilerVersion() > version + return LooseVersion(self.getCompilerVersion()) > LooseVersion(version) if (operator == '>=' or operator == '=>'): - return self.getCompilerVersion() >= version + return LooseVersion(self.getCompilerVersion()) >= LooseVersion(version) if (operator == '<'): - return self.getCompilerVersion() < version + return LooseVersion(self.getCompilerVersion()) < LooseVersion(version) if (operator == '<=' or operator == '=<'): - return self.getCompilerVersion() <= version + return LooseVersion(self.getCompilerVersion()) <= LooseVersion(version) if (operator == '!=' or operator == '!' or operator == 'not'): return str(version) not in str(self.getCompilerVersion()) return str(version) in str(self.getCompilerVersion())
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits