Exemplo n.º 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());
        }
Exemplo n.º 2
0
        public static int Main(string[] args)
        {
            if (args.Length < 2)
            {
                ShowUsage();
                return(1);
            }

            ExternalToolsManager.EnsureAllExisted();

            string  solidityFile, entryPointContractName;
            bool    tryProofFlag, tryRefutation;
            int     recursionBound;
            ILogger logger;
            HashSet <Tuple <string, string> > ignoredMethods;
            bool            printTransactionSequence = false;
            TranslatorFlags translatorFlags          = new TranslatorFlags();

            ParseCommandLineArgs(args,
                                 out solidityFile,
                                 out entryPointContractName,
                                 out tryProofFlag,
                                 out tryRefutation,
                                 out recursionBound,
                                 out logger,
                                 out ignoredMethods,
                                 out printTransactionSequence,
                                 ref translatorFlags);

            var verisolExecuter =
                new VeriSolExecutor(
                    Path.Combine(Directory.GetCurrentDirectory(), solidityFile),
                    entryPointContractName,
                    recursionBound,
                    ignoredMethods,
                    tryRefutation,
                    tryProofFlag,
                    logger,
                    printTransactionSequence,
                    translatorFlags);

            return(verisolExecuter.Execute());
        }