コード例 #1
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="context">The current cake context.</param>
        /// <param name="projectFolder">The absolute path to the Unity3D project to build.</param>
        /// <param name="options">The test options to use when building the project.</param>
        public Unity3DTestContext(ICakeContext context, FilePath projectFolder, Unity3DTestOptions options)
        {
            m_cakeContext   = context;
            m_projectFolder = projectFolder;
            m_testOptions   = options;

            if (string.IsNullOrEmpty(options.TestResultOutputPath))
            {
                options.TestResultOutputPath = System.IO.Path.Combine(projectFolder.FullPath, "test_results.xml");
            }

            if (!System.IO.File.Exists(options.UnityEditorLocation))
            {
                throw new Exception($"The Unity Editor location '{options.UnityEditorLocation}' does not exist.");
            }
        }
コード例 #2
0
        public static void TestUnity3DProject(this ICakeContext context, FilePath projectFolder, Unity3DTestOptions options)
        {
            var unityTestContext = new Unity3DTestContext(context, projectFolder, options);

            unityTestContext.DumpOptions();
            unityTestContext.Test();
        }