mirror of
https://github.com/Facepunch/sbox-public.git
synced 2025-12-23 22:48:07 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
29 lines
735 B
C#
29 lines
735 B
C#
using System;
|
|
|
|
namespace Addon
|
|
{
|
|
[TestClass]
|
|
public class BuiltInTests
|
|
{
|
|
/// <summary>
|
|
/// Built-in projects must not have any compile-time warnings.
|
|
/// </summary>
|
|
[TestMethod]
|
|
public async Task NoWarnings()
|
|
{
|
|
await Project.InitializeBuiltIn( false );
|
|
await Project.CompileAsync();
|
|
|
|
var warnings = Project.All
|
|
.Where( x => x.Compiler is not null )
|
|
.SelectMany( x => x.Compiler.Diagnostics )
|
|
.Where( x => x.Severity > Microsoft.CodeAnalysis.DiagnosticSeverity.Info )
|
|
.ToArray();
|
|
|
|
Assert.AreEqual( 0, warnings.Length,
|
|
$"Built-in projects had compile-time warnings.{Environment.NewLine}" +
|
|
string.Join( $"{Environment.NewLine} ", warnings.Select( x => x.ToString() ) ) );
|
|
}
|
|
}
|
|
}
|