< Summary

Class:GDX.Developer.Reports.BuildVerificationReport
Assembly:GDX
File(s):D:/BuildAgent/work/GDX-Documentation/Projects/GDX_Development/Packages/com.dotbunny.gdx/GDX/Developer/Reports/BuildVerificationReport.cs
Covered lines:0
Uncovered lines:35
Coverable lines:35
Total lines:58
Line coverage:0% (0 of 35)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:6
Method coverage:0% (0 of 6)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
BuildVerificationReport()0%2100%
OutputReport(...)0%6200%
Assert(...)0%6200%
Reset()0%2100%
Skip(...)0%2100%
Panic(...)0%2100%

File(s)

D:/BuildAgent/work/GDX-Documentation/Projects/GDX_Development/Packages/com.dotbunny.gdx/GDX/Developer/Reports/BuildVerificationReport.cs

#LineLine coverage
 1using GDX.Developer.Reports.NUnit;
 2using System.IO;
 3using GDX.Collections.Generic;
 4using Debug = UnityEngine.Debug;
 5
 6namespace GDX.Developer.Reports
 7{
 8    public static class BuildVerificationReport
 9    {
 010        static NUnitReport s_Report = new NUnitReport("BVT", "Build Verification Test");
 011        static SimpleList<string> s_PanicMessages = new SimpleList<string>(2);
 12
 13        public static string OutputReport(string outputPath)
 014        {
 015            if (s_PanicMessages.Count > 0)
 016            {
 017                s_Report.SetForceFail();
 018            }
 19
 020            Platform.ForceDeleteFile(outputPath);
 021            File.WriteAllText(outputPath, s_Report.ToString());
 022            return s_Report.GetResult();
 023        }
 24
 25        public static TestCase Assert(string identifier, bool condition, string failMessage = null, int duration = 0)
 026        {
 027            TestCase test = s_Report.AddDurationResult(identifier, duration, condition, failMessage);
 028            if (test.Result == NUnitReport.PassedString)
 029            {
 030                Debug.Log($"[BVT] {test.Name}: {test.Result}");
 031            }
 32            else
 033            {
 034                Debug.LogError($"[BVT] {test.Name}: {test.Result}, {test.Message}");
 035            }
 036            return test;
 037        }
 38
 39        public static void Reset()
 040        {
 041            s_Report = new NUnitReport();
 042            s_PanicMessages.Clear();
 043        }
 44
 45        public static TestCase Skip(string identifier, string skipMessage)
 046        {
 047            TestCase test = s_Report.AddSkippedTest(identifier, skipMessage);
 048            Debug.Log($"[BVT] {test.Name}: {test.Result}");
 049            return test;
 050        }
 51
 52        public static void Panic(string panicMessage)
 053        {
 054            s_PanicMessages.AddWithExpandCheck(panicMessage);
 055            Debug.LogError($"[BVT] PANIC! {panicMessage}");
 056        }
 57    }
 58}