Search in sources :

Example 1 with PackageContext

use of com.google.devtools.build.lib.packages.PackageFactory.PackageContext in project bazel by bazelbuild.

the class SkylarkTestCase method createEvaluationTestCase.

protected EvaluationTestCase createEvaluationTestCase() {
    return new EvaluationTestCase() {

        @Override
        public Environment newEnvironment() throws Exception {
            Environment env = Environment.builder(mutability).setEventHandler(getEventHandler()).setGlobals(SkylarkModules.getGlobals(SkylarkModules.MODULES)).setPhase(Phase.LOADING).build().setupDynamic(PackageFactory.PKG_CONTEXT, // create rules. Creating actual rules is tested in SkylarkIntegrationTest.
            new PackageContext(null, null, getEventHandler(), null));
            SkylarkUtils.setToolsRepository(env, TestConstants.TOOLS_REPOSITORY);
            return env;
        }
    };
}
Also used : EvaluationTestCase(com.google.devtools.build.lib.syntax.util.EvaluationTestCase) PackageContext(com.google.devtools.build.lib.packages.PackageFactory.PackageContext) Environment(com.google.devtools.build.lib.syntax.Environment)

Aggregations

PackageContext (com.google.devtools.build.lib.packages.PackageFactory.PackageContext)1 Environment (com.google.devtools.build.lib.syntax.Environment)1 EvaluationTestCase (com.google.devtools.build.lib.syntax.util.EvaluationTestCase)1