forked from Ericsson/codechecker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] Cppcheck premium version check
Cppcheck Premium version dumps the version number in the following format: Cppcheck Premium 1.2.3 CodeChecker couldn't handle the "Premium" word in the middle. Fixes Ericsson#4133
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# ------------------------------------------------------------------------- | ||
# | ||
# Part of the CodeChecker project, under the Apache License v2.0 with | ||
# LLVM Exceptions. See LICENSE for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
# | ||
# ------------------------------------------------------------------------- | ||
|
||
""" Test Cppcheck version parsing. """ | ||
|
||
|
||
import unittest | ||
|
||
from codechecker_analyzer.analyzers.cppcheck.analyzer import parse_version | ||
|
||
|
||
class CppcheckVersionTest(unittest.TestCase): | ||
""" | ||
Test the parsing of various possible version strings, which cppcheck | ||
binaries can produce. | ||
""" | ||
|
||
def test_cppcheck_version(self): | ||
self.assertEqual(parse_version('Cppcheck 1.2.3'), '1.2.3') | ||
self.assertEqual(parse_version('Cppcheck Premium 1.2.3'), '1.2.3') |