Example #1
0
        public virtual void Execute()
        {
            if (DebugOutput)
            {
                Logger.Instance.VerbosityLevel = Logger.Verbosity.Debug;
            }
            else if (VerboseOutput)
            {
                Logger.Instance.VerbosityLevel = Logger.Verbosity.Low;
            }
            else
            {
                Logger.Instance.VerbosityLevel = Logger.Verbosity.Off;
            }

            // Get Xilinx Root Directory
            if (!DisableXilinxRepository)
            {
                Program.Repository.AddSearchPath(PathHelper.Combine(XilinxHelper.GetRootXilinxPath(), "EDK", "hw"));
            }

            // Get Enivornment Repositories
            if (AdditionalRepositories != null && AdditionalRepositories.Length >= 1)
            {
                foreach (string path in AdditionalRepositories)
                {
                    string fullPath = Path.GetFullPath(path.Trim('"'));
                    Logger.Instance.WriteVerbose("Repository: Adding {0}", fullPath);
                    Program.Repository.AddSearchPath(fullPath);
                }
            }

            // Get Enivornment Repositories
            if (!DisableEnvironmentRepository)
            {
                string environRepos = Environment.GetEnvironmentVariable("REPOSITORY");
                if (!string.IsNullOrEmpty(environRepos))
                {
                    string[] paths = environRepos.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                    foreach (string path in paths)
                    {
                        string fullPath = Path.GetFullPath(path.Trim('"'));
                        Logger.Instance.WriteVerbose("Repository: Adding {0}", fullPath);
                        Program.Repository.AddSearchPath(fullPath);
                    }
                }
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            bool          debugEnable = false;
            bool          guiEnable   = false;
            List <string> files       = new List <string>();

            foreach (string a in args)
            {
                if (string.Compare(a, "-d", true) == 0)
                {
                    debugEnable = true;
                }
                else if (string.Compare(a, "-g", true) == 0)
                {
                    guiEnable = true;
                }
                else
                {
                    files.Add(a);
                }
            }

            if (debugEnable)
            {
                Logger.Instance.VerbosityLevel = Logger.Verbosity.Debug;
            }

            XilinxRepository repo = new XilinxRepository();

            repo.AddSearchPath(PathHelper.Combine(XilinxHelper.GetRootXilinxPath(), "EDK", "hw"));
            repo.AddSearchPath(@"C:\svn\uni-projects\uqrarg\hardware\Repo");

            string testRoot = PathHelper.Combine(repo.GetLibraryDefaultRootPath("avr_core_v1_00_a"), "test");

            foreach (string file in files)
            {
                string fullFilePath = file;
                if (!Path.IsPathRooted(fullFilePath))
                {
                    fullFilePath = PathHelper.Combine(testRoot, file);
                }

                if (File.Exists(fullFilePath))
                {
                    try
                    {
                        TestRunner runner = new TestRunner(repo, fullFilePath);
                        if (guiEnable)
                        {
                            runner.GuiEnabled = true;
                        }
                        runner.Run();
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("Exception {0}", ex.Message);
                        Console.WriteLine("{0}", ex.StackTrace);
                        Console.WriteLine("Continuing...");
                    }
                }
                else
                {
                    Logger.Instance.WriteError("{0} does not exist", Path.GetFileName(fullFilePath));
                }
            }
        }