示例#1
0
        public static int Main(string[] args)
        {
            if (args.Length < 1 || args.Length > 2)
            {
                Console.WriteLine("Usage: SolToBoogieTest <test-dir> [<test-prefix>]");
                Console.WriteLine("\t: if <test-prefix> is specified, we only run subset of tests that have the string as prefix");
                return(1);
            }

            string testDir    = args[0];
            string testPrefix = args.Length >= 2 ? args[1] : "";

            ExternalToolsManager.EnsureAllExisted();

            string regressionDir = Path.Combine(testDir, "regressions");
            string configDir     = Path.Combine(testDir, "config");
            string recordsDir    = Path.Combine(testDir);

            ILoggerFactory loggerFactory = LoggerFactory.Create(builder => builder.AddConsole()); // new LoggerFactory().AddConsole(LogLevel.Information);
            ILogger        logger        = loggerFactory.CreateLogger("SolToBoogieTest.RegressionExecutor");

            if (!testPrefix.Equals(string.Empty))
            {
                Console.WriteLine($"Warning!!! only running tests that have a prefix {testPrefix}....");
            }
            RegressionExecutor executor = new RegressionExecutor(regressionDir, configDir, recordsDir, logger, testPrefix);

            return(executor.BatchExecute());
        }
示例#2
0
        public static int Main(string[] args)
        {
            if (args.Length < 1 || args.Length > 2)
            {
                Console.WriteLine("Usage: SolToBoogieTest <test-dir> [<test-prefix>]");
                Console.WriteLine("\t: if <test-prefix> is specified, we only run subset of tests that have the string as prefix");
                return(1);
            }

            string testDir    = args[0];
            string testPrefix = args.Length >= 2 ? args[1] : "";


            string solcName   = GetSolcNameByOSPlatform();
            string solcPath   = Path.Combine(Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName, solcName);
            string corralPath = GetCorralPathFromAssemblyPath(Assembly.GetExecutingAssembly().Location);

            string regressionDir = Path.Combine(testDir, "regressions");
            string configDir     = Path.Combine(testDir, "config");
            string recordsDir    = Path.Combine(testDir);

            ILoggerFactory loggerFactory = new LoggerFactory().AddConsole(LogLevel.Information);
            ILogger        logger        = loggerFactory.CreateLogger("SolToBoogieTest.RegressionExecutor");

            if (!testPrefix.Equals(string.Empty))
            {
                Console.WriteLine($"Warning!!! only running tests that have a prefix {testPrefix}....");
            }
            RegressionExecutor executor = new RegressionExecutor(solcPath, corralPath, regressionDir, configDir, recordsDir, logger, testPrefix);

            return(executor.BatchExecute());
        }