mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-07-31 15:58:27 -04:00
* Move all unit tests to Engine/Tests * Fix Margin.EdgeSubtract * Fix Capsule.Contains * EnvironmentVariables.Remove if it's null * Fixed ray trace never returning startedsolid * Fix HistoryList.Navigate on empty list * Fix GameObject.WorldPosition accepting NaNs * Fix flex: initial expanding to the wrong grow/shrink * Translation.TryConvert shouldn't throw on invalid enum strings * Skip sound file tests on machines with no audio device
29 lines
739 B
C#
29 lines
739 B
C#
using System;
|
|
|
|
namespace AddonTests
|
|
{
|
|
[TestClass]
|
|
public class BuiltInTest
|
|
{
|
|
/// <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() ) ) );
|
|
}
|
|
}
|
|
}
|