예제 #1
0
        public TestCaseSandbox(TestCase testCase, NPath rootTemporaryDirectory, string namePrefix)
        {
            _testCase = testCase;

            _directory = rootTemporaryDirectory.Combine(string.IsNullOrEmpty(namePrefix) ? "linker_tests" : namePrefix);

            const string tcases_name = "Mono.Linker.Tests.Cases";
            var          location    = testCase.SourceFile.Parent.ToString();
            int          idx         = location.IndexOf(tcases_name + Path.DirectorySeparatorChar);

            if (idx < 0)
            {
                throw new ArgumentException("Unknown test cases location");
            }

            _directory = _directory.Combine(location.Substring(idx + tcases_name.Length + 1));
            _directory = _directory.Combine(testCase.SourceFile.FileNameWithoutExtension);

            _directory.DeleteContents();

            InputDirectory        = _directory.Combine("input").EnsureDirectoryExists();
            OutputDirectory       = _directory.Combine("output").EnsureDirectoryExists();
            ExpectationsDirectory = _directory.Combine("expectations").EnsureDirectoryExists();
            ResourcesDirectory    = _directory.Combine("resources").EnsureDirectoryExists();
        }
예제 #2
0
 public void Start(string path)
 {
     mPath       = new NPath(path);
     mStringPath = path;
     if (!mPath.DirectoryExists())
     {
         mPath.CreateDirectory();
     }
     mPath.DeleteContents();
 }
예제 #3
0
        public TestCaseSandbox(TestCase testCase, NPath rootTemporaryDirectory, string namePrefix)
        {
            _testCase = testCase;
            var name = string.IsNullOrEmpty(namePrefix) ? "linker_tests" : $"{namePrefix}_linker_tests";

            _directory = rootTemporaryDirectory.Combine(name);

            _directory.DeleteContents();

            InputDirectory        = _directory.Combine("input").EnsureDirectoryExists();
            OutputDirectory       = _directory.Combine("output").EnsureDirectoryExists();
            ExpectationsDirectory = _directory.Combine("expectations").EnsureDirectoryExists();
        }
예제 #4
0
        public TestCaseSandbox(TestCase testCase, NPath rootTemporaryDirectory, string namePrefix)
        {
            _testCase = testCase;

            var rootDirectory = rootTemporaryDirectory.Combine(string.IsNullOrEmpty(namePrefix) ? "linker_tests" : namePrefix);

            var locationRelativeToRoot = testCase.SourceFile.Parent.RelativeTo(testCase.RootCasesDirectory);
            var suiteDirectory         = rootDirectory.Combine(locationRelativeToRoot);

            _directory = suiteDirectory.Combine(testCase.SourceFile.FileNameWithoutExtension);

            _directory.DeleteContents();

            InputDirectory        = _directory.Combine("input").EnsureDirectoryExists();
            OutputDirectory       = _directory.Combine("output").EnsureDirectoryExists();
            ExpectationsDirectory = _directory.Combine("expectations").EnsureDirectoryExists();
            ResourcesDirectory    = _directory.Combine("resources").EnsureDirectoryExists();
        }
예제 #5
0
 public void TestSetup()
 {
     _tempDirectory.DeleteContents();
 }