Ejemplo n.º 1
0
        private void Settings_Closed(object sender, EventArgs e)
        {
            Contract.Requires(sender.GetType() == typeof(GSettings));
            GSettings settings = (GSettings)sender;

            if (!settings.Configuration.Dirty)
            {
                return;
            }
            _config.Save();

            TestList window = GetTestList();

            window.DisplayAvaliableTests(settings.Configuration);
        }
Ejemplo n.º 2
0
        private void GetTestsForProject(Project p, string configName)
        {
            Contract.Requires(p != null);
            Contract.Requires(!String.IsNullOrEmpty(configName));

            if (p.Kind != GuidList.CPPProject)
            {
                return;
            }
            // get build configuration for project, name and path of the output
            // to feed gtest.
            VCProject       cppProject = (VCProject)p.Object;
            VCConfiguration vcC        =
                (VCConfiguration)
                (((IVCCollection)cppProject.Configurations).Item(configName));

            if (!vcC.PrimaryOutput.EndsWith("exe", true, CultureInfo.CurrentCulture))
            {
                return;
            }
            ConfiguredProject project = _config.GetConfiguration(p);

            project.Name    = p.Name;
            project.TestExe = vcC.PrimaryOutput;
            //try to get tests if a build exists)
            if (File.Exists(vcC.PrimaryOutput))
            {
                TestList window = GetTestList();
                if (window.DisplayAvaliableTests(project))
                {
                    if (!_projectsWithTests.ContainsKey(project.Name))
                    {
                        _projectsWithTests.Add(project.Name, project);
                    }
                }
            }
        }