Example #1
0
 public Dx12Build()
 {
     ModuleRoot = "\\Dx12\\";
     AddLibSearch(ref LibrarySearchPaths, "", LibBuildConfig.General, false);
     AddLibSearch(ref LibrarySearchPaths, "", LibBuildConfig.General, true);
     DLLs.Add("dxil.dll");
 }
        private void PopulateDLLs()
        {
            // get executing assembly
            Assembly thisAssembly     = Assembly.GetExecutingAssembly();
            string   thisAssemblyName = thisAssembly.ManifestModule.Name;

            if (_lastLocation == null)
            {
                _lastLocation = Path.GetDirectoryName(thisAssembly.Location);
            }

            string path = SelectFolder("Test dlls location", _lastLocation, LinkedWindow);

            if (String.IsNullOrEmpty(path))
            {
                return;
            }

            _lastLocation = path;

            // Don't inspect some dlls when looking for assemblies to test
            string[] ignoreDlls = new string[]
            {
                thisAssemblyName,
                "nunit.core.dll",
                "nunit.core.interfaces.dll",
                "nunit.framework.dll",
                "nunit.util.dll",
                "RevitAPI_x64_2013.dll",
                "RevitAPIUI_x64_2013.dll",
                "TechTalk.SpecFlow.dll",
                "Moq.dll",
                "GalaSoft.MvvmLight.dll",
                "Castle.DynamicProxy2.dll",
                "Castle.Core.dll",
                "Castle.Windsor.dll",
                "IronPython.dll",
                "IronPython.Modules.dll",
                "IronPython.SQLite.dll",
                "IronPython.Wpf.dll",
                "Microsoft.Dynamic.dll",
                "Microsoft.Scripting.dll",
                "Microsoft.Scripting.Metadata.dll",
                "System.Windows.Interactivity.dll"
            };
            // Get a list of DLL's that potentially contain tests
            foreach (string dll in System.IO.Directory.GetFiles(path, "*" + ".dll"))
            {
                if (!ignoreDlls.Contains(Path.GetFileName(dll)))
                {
                    TestableDll testableDll = new TestableDll(dll);
                    testableDll.Tests = GetTestsFromDll(dll);
                    DLLs.Add(testableDll);
                }
            }
        }
Example #3
0
 public PixBuild()
 {
     ModuleRoot = "\\Pix\\";
     AddLibSearch(ref LibrarySearchPaths, "", LibBuildConfig.General, false);
     AddLibSearch(ref LibrarySearchPaths, "", LibBuildConfig.General, true);
     DLLs.Add("WinPixEventRuntime.dll");
     LibDirs.Add("../source/ThirdParty/Pix/");
     StaticLibraries.Add(new LibDependency("WinPixEventRuntime.lib", "win64"));
     UnsupportedPlatforms.Add("X*");
     IncludeDir = "\\Pix\\Include\\WinPixEventRuntime\\";
 }
Example #4
0
 public assimpBuild()
 {
     ModuleRoot = "\\assimp\\";
     AddLibSearch(ref LibrarySearchPaths, "", LibBuildConfig.General, false);
     AddLibSearch(ref LibrarySearchPaths, "", LibBuildConfig.General, true);
     StaticLibraries.Add(new LibDependency("assimp.lib", "win64"));
     DLLs.Add("assimp-vc140-mt.dll");
     UnsupportedPlatforms.Add("X*");
     Defines.Add("BUILD_ASSIMP");
     LibDirs.Add("../source/ThirdParty/assimp/");
 }
Example #5
0
 public OpenVRBuild()
 {
     ModuleRoot = "\\OpenVR\\";
     AddLibSearch(ref LibrarySearchPaths, "", LibBuildConfig.General, false);
     AddLibSearch(ref LibrarySearchPaths, "", LibBuildConfig.General, true);
     DLLs.Add("openvr_api.dll");
     UnsupportedPlatforms.Add("X*");
     Defines.Add("SUPPORT_OPENVR");
     StaticLibraries.Add(new LibDependency("openvr_api.lib", "win64"));
     LibDirs.Add("../source/ThirdParty/OpenVR/");
 }
Example #6
0
        public void ParseArgs(IEnumerable <string> args, List <string> respFiles = null)
        {
            var helpStrings = new string[] { "/?", "-?", "/h", "-h" };

            foreach (var a in args)
            {
                var arg = a.Trim();
                if (arg.StartsWith("#", StringComparison.Ordinal))
                {
                    continue;
                }

                if (arg.StartsWith("/main:", StringComparison.Ordinal))
                {
                    MainName = Main = arg.Substring(6).Trim('"');
                    // only override the target kind if its currently a DLL
                    if (Target == PEFileKinds.Dll)
                    {
                        Target = PEFileKinds.ConsoleApplication;
                    }
                }
                else if (arg.StartsWith("/out:", StringComparison.Ordinal))
                {
                    Output = arg.Substring(5).Trim('"');
                }
                else if (arg.StartsWith("/target:", StringComparison.Ordinal))
                {
                    string tgt = arg.Substring(8).Trim('"');
                    switch (tgt)
                    {
                    case "exe":
                        Target = PEFileKinds.ConsoleApplication;
                        break;

                    case "winexe":
                        Target = PEFileKinds.WindowApplication;
                        break;

                    default:
                        Target = PEFileKinds.Dll;
                        break;
                    }
                }
                else if (arg.StartsWith("/platform:", StringComparison.Ordinal))
                {
                    string plat = arg.Substring(10).Trim('"');
                    switch (plat)
                    {
                    case "x86":
                        Platform = IKVM.Reflection.PortableExecutableKinds.ILOnly | IKVM.Reflection.PortableExecutableKinds.Required32Bit;
                        Machine  = IKVM.Reflection.ImageFileMachine.I386;
                        break;

                    case "x64":
                        Platform = IKVM.Reflection.PortableExecutableKinds.ILOnly | IKVM.Reflection.PortableExecutableKinds.PE32Plus;
                        Machine  = IKVM.Reflection.ImageFileMachine.AMD64;
                        break;

                    default:
                        Platform = IKVM.Reflection.PortableExecutableKinds.ILOnly;
                        Machine  = IKVM.Reflection.ImageFileMachine.AMD64;
                        break;
                    }
                }
                else if (arg.StartsWith("/win32icon:", StringComparison.Ordinal))
                {
                    Win32Icon = arg.Substring(11).Trim('"');
                }
                else if (arg.StartsWith("/fileversion:", StringComparison.Ordinal))
                {
                    FileVersion = arg.Substring(13).Trim('"');
                }
                else if (arg.StartsWith("/productversion:", StringComparison.Ordinal))
                {
                    ProductVersion = arg.Substring(16).Trim('"');
                }
                else if (arg.StartsWith("/productname:", StringComparison.Ordinal))
                {
                    ProductName = arg.Substring(13).Trim('"');
                }
                else if (arg.StartsWith("/copyright:", StringComparison.Ordinal))
                {
                    Copyright = arg.Substring(11).Trim('"');
                }
                else if (arg.StartsWith("/errfmt:", StringComparison.Ordinal))
                {
                    ErrorMessageFormat = arg.Substring(8);
                }
                else if (arg.Equals("/embed", StringComparison.Ordinal))
                {
                    Embed = true;
                }
                else if (arg.Equals("/standalone", StringComparison.Ordinal))
                {
                    Standalone = true;
                }
                else if (arg.Equals("/mta", StringComparison.Ordinal))
                {
                    UseMta = true;
                }
                else if (arg.Equals("/sta", StringComparison.Ordinal))
                {
                    UseSta = true;
                }
                else if (arg.StartsWith("/recurse:", StringComparison.Ordinal))
                {
                    string pattern = arg.Substring(9);
                    if (string.IsNullOrWhiteSpace(pattern))
                    {
                        ConsoleOps.Error(true, "Missing pattern for /recurse option");
                    }
                    foreach (var f in Directory.EnumerateFiles(Environment.CurrentDirectory, pattern))
                    {
                        Files.Add(Path.GetFullPath(f));
                    }
                }
                else if (Array.IndexOf(helpStrings, arg) >= 0)
                {
                    ConsoleOps.Usage(true);
                }
                else if (arg.StartsWith("/py:", StringComparison.Ordinal))
                {
                    // if you add a parameter that takes a different type then
                    // ScriptingRuntimeHelpers.True/False or int
                    // you need ot also modify Program.cs for standalone generation.
                    string[] pyargs = arg.Substring(4).Trim('"').Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                    switch (pyargs[0])
                    {
                    case "-X:Frames":
                        PythonOptions["Frames"] = ScriptingRuntimeHelpers.True;
                        break;

                    case "-X:FullFrames":
                        PythonOptions["Frames"] = PythonOptions["FullFrames"] = ScriptingRuntimeHelpers.True;
                        break;

                    case "-X:Tracing":
                        PythonOptions["Tracing"] = ScriptingRuntimeHelpers.True;
                        break;

                    case "-X:GCStress":
                        int gcStress;
                        if (!int.TryParse(pyargs[1], out gcStress) || (gcStress <0 || gcStress> GC.MaxGeneration))
                        {
                            ConsoleOps.Error(true, $"The argument for the {pyargs[1]} option must be between 0 and {GC.MaxGeneration}.");
                        }

                        PythonOptions["GCStress"] = gcStress;
                        break;

                    case "-X:MaxRecursion":
                        // we need about 6 frames for starting up, so 10 is a nice round number.
                        int limit;
                        if (!int.TryParse(pyargs[1], out limit) || limit < 10)
                        {
                            ConsoleOps.Error(true, $"The argument for the {pyargs[1]} option must be an integer >= 10.");
                        }

                        PythonOptions["RecursionLimit"] = limit;
                        break;

                    case "-X:EnableProfiler":
                        PythonOptions["EnableProfiler"] = ScriptingRuntimeHelpers.True;
                        break;

                    case "-X:LightweightScopes":
                        PythonOptions["LightweightScopes"] = ScriptingRuntimeHelpers.True;
                        break;

                    case "-X:Debug":
                        PythonOptions["Debug"] = ScriptingRuntimeHelpers.True;
                        break;
                    }
                }
                else
                {
                    if (arg.StartsWith("@", StringComparison.Ordinal))
                    {
                        var respFile = Path.GetFullPath(arg.Substring(1));
                        if (respFiles == null)
                        {
                            respFiles = new List <string>();
                        }

                        if (!respFiles.Contains(respFile))
                        {
                            respFiles.Add(respFile);
                            ParseArgs(File.ReadAllLines(respFile), respFiles);
                        }
                        else
                        {
                            ConsoleOps.Warning($"Already parsed response file '{arg.Substring(1)}'");
                        }
                    }
                    else
                    {
                        if (arg.ToLower().EndsWith(".dll", StringComparison.Ordinal))
                        {
                            DLLs.Add(arg);
                        }
                        else
                        {
                            Files.Add(arg);
                        }
                    }
                }
            }
        }