Ejemplo n.º 1
0
        public void CheckMscorlibReferenceAssemblyForExternalReferences()
        {
            var checker = new CRASanitizer.Checker(Console.Out);

            Assert.AreEqual((uint)0, checker.NumberOfExternalReferences(
                                @"..\..\..\Microsoft.Research\Contracts\bin\Debug\v3.5\Mscorlib.Contracts.dll"));
            Console.WriteLine("Checked to make sure mscorlib.Contracts.dll doesn't have any external references");
        }
Ejemplo n.º 2
0
    private static void Verify(ITestOutputHelper testOutputHelper, string assemblyName, string frameworkPath)
    {
      var path = Path.Combine(@"..\..\..\..\Microsoft.Research\Contracts\bin\Debug", frameworkPath);
      string originalPath = Path.Combine(@"..\..\..\..\Microsoft.Research\Imported\ReferenceAssemblies", frameworkPath, assemblyName + ".dll");

      StringWriter stringWriter = new StringWriter();
      var checker = new CRASanitizer.Checker(stringWriter);

      var contractAssemblyName = assemblyName + ".Contracts.dll";
      testOutputHelper.WriteLine("Checking {1} {0} for errors...", assemblyName, frameworkPath);

      testOutputHelper.WriteLine("  Contract Path: {0}", Path.GetFullPath(Path.Combine(path, contractAssemblyName)));
      testOutputHelper.WriteLine("  Original Path: {0}", Path.GetFullPath(originalPath));

      var errors = checker.CheckSurface(Path.Combine(path, contractAssemblyName), originalPath);

      testOutputHelper.WriteLine(stringWriter.ToString());
      Assert.Equal(0, errors);
      testOutputHelper.WriteLine("... done.");
    }
Ejemplo n.º 3
0
    private static void Verify(string assemblyName, string frameworkPath)
    {
      var path = Path.Combine(@"..\..\..\Microsoft.Research\Contracts\bin\debug", frameworkPath);

      string originalPath = Path.Combine(Path.Combine(@"..\..\..\Microsoft.Research\Imported\ReferenceAssemblies", frameworkPath), assemblyName + ".dll");
      if (originalPath == null)
      {
        Assert.Fail("Can't find original assembly {0}", assemblyName);
        return;
      }
      var checker = new CRASanitizer.Checker(Console.Out);

      var contractAssemblyName = assemblyName + ".Contracts.dll";
      Console.WriteLine("Checking {1} {0} for errors...", assemblyName, frameworkPath);


      var errors = checker.CheckSurface(Path.Combine(path, contractAssemblyName), originalPath);

      Assert.AreEqual(0, errors, "Found {0} errors in contract reference assembly {1}", errors, contractAssemblyName);
      Console.WriteLine("... done.");
    }
Ejemplo n.º 4
0
        private static void Verify(ITestOutputHelper testOutputHelper, string assemblyName, string frameworkPath)
        {
            var    path         = Path.Combine(@"..\..\..\..\Microsoft.Research\Contracts\bin\Debug", frameworkPath);
            string originalPath = Path.Combine(@"..\..\..\..\Microsoft.Research\Imported\ReferenceAssemblies", frameworkPath, assemblyName + ".dll");

            StringWriter stringWriter = new StringWriter();
            var          checker      = new CRASanitizer.Checker(stringWriter);

            var contractAssemblyName = assemblyName + ".Contracts.dll";

            testOutputHelper.WriteLine("Checking {1} {0} for errors...", assemblyName, frameworkPath);

            testOutputHelper.WriteLine("  Contract Path: {0}", Path.GetFullPath(Path.Combine(path, contractAssemblyName)));
            testOutputHelper.WriteLine("  Original Path: {0}", Path.GetFullPath(originalPath));

            var errors = checker.CheckSurface(Path.Combine(path, contractAssemblyName), originalPath);

            testOutputHelper.WriteLine(stringWriter.ToString());
            Assert.Equal(0, errors);
            testOutputHelper.WriteLine("... done.");
        }
Ejemplo n.º 5
0
        private static void Verify(string assemblyName, string frameworkPath)
        {
            var path = Path.Combine(@"..\..\..\Microsoft.Research\Contracts\bin\debug", frameworkPath);

            string originalPath = Path.Combine(Path.Combine(@"..\..\..\Microsoft.Research\Imported\ReferenceAssemblies", frameworkPath), assemblyName + ".dll");

            if (originalPath == null)
            {
                Assert.Fail("Can't find original assembly {0}", assemblyName);
                return;
            }
            var checker = new CRASanitizer.Checker(Console.Out);

            var contractAssemblyName = assemblyName + ".Contracts.dll";

            Console.WriteLine("Checking {1} {0} for errors...", assemblyName, frameworkPath);


            var errors = checker.CheckSurface(Path.Combine(path, contractAssemblyName), originalPath);

            Assert.AreEqual(0, errors, "Found {0} errors in contract reference assembly {1}", errors, contractAssemblyName);
            Console.WriteLine("... done.");
        }
Ejemplo n.º 6
0
    public void CheckMscorlibReferenceAssemblyForExternalReferences()
    {
      var checker = new CRASanitizer.Checker(Console.Out);

      Assert.AreEqual((uint)0, checker.NumberOfExternalReferences(
        @"..\..\..\Microsoft.Research\Contracts\bin\Debug\v3.5\Mscorlib.Contracts.dll"));
      Console.WriteLine("Checked to make sure mscorlib.Contracts.dll doesn't have any external references");
    }