Limit how often GC can be run.
[SquirrelJME.git] / buildSrc / src / main / java / cc / squirreljme / plugin / multivm / CheckForTests.java
blob3973652a7cc2e55b062bc160c8081af5c2ade83e
1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc.squirreljme.plugin.multivm;
12 import org.gradle.api.Task;
13 import org.gradle.api.specs.Spec;
15 /**
16 * Checks that there are tests.
18 * @since 2020/08/07
20 public class CheckForTests
21 implements Spec<Task>
23 /** The source set to check. */
24 protected final String sourceSet;
26 /**
27 * Initializes the checker.
29 * @param __sourceSet The source set to check.
30 * @throws NullPointerException On null arguments.
31 * @since 2020/08/07
33 public CheckForTests(String __sourceSet)
34 throws NullPointerException
36 if (__sourceSet == null)
37 throw new NullPointerException("NARG");
39 this.sourceSet = __sourceSet;
42 /**
43 * {@inheritDoc}
44 * @since 2020/08/07
46 @Override
47 public boolean isSatisfiedBy(Task __task)
49 return !VMHelpers.runningTests(__task.getProject(),
50 this.sourceSet).tests.isEmpty();