Exemplo n.º 1
0
        /// <summary>
        /// Performs the testing.
        /// </summary>
        protected override void ExecuteTask()
        {
            bool   hasErrors  = false;
            string pathToJava = null;

            foreach (var project in EnumerateProjects())
            {
                Log(Level.Info, "Testing {0}...", project.Name);
                var outputFolder   = Path.Combine(project.Folder, "bin/" + Configuration);
                var outputFilePath = Path.Combine(outputFolder, project.OutputName);
                if (project.Language == SupportedLanguage.Java)
                {
                    if (pathToJava == null)
                    {
                        pathToJava = Java.GenerateFullPathToRuntime();
                    }
                    hasErrors |= TestWithJUnit(pathToJava, project, outputFilePath);
                }
                else
                {
                    hasErrors |= TestWithNUnit(outputFilePath);
                }
            }
            if (hasErrors)
            {
                throw new BuildException("Tests failed");
            }
        }