[Csmail-patches] CVS: csmail/nunit ChangeLog,NONE,1.1 RunTests.cs,NONE,1.1 makefile,NONE,1.1 nunit.b
Status: Pre-Alpha
Brought to you by:
mastergaurav
From: Gaurav V. <mas...@us...> - 2002-07-24 10:50:20
|
Update of /cvsroot/csmail/csmail/nunit In directory usw-pr-cvs1:/tmp/cvs-serv27574/nunit Added Files: ChangeLog RunTests.cs makefile nunit.build Log Message: 2002-02-24 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> * NUnit -- Added the sourcecode. I hope there's no problem with license. --- NEW FILE --- 2002-03-08 Nick Drochak <ndr...@go...> * nunit.build: exclude all the obsolete stuff, and prevent csc from linking any ms stuff to the dll and exe we are testing on Linux. 2002-03-07 Nick Drochak <ndr...@go...> * .cvsignore: ignore *.pdb files * nunit.build: Build a version of NUnitCore.dll and NUnitConsole.exe using mono's corlib. Use this to test on Linux under mint and mono. 2002-03-06 Nick Drochak <ndr...@go...> * nunit.build: Exclude obsolete class from build. Probably should remove from cvs. 2002-02-27 Martin Baulig <ma...@gn...> Imported NUnit 1.11. * nunit.build: Added NAnt build file for NUnit. In addition to NUnitConsole.exe and NUnitCore.dll, we also create a small NUnitBase.dll which just contains the source files which are needed to run the tests on Linux. * RunTests.cs: This is a simple test runner which is used when we run the tests on Linux. It is linked into UNitBase.dll. * makefile: Just call NAnt here. * NUnitGUI.exe, NUnitTests.dll: Removed binaries. --- NEW FILE --- using System; using System.IO; using System.Threading; using System.Globalization; using NUnit.Framework; namespace MonoTests { public class MyTestRunner { static TextWriter fWriter = Console.Out; protected static TextWriter Writer { get { return fWriter; } } public static void Print(TestResult result) { PrintErrors(result); PrintFailures(result); PrintHeader(result); } /// <summary>Prints the errors to the standard output.</summary> public static void PrintErrors(TestResult result) { if (result.ErrorCount != 0) { if (result.ErrorCount == 1) Writer.WriteLine("There was "+result.ErrorCount+" error:"); else Writer.WriteLine("There were "+result.ErrorCount+" errors:"); int i= 1; foreach (TestFailure failure in result.Errors) { Writer.WriteLine(i++ + ") "+failure+"("+failure.ThrownException.GetType().ToString()+")"); Writer.Write(failure.ThrownException); } } } /// <summary>Prints failures to the standard output.</summary> public static void PrintFailures(TestResult result) { if (result.FailureCount != 0) { if (result.FailureCount == 1) Writer.WriteLine("There was " + result.FailureCount + " failure:"); else Writer.WriteLine("There were " + result.FailureCount + " failures:"); int i = 1; foreach (TestFailure failure in result.Failures) { Writer.Write(i++ + ") " + failure.FailedTest); Exception t= failure.ThrownException; if (t.Message != "") Writer.WriteLine(" \"" + t.Message + "\""); else { Writer.WriteLine(); Writer.Write(failure.ThrownException); } } } } /// <summary>Prints the header of the report.</summary> public static void PrintHeader(TestResult result) { if (result.WasSuccessful) { Writer.WriteLine(); Writer.Write("OK"); Writer.WriteLine (" (" + result.RunCount + " tests)"); } else { Writer.WriteLine(); Writer.WriteLine("FAILURES!!!"); Writer.WriteLine("Tests Run: "+result.RunCount+ ", Failures: "+result.FailureCount+ ", Errors: "+result.ErrorCount); } } } } --- NEW FILE --- all: build linux: build windows: build build: ../nant/NAnt.exe build clean: ../nant/NAnt.exe clean --- NEW FILE --- <?xml version="1.0" encoding="iso-8859-1"?> <!-- NAnt build file for NUnit --> <project name="NUnit" default="build"> <property name="debug" value="true"/> <target name="build"> <csc target="library" output="NUnitCore.dll" debug="${debug}"> <sources basedir="src/NUnitCore"> <includes name="*.cs"/> <excludes name="SimpleTestCollector.cs"/> <excludes name="ClassPathTestCollector.cs"/> <excludes name="ReflectionUtils.cs"/> <excludes name="ITestSuiteLoader.cs"/> <excludes name="LoadingTestCollector.cs"/> <excludes name="ReloadingTestSuiteLoader.cs"/> <excludes name="StandardTestSuiteLoader.cs"/> <excludes name="TestCaseClassLoader.cs"/> </sources> </csc> <csc target="library" output="NUnitBase.dll" debug="${debug}"> <sources> <includes name="src/NUnitCore/*.cs"/> <includes name="RunTests.cs"/> <excludes name="src/NUnitCore/IFailureDetailView.cs"/> <excludes name="src/NUnitCore/SimpleTestCollector.cs"/> </sources> </csc> <csc target="exe" output="NUnitConsole.exe" debug="${debug}"> <sources basedir="src\NUnitConsole"> <includes name="*.cs"/> </sources> <references> <includes name="NUnitCore.dll"/> </references> </csc> </target> <target name="clean"> <delete file="NUnitCore.dll" failonerror="false"/> <delete file="NUnitBase.dll" failonerror="false"/> <delete file="NUnitConsole.exe" failonerror="false"/> <delete file="NUnitCore.pdb" failonerror="false"/> <delete file="NUnitBase.pdb" failonerror="false"/> <delete file="NUnitConsole.pdb" failonerror="false"/> </target> </project> |