Ejemplo n.º 1
0
        private DirectoryInfo Publish(TestInstance testInstance)
        {
            var publishCommand = new PublishCommand(Path.Combine(testInstance.TestRoot, "StandaloneApp"));
            var publishResult = publishCommand.Execute();

            publishResult.Should().Pass();

            return publishCommand.GetOutputDirectory(portable: false);
        }
Ejemplo n.º 2
0
 public void BuildSingleProject(TestInstance instance)
 {
     foreach (var iteration in Benchmark.Iterations)
     {
         var buildCommand = new BuildCommand(instance.TestRoot, buildProfile: false);
         using (iteration.StartMeasurement())
         {
             buildCommand.Execute().Should().Pass();
         }
         TouchSource(instance.TestRoot);
     }
 }
Ejemplo n.º 3
0
        private DirectoryInfo Build(TestInstance testInstance)
        {
            var result = new BuildCommand(
                projectPath: Path.Combine(testInstance.TestRoot, "PortableApp"))
                .ExecuteWithCapturedOutput();

            result.Should().Pass();

            var outputBase = new DirectoryInfo(Path.Combine(testInstance.TestRoot, "PortableApp", "bin", "Debug"));

            return outputBase.Sub("netcoreapp1.0");
        }
        public TestInstance CreateTestInstance(string testProjectName, [CallerMemberName] string callingMethod = "", string identifier = "")
        {
            string testProjectDir = Path.Combine(AssetsRoot, testProjectName);

            if (!Directory.Exists(testProjectDir))
            {
                throw new Exception($"Cannot find '{testProjectName}' at '{AssetsRoot}'");
            }

            string testDestination = Path.Combine(AppContext.BaseDirectory, callingMethod + identifier, testProjectName);
            var    testInstance    = new TestInstance(testProjectDir, testDestination);

            return(testInstance);
        }
Ejemplo n.º 5
0
        public TestSetupFixture()
        {
            _buildRelativePath = Path.Combine("bin", Config, Framework, _Runtime);
            var testAssetsMgr = new TestAssetsManager(_desktopProjectsRoot);
            _testInstance = testAssetsMgr.CreateTestInstance("BindingRedirectSample")
                                         .WithLockFiles();

            Setup(AppWithConfig, ref _appWithConfigProjectRoot, ref _appWithConfigBuildDir, ref _appWithConfigPublishDir);
            Setup(AppWithoutConfig, ref _appWithoutConfigProjectRoot, ref _appWithoutConfigBuildDir, ref _appWithoutConfigPublishDir);

            AppWithConfigBuildOutput = Path.Combine(_appWithConfigBuildDir, AppWithConfig + ".exe");
            AppWithConfigPublishOutput = Path.Combine(_appWithConfigPublishDir, AppWithConfig + ".exe");
            AppWithoutConfigBuildOutput = Path.Combine(_appWithoutConfigBuildDir, AppWithoutConfig + ".exe");
            AppWithoutConfigPublishOutput = Path.Combine(_appWithoutConfigPublishDir, AppWithoutConfig + ".exe");
        }
Ejemplo n.º 6
0
        public DirectoryInfo Build(TestInstance testInstance)
        {
            var projectPath = Path.Combine(testInstance.TestRoot, "StandaloneApp");

            var result = new BuildCommand(
                projectPath: projectPath)
                .ExecuteWithCapturedOutput();

            var contexts = ProjectContext.CreateContextForEachFramework(
                projectPath,
                null,
                PlatformServices.Default.Runtime.GetAllCandidateRuntimeIdentifiers());

            var runtime = contexts.FirstOrDefault(c => !string.IsNullOrEmpty(c.RuntimeIdentifier))?.RuntimeIdentifier;

            result.Should().Pass();

            var outputBase = new DirectoryInfo(
                Path.Combine(testInstance.TestRoot, "StandaloneApp", "bin", "Debug", "netstandardapp1.5"));

            return outputBase.Sub(runtime);
        }
        public TestInstance CreateTestInstance(string testProjectName, [CallerMemberName] string callingMethod = "", string identifier = "")
        {
            string testProjectDir = Path.Combine(AssetsRoot, testProjectName);

            if (!Directory.Exists(testProjectDir))
            {
                throw new Exception($"Cannot find '{testProjectName}' at '{AssetsRoot}'");
            }

            string testDestination = Path.Combine(AppContext.BaseDirectory, callingMethod + identifier, testProjectName);
            var testInstance = new TestInstance(testProjectDir, testDestination);
            return testInstance;
        }
Ejemplo n.º 8
0
 private void CreateTestInstance()
 {
     _testInstance = TestAssetsManager.CreateTestInstance("TestSimpleIncrementalApp")
                                      .WithLockFiles();
     TestProjectRoot = _testInstance.TestRoot;
 }
Ejemplo n.º 9
0
        public void BuildAllInGraph(TestInstance[] instances)
        {
            var instance = instances[0];

            foreach (var iteration in Benchmark.Iterations)
            {
                var buildCommand = new BuildCommand(instance.TestRoot, buildProfile: false);
                using (iteration.StartMeasurement())
                {
                    buildCommand.Execute().Should().Pass();
                }
                foreach (var i in instances)
                {
                    TouchSource(i.TestRoot);
                }
            }
        }
Ejemplo n.º 10
0
 public void BuildAllNoDependenciesInGraph(TestInstance[] instances)
 {
     foreach (var iteration in Benchmark.Iterations)
     {
         var commands = new List<BuildCommand>();
         foreach (var i in instances.Reverse())
         {
             commands.Add(new BuildCommand(i.TestRoot,
                 framework: DefaultFramework,
                 noDependencies: true,
                 buildProfile: false));
         }
         using (iteration.StartMeasurement())
         {
             foreach (var buildCommand in commands)
             {
                 buildCommand.Execute().Should().Pass();
             }
         }
         foreach (var instance in instances)
         {
             TouchSource(instance.TestRoot);
         }
     }
 }
Ejemplo n.º 11
0
        public void IncrementalRebuildWithLastChangedInGraph(TestInstance[] instances)
        {
            var instance = instances[0];
            new BuildCommand(instance.TestRoot, buildProfile: false)
                   .Execute().Should().Pass();

            foreach (var iteration in Benchmark.Iterations)
            {
                var buildCommand = new BuildCommand(instance.TestRoot, buildProfile: false);
                using (iteration.StartMeasurement())
                {
                    buildCommand.Execute().Should().Pass();
                }
                TouchSource(instances.Last().TestRoot);
            }
        }