/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Compilers/VisualBasic/Test/Semantic/HasValidFonts.vb
41 строка
2 KB
Fred Silberberg
Shipping tasks (#73617)
23 май 2024, 21:44
Не верифицирован
23 май 2024, 21:44
2b7d172
Код
Авторство
О чём код?
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Drawing Imports System.Runtime.InteropServices Imports Roslyn.Test.Utilities Friend Class HasValidFonts Inherits ExecutionCondition Public Overrides ReadOnly Property ShouldSkip As Boolean Get Try If RuntimeInformation.IsOSPlatform(OSPlatform.Windows) Then #Disable Warning CA1416 ' Validate platform compatibility, we don't run tests on Windows < 6.1 Dim result = SystemFonts.DefaultFont #Enable Warning CA1416 ' Validate platform compatibility Return result Is Nothing Else ' The only tests using fonts are Windows-only. Return True End If Catch ex As Exception ' Motivating issue: https://github.com/dotnet/roslyn/issues/11278 ' ' On a small percentage of Jenkins runs we see that fonts are corrupted on the machine. That causes any ' font based test to fail with no reasonable way to recover (other than manually re-installing fonts). ' ' This at least gives us a mechanism for skipping those tests when fonts are in a bad state. Return True End Try End Get End Property Public Overrides ReadOnly Property SkipReason As String Get Return "Fonts are unavailable" End Get End Property End Class