Added support for various platforms for CodeMetaInfo tests. ^KT-41996

The tests need to be able to parse and render CodeMetaInfo for different
 platforms. For example, we must draw a run gutter a MAC application on
 OSX, but for a Win application, the gutter should not be drawn at the
 same time. This commit allows to do such checks. In order to indicate
 on which platform it should be rendered, it is necessary to specify the
 platform for a specific CodeMetaInfo in the test data in the format
 {OSX,Unix,Win}, if the block with platforms is missing, this means
 that it should be rendered on each platform.

<!LINE_MARKER{OSX}(...)!> - should only be on OSX
<!LINE_MARKER(...)!> - should be on any platform
This commit is contained in:
Alexander Dudinsky
2020-10-10 10:05:03 +03:00
parent 84d24e5b76
commit 94bf38a7b5
6 changed files with 226 additions and 140 deletions
@@ -60,7 +60,7 @@ object CheckerTestUtil {
const val OLD_INFERENCE_PREFIX = "OI"
private const val IGNORE_DIAGNOSTIC_PARAMETER = "IGNORE"
private const val INDIVIDUAL_DIAGNOSTIC = """(\w+;)?(\w+:)?(\w+)(?:\(((?:".*?")(?:,\s*".*?")*)\))?"""
private const val INDIVIDUAL_DIAGNOSTIC = """(\w+;)?(\w+:)?(\w+)(\{[\w;]+})?(?:\(((?:".*?")(?:,\s*".*?")*)\))?"""
val rangeStartOrEndPattern = Pattern.compile("(<!$INDIVIDUAL_DIAGNOSTIC(,\\s*$INDIVIDUAL_DIAGNOSTIC)*!>)|(<!>)")
val individualDiagnosticPattern: Pattern = Pattern.compile(INDIVIDUAL_DIAGNOSTIC)