Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Drochak <nickd@mono-cvs.ximian.com>2003-04-21 17:35:38 +0400
committerNick Drochak <nickd@mono-cvs.ximian.com>2003-04-21 17:35:38 +0400
commitf7fa6d289f16b2ece8589bea76cafc360b9b8270 (patch)
tree5a6168544e56c1628c0f341c43804ed159dee041 /mcs/nunit/src/NUnitCore/ClassPathTestCollector.cs
parent38be1c6f5f179985e0465a0855a3561d0600d0af (diff)
003-04-20 Nick Drochak <ndrochak@gol.com>
* Remove nunit version 1 svn path=/trunk/mcs/; revision=13845
Diffstat (limited to 'mcs/nunit/src/NUnitCore/ClassPathTestCollector.cs')
-rw-r--r--mcs/nunit/src/NUnitCore/ClassPathTestCollector.cs78
1 files changed, 0 insertions, 78 deletions
diff --git a/mcs/nunit/src/NUnitCore/ClassPathTestCollector.cs b/mcs/nunit/src/NUnitCore/ClassPathTestCollector.cs
deleted file mode 100644
index 0669a285c07..00000000000
--- a/mcs/nunit/src/NUnitCore/ClassPathTestCollector.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-namespace NUnit.Runner
-{
- using System;
- using System.Collections;
- using System.Collections.Specialized;
- using System.IO;
-
- /// <summary>
- /// A TestCollector that consults the
- /// class path. It considers all classes on the class path
- /// excluding classes in JARs. It leaves it up to subclasses
- /// to decide whether a class is a runnable Test.
- /// <see cref="ITestCollector"/>
- /// </summary>
- [Obsolete("Use StandardLoader or UnloadingLoader")]
- public abstract class ClassPathTestCollector : ITestCollector
- {
- /// <summary>
- ///
- /// </summary>
- public ClassPathTestCollector() {}
- /// <summary>
- ///
- /// </summary>
- /// <returns></returns>
- public string[] CollectTestsClassNames()
- {
- string classPath = Environment.GetEnvironmentVariable("Path");
- char separator= Path.PathSeparator;
- ArrayList result = new ArrayList();
- CollectFilesInRoots(classPath.Split(separator), result);
- string[] retVal = new string[result.Count];
- result.CopyTo(retVal);
- return retVal;
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="classFileName"></param>
- /// <returns></returns>
- protected string ClassNameFromFile(string classFileName)
- {
- return classFileName;
- }
-
- private void CollectFilesInRoots(string[] roots, IList result)
- {
- foreach (string directory in roots)
- {
- DirectoryInfo dirInfo=new DirectoryInfo(directory);
- if (dirInfo.Exists)
- {
- string[] files=Directory.GetFiles(dirInfo.FullName);
- foreach (string file in files)
- {
- if (IsTestClass(file))
- {
- string className=ClassNameFromFile(file);
- result.Add(className);
- }
- }
- }
- }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="classFileName"></param>
- /// <returns></returns>
- protected virtual bool IsTestClass(string classFileName)
- {
- return
- ( classFileName.EndsWith(".dll")
- || classFileName.EndsWith(".exe"))
- && classFileName.IndexOf("Test") > 0;
- }
- }
-} \ No newline at end of file