Add basic test based on runit framework
See: https://github.com/mizdebsk/runit
This commit is contained in:
parent
b57074fd52
commit
e6508ea7ee
2 changed files with 50 additions and 0 deletions
36
runit/BasicCheck.java
Normal file
36
runit/BasicCheck.java
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
package tests;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.endsWith;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.hamcrest.Matchers.matchesRegex;
|
||||
import static org.hamcrest.Matchers.not;
|
||||
import static org.junit.jupiter.api.Assumptions.assumeFalse;
|
||||
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
|
||||
import io.kojan.javadeptools.rpm.RpmInfo;
|
||||
import io.kojan.runit.api.PackageTest;
|
||||
|
||||
@DisplayName("/basic")
|
||||
public class BasicCheck {
|
||||
|
||||
@PackageTest
|
||||
public void noBootstrapRelease(RpmInfo rpm) {
|
||||
assertThat("No ~bootstrap in release", rpm.getRelease(), not(endsWith("~bootstrap")));
|
||||
}
|
||||
|
||||
@PackageTest
|
||||
public void saneName(RpmInfo rpm) {
|
||||
assumeFalse(rpm.getName().startsWith("java_cup"));
|
||||
assertThat("Package name is sane", rpm.getName(), matchesRegex("[a-z][a-z0-9-]+[a-z0-9]"));
|
||||
}
|
||||
|
||||
@PackageTest
|
||||
public void testJavadocNoarch(RpmInfo rpm) {
|
||||
assumeFalse(rpm.isSourcePackage());
|
||||
assumeTrue(rpm.getName().endsWith("-javadoc"));
|
||||
assertThat("Javadoc package is noarch", rpm.getArch(), is("noarch"));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue