コード例 #1
0
        private void GetVisualTestsFromInstallPath(DeltaEngineFramework framework)
        {
            string frameworkPath = Path.Combine(installPath, framework.ToString());

            foreach (var file in Directory.GetFiles(frameworkPath))
            {
                if (file.Contains(".Editor.") ||
                    (!file.EndsWith(".Tests.exe") && !file.EndsWith(".Tests.dll")))
                {
                    continue;
                }
                try
                {
                    TryGetVisualTestsFromInstallPath(frameworkPath, file);
                }
                catch (ReflectionTypeLoadException ex)
                {
                    ShowLoaderExceptionWarning(file, ex);
                }
                catch (FileLoadException ex)
                {
                    Logger.Warning("Failed to load dependency for " + file + ": " + ex.Message);
                }
            }
        }
コード例 #2
0
 public static string ToInternalShortName(this DeltaEngineFramework framework)
 {
     if (framework == DeltaEngineFramework.Default)
     {
         throw new ArgumentException(framework.ToString());
     }
     return(FrameworkShortNames[framework]);
 }
コード例 #3
0
 private void CreateSamplesFromInstallerDirectories(DeltaEngineFramework framework)
 {
     if (!Directory.Exists(installPath))
     {
         return;
     }
     UsingPrecompiledSamplesFromInstaller = true;
     GetExecutablesFromInstallPath(framework, SampleCategory.Game);
     GetExecutablesFromInstallPath(framework, SampleCategory.Tutorial);
     //GetVisualTestsFromInstallPath(framework);
 }
コード例 #4
0
ファイル: SampleCreator.cs プロジェクト: remy22/DeltaEngine
 public void CreateSamples(DeltaEngineFramework framework)
 {
     if (framework == DeltaEngineFramework.Default)
         CreateSamplesFromSourceCodeDirectories();
     else
     {
         CreateSamplesFromInstallerDirectories(framework);
         if (Samples.Count == 0)
             CreateSamplesFromSourceCodeDirectories();
     }
     if (Samples.Count == 0)
         Logger.Warning("No Samples found. Please setup the " +
             PathExtensions.EnginePathEnvironmentVariableName +
             " or compile the DeltaEngine solutions.");
 }
コード例 #5
0
ファイル: VsTemplate.cs プロジェクト: remy22/DeltaEngine
 public static string[] GetAllTemplateNames(DeltaEngineFramework framework)
 {
     if (!PathExtensions.IsDeltaEnginePathEnvironmentVariableAvailable())
     {
         Logger.Warning("No Visual Studio Templates found, please use the Installer to set them up");
         return new string[0];
     }
     var templatePath = Path.Combine(PathExtensions.GetDeltaEngineInstalledDirectory(),
         framework.ToString(), "VisualStudioTemplates", "Delta Engine");
     var templateNames = new List<string>();
     foreach (var file in Directory.GetFiles(templatePath))
         templateNames.Add(Path.GetFileNameWithoutExtension(file));
     templateNames.Remove("EmptyLibrary");
     return templateNames.ToArray();
 }
コード例 #6
0
        public static string[] GetAllTemplateNames(DeltaEngineFramework framework)
        {
            if (!PathExtensions.IsDeltaEnginePathEnvironmentVariableAvailable())
            {             //ncrunch: no coverage start
                Logger.Warning("No Visual Studio Templates found, please use the Installer to set them up");
                return(new string[0]);
            }             //ncrunch: no coverage end
            var templatePath = Path.Combine(PathExtensions.GetDeltaEngineInstalledDirectory(),
                                            framework.ToString(), "VisualStudioTemplates", "Delta Engine");
            var templateNames = new List <string>();

            foreach (var file in Directory.GetFiles(templatePath))
            {
                templateNames.Add(Path.GetFileNameWithoutExtension(file));
            }
            templateNames.Remove("EmptyLibrary");
            return(templateNames.ToArray());
        }
コード例 #7
0
        private void GetExecutablesFromInstallPath(DeltaEngineFramework framework,
                                                   SampleCategory category)
        {
            if (category != SampleCategory.Game && category != SampleCategory.Tutorial)
            {
                return;
            }
            string frameworkPath = Path.Combine(installPath, framework.ToString());

            string[] directories =
                Directory.GetDirectories(Path.Combine(frameworkPath,
                                                      category == SampleCategory.Game ? "Samples" : "Tutorials"));
            foreach (string projectDirectory in directories)
            {
                if (!projectDirectory.Contains("EmptyLibrary"))
                {
                    AddSample(category, projectDirectory, frameworkPath);
                }
            }
        }
コード例 #8
0
 public void CreateSamples(DeltaEngineFramework framework)
 {
     if (framework == DeltaEngineFramework.Default)
     {
         CreateSamplesFromSourceCodeDirectories();
     }
     else
     {
         CreateSamplesFromInstallerDirectories(framework);
         if (Samples.Count == 0)
         {
             CreateSamplesFromSourceCodeDirectories();
         }
     }
     if (Samples.Count == 0)
     {
         Logger.Warning("No Samples found. Please setup the " +
                        PathExtensions.EnginePathEnvironmentVariableName +
                        " or compile the DeltaEngine solutions.");
     }
 }
コード例 #9
0
ファイル: SampleCreator.cs プロジェクト: remy22/DeltaEngine
 private void CreateSamplesFromInstallerDirectories(DeltaEngineFramework framework)
 {
     if (!fileSystem.Directory.Exists(installPath))
         return;
     UsingPrecompiledSamplesFromInstaller = true;
     GetExecutablesFromInstallPath(framework, SampleCategory.Game);
     GetExecutablesFromInstallPath(framework, SampleCategory.Tutorial);
     //GetVisualTestsFromInstallPath(framework);
 }
コード例 #10
0
 private void SetFrameworkToDefault()
 {
     FrameworksAvailable = new[] { DeltaEngineFramework.Default };
     SelectedFramework = DeltaEngineFramework.Default;
     RaisePropertyChanged("FrameworksAvailable");
     RaisePropertyChanged("SelectedFramework");
 }
コード例 #11
0
		public void CreateFromString(DeltaEngineFramework framework, string fromString)
		{
			Assert.AreEqual(framework, DeltaEngineFrameworkExtensions.FromString(fromString));
		}
コード例 #12
0
		public void MapPublicToInternalShortName(DeltaEngineFramework publicName, string internalName)
		{
			Assert.AreEqual(internalName, publicName.ToInternalShortName());
		}
コード例 #13
0
 public void ChangeSelection(DeltaEngineFramework expectedFramework)
 {
     viewModel.OnFrameworkSelectionChanged.Execute(expectedFramework);
     Assert.AreEqual(expectedFramework, viewModel.SelectedFramework);
 }
コード例 #14
0
ファイル: SampleCreator.cs プロジェクト: remy22/DeltaEngine
 private void GetVisualTestsFromInstallPath(DeltaEngineFramework framework)
 {
     string frameworkPath = Path.Combine(installPath, framework.ToString());
     foreach (var file in fileSystem.Directory.GetFiles(frameworkPath))
     {
         if (file.Contains(".Editor.") ||
             (!file.EndsWith(".Tests.exe") && !file.EndsWith(".Tests.dll")))
             continue;
         try
         {
             Assembly assembly = Assembly.LoadFrom(file);
             foreach (var type in assembly.GetTypes())
             {
                 if (type.IsDefined(typeof(CompilerGeneratedAttribute), false) || !IsVisualTestClass(type))
                     continue;
                 foreach (var method in type.GetMethods().Where(IsVisualTestMethod))
                 {
                     string solutionFilePath = "";
                     string projectFilePath = "";
                     if (!type.Namespace.Contains("DeltaEngine"))
                     {
                         solutionFilePath = Path.Combine(frameworkPath, "DeltaEngine.Samples.sln");
                         projectFilePath = GetSampleTestsProjectFilePaths(frameworkPath, assembly.GetName().Name);
                     }
                     Samples.Add(new Sample(assembly.GetName().Name + ": " + method.Name, SampleCategory.Test,
                         solutionFilePath, projectFilePath, file)
                     {
                         EntryClass = type.Name,
                         EntryMethod = method.Name
                     });
                 }
             }
         }
         catch (ReflectionTypeLoadException ex)
         {
             Logger.Warning("Failed to load " + file + ". LoaderExceptions: " +
                 ex.LoaderExceptions.ToText());
         }
         catch (FileLoadException ex)
         {
             Logger.Warning("Failed to load dependency for " + file + ": " + ex.Message);
         }
     }
 }
コード例 #15
0
 private void AddSelectionFilters()
 {
     AssembliesAvailable = new List<String>
     {
         "All",
         "Sample Games",
         "Tutorials",
         //"Visual Tests"
     };
     SelectedAssembly = AssembliesAvailable[1];
     FrameworksAvailable = frameworks.All;
     SelectedFramework = frameworks.Default;
 }
コード例 #16
0
 public void CreateFromString(DeltaEngineFramework framework, string fromString)
 {
     Assert.AreEqual(framework, DeltaEngineFrameworkExtensions.FromString(fromString));
 }
コード例 #17
0
 public void MapPublicToInternalShortName(DeltaEngineFramework publicName, string internalName)
 {
     Assert.AreEqual(internalName, publicName.ToInternalShortName());
 }
コード例 #18
0
 public void ChangeSelection(int id, DeltaEngineFramework expectedFramework)
 {
     viewModel.OnFrameworkSelectionChanged.Execute(id);
     Assert.AreEqual(expectedFramework, viewModel.SelectedFramework);
 }
コード例 #19
0
ファイル: SampleCreator.cs プロジェクト: remy22/DeltaEngine
 private void GetExecutablesFromInstallPath(DeltaEngineFramework framework,
     SampleCategory category)
 {
     if (category != SampleCategory.Game && category != SampleCategory.Tutorial)
         return;
     string frameworkPath = Path.Combine(installPath, framework.ToString());
     string[] directories =
         fileSystem.Directory.GetDirectories(Path.Combine(frameworkPath,
             category == SampleCategory.Game ? "Samples" : "Tutorials"));
     foreach (string projectDirectory in directories)
         if (!projectDirectory.Contains("EmptyLibrary"))
             AddSample(category, projectDirectory, frameworkPath);
 }
コード例 #20
0
ファイル: SampleCreator.cs プロジェクト: whztt07/DeltaEngine
		private void GetVisualTestsFromInstallPath(DeltaEngineFramework framework)
		{
			string frameworkPath = Path.Combine(installPath, framework.ToString());
			foreach (var file in Directory.GetFiles(frameworkPath))
			{
				if (file.Contains(".Editor.") ||
					(!file.EndsWith(".Tests.exe") && !file.EndsWith(".Tests.dll")))
					continue;
				try
				{
					TryGetVisualTestsFromInstallPath(frameworkPath, file);
				}
				catch (ReflectionTypeLoadException ex)
				{
					ShowLoaderExceptionWarning(file, ex);
				}
				catch (FileLoadException ex)
				{
					Logger.Warning("Failed to load dependency for " + file + ": " + ex.Message);
				}
			}
		}