All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cucumber.api.cli.Main Maven / Gradle / Ivy

There is a newer version: 7.18.0
Show newest version
package cucumber.api.cli;

import cucumber.runtime.Runtime;

public class Main {

    public static void main(String[] argv) {
        byte exitStatus = run(argv, Thread.currentThread().getContextClassLoader());
        System.exit(exitStatus);
    }

    /**
     * Launches the Cucumber-JVM command line.
     *
     * @param argv        runtime options. See details in the {@code cucumber.api.cli.Usage.txt} resource.
     * @param classLoader classloader used to load the runtime
     * @return 0 if execution was successful, 1 if it was not (test failures)
     */
    public static byte run(String[] argv, ClassLoader classLoader) {

        final Runtime runtime = Runtime.builder()
            .withArgs(argv)
            .withClassLoader(classLoader)
            .build();

        runtime.run();
        return runtime.exitStatus();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy