< Summary

Class:GDX.Developer.Reports.BuildVerificationReport
Assembly:GDX
File(s):./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)

./Packages/com.dotbunny.gdx/GDX/Developer/Reports/BuildVerificationReport.cs

#LineLine coverage
 1using System.IO;
 2using GDX.Collections.Generic;
 3using GDX.Developer.Reports.NUnit;
 4
 5namespace GDX.Developer.Reports
 6{
 7    public static class BuildVerificationReport
 8    {
 09        static NUnitReport s_Report = new NUnitReport("BVT", "Build Verification Test");
 010        static SimpleList<string> s_PanicMessages = new SimpleList<string>(2);
 11
 12        public static string OutputReport(string outputPath)
 013        {
 014            if (s_PanicMessages.Count > 0)
 015            {
 016                s_Report.SetForceFail();
 017            }
 18
 019            Platform.ForceDeleteFile(outputPath);
 020            File.WriteAllText(outputPath, s_Report.ToString());
 021            return s_Report.GetResult();
 022        }
 23
 24        public static TestCase Assert(string identifier, bool condition, string failMessage = null, int duration = 0)
 025        {
 026            TestCase test = s_Report.AddDurationResult(identifier, duration, condition, failMessage);
 027            if (test.Result == NUnitReport.PassedString)
 028            {
 029                UnityEngine.Debug.Log($"{test.Name}: {test.Result}");
 030            }
 31            else
 032            {
 033                UnityEngine.Debug.Log($"{test.Name}: {test.Result}, {test.Message}");
 034            }
 35
 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            UnityEngine.Debug.Log($"{test.Name}: {test.Result}");
 049            return test;
 050        }
 51
 52        public static void Panic(string panicMessage)
 053        {
 054            s_PanicMessages.AddWithExpandCheck(panicMessage);
 055            UnityEngine.Debug.LogError($"PANIC! {panicMessage}");
 056        }
 57    }
 58}