Index: packages/Python/lldbsuite/test/lldbtest.py =================================================================== --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -1351,14 +1351,31 @@ if (version is None): return True + + def compare_version_strings(v1, v2): + split1 = v1.split('.') + split2 = v2.split('.') + while len(split1) > len(split2): + split2.append("0") + while len(split2) > len(split1): + split1.append("0") + + versions = zip(split1, split2) + for (subv1, subv2) in versions: + diff = int(subv1) - int(subv2) + if diff != 0: + return diff + + return 0 + if (operator == '>'): - return self.getCompilerVersion() > version + return compare_version_strings(self.getCompilerVersion(), version) > 0 if (operator == '>=' or operator == '=>'): - return self.getCompilerVersion() >= version + return compare_version_strings(self.getCompilerVersion(), version) >= 0 if (operator == '<'): - return self.getCompilerVersion() < version + return compare_version_strings(self.getCompilerVersion(), version) < 0 if (operator == '<=' or operator == '=<'): - return self.getCompilerVersion() <= version + return compare_version_strings(self.getCompilerVersion(), version) <= 0 if (operator == '!=' or operator == '!' or operator == 'not'): return str(version) not in str(self.getCompilerVersion()) return str(version) in str(self.getCompilerVersion())