Esempio n. 1
0
        /**
         * Start all regression tests.
         *
         * @param threadsNumber  Threads number.
         * @return               Number of tests with error result.
         */
        public static int Start(int threadsNumber)
        {
            SudokuStore.consolePrintln("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
            SudokuStore.consolePrintln("All regression tests - starting.");
            SudokuStore.consolePrintln("  - RegTestsSolver.start()");
            SudokuStore.consolePrintln("  - RegTestsGenerator.start()");
            SudokuStore.consolePrintln("  - RegTestsStore.start()");
            SudokuStore.consolePrintln("  - RegTestsApi.start()");
            SudokuStore.consolePrintln("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
            long   startTime       = DateTimeX.currentTimeMillis();
            int    solverErrors    = RegTestsSolver.Start(threadsNumber);
            int    generatorErrors = RegTestsGenerator.Start(threadsNumber);
            int    storeErrors     = RegTestsStore.Start(threadsNumber);
            int    apiErrors       = RegTestsApi.Start(threadsNumber);
            long   endTime         = DateTimeX.currentTimeMillis();
            double computingTime   = (endTime - startTime) / 1000.0;
            int    totalErrors     = solverErrors + generatorErrors + storeErrors + apiErrors;

            SudokuStore.consolePrintln("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
            SudokuStore.consolePrintln("All regression tests - finished.");
            SudokuStore.consolePrintln("Errors: " + totalErrors);
            SudokuStore.consolePrintln("  - RegTestsSolver errors: " + solverErrors);
            SudokuStore.consolePrintln("  - RegTestsGenerator errors: " + generatorErrors);
            SudokuStore.consolePrintln("  - RegTestsStore errors: " + storeErrors);
            SudokuStore.consolePrintln("  - RegTestsApi errors: " + apiErrors);
            SudokuStore.consolePrintln("");
            SudokuStore.consolePrintln("Computing time: " + computingTime + " s.");
            SudokuStore.consolePrintln("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
            return(totalErrors);
        }
 static void Main(string[] args)
 {
     RegTestsStore.Start();
 }