コード例 #1
0
ファイル: FileWriter.cs プロジェクト: mambotuna/DOTS-training
    /// <summary>
    /// Writes a pretty-printed .csv compatible string to data file
    /// </summary>
    /// <param name="test">The test whose results will be captured in the file change</param>
    public void WriteParadeTestResultToFile(ParadeTest test)
    {
        if (!File.Exists(filePath))
        {
            createBaseFile();
        }

        string result = "";

        result += test.TestDate.ToString(dateFormat) + ",";

        ParadeConfiguration testConfig = test.TestConfiguration;

        result += testConfig.ConfigName + ",";

#if UNITY_EDITOR
        result += "Editor" + ",";
#elif DEVELOPMENT_BUILD
        result += "Development Build" + ",";
#else
        result += "Production Build" + ",";
#endif

        result += test.ElapsedTestTime + ",";
        result += test.TestFrameCount + ",";
        result += (test.TestFrameCount / test.ElapsedTestTime) + "";

        result += Environment.NewLine;

        try
        {
            File.AppendAllText(filePath, result);
        }
        catch (Exception e)
        {
            Debug.LogError("FileWriter.WriteParadeTestResultToFile():: Exception ocurred: '" + e.Message + "'");
        }
        finally
        {
        }
    }
コード例 #2
0
ファイル: ParadeTest.cs プロジェクト: mambotuna/DOTS-training
 public ParadeTest(ParadeConfiguration config)
 {
     testConfiguration = config;
 }