Compare commits
No commits in common. "62b1eeb5954027c6b40c08cd2252e46451e03c08" and "8ba37725cedec8a15d19c57a90fdbcf3b17319c1" have entirely different histories.
62b1eeb595
...
8ba37725ce
2 changed files with 8 additions and 22 deletions
12
.github/workflows/bld.yml
vendored
12
.github/workflows/bld.yml
vendored
|
@ -1,16 +1,14 @@
|
|||
name: bld-ci
|
||||
|
||||
on: [ push, pull_request, workflow_dispatch ]
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
|
||||
jobs:
|
||||
build-bld-project:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
java-version: [ 17, 21, 24 ]
|
||||
kotlin-version: [ 1.9.25, 2.0.21, 2.1.20 ]
|
||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
java-version: [17, 21, 24]
|
||||
|
||||
steps:
|
||||
- name: Checkout source repository
|
||||
|
@ -28,4 +26,4 @@ jobs:
|
|||
run: ./bld download
|
||||
|
||||
- name: Run tests
|
||||
run: ./bld compile test
|
||||
run: ./bld compile test
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
package rife.bld.extension;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.condition.EnabledOnOs;
|
||||
import org.junit.jupiter.api.condition.OS;
|
||||
import rife.bld.BaseProject;
|
||||
import rife.bld.Project;
|
||||
import rife.bld.WebProject;
|
||||
|
@ -26,7 +24,6 @@ import rife.bld.operations.exceptions.ExitStatusException;
|
|||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatCode;
|
||||
|
@ -34,8 +31,6 @@ import static org.assertj.core.api.Assertions.assertThatCode;
|
|||
|
||||
class ExecOperationTest {
|
||||
private static final String FOO = "foo";
|
||||
private static final boolean IS_WINDOWS = System.getProperty("os.name").toLowerCase(Locale.US).contains("win");
|
||||
private static final String CAT = IS_WINDOWS ? "type" : "cat";
|
||||
|
||||
@Test
|
||||
void testCommand() {
|
||||
|
@ -58,7 +53,7 @@ class ExecOperationTest {
|
|||
assertThatCode(() ->
|
||||
new ExecOperation()
|
||||
.fromProject(new BaseProject())
|
||||
.command(List.of(CAT, FOO))
|
||||
.command(List.of("cat", FOO))
|
||||
.execute()).isInstanceOf(ExitStatusException.class);
|
||||
}
|
||||
|
||||
|
@ -66,7 +61,7 @@ class ExecOperationTest {
|
|||
void testFailOnExit() {
|
||||
var op = new ExecOperation()
|
||||
.fromProject(new BaseProject())
|
||||
.command(List.of(CAT, FOO))
|
||||
.command(List.of("cat", FOO))
|
||||
.failOnExit(false);
|
||||
assertThat(op.isFailOnExit()).isFalse();
|
||||
assertThatCode(op::execute).doesNotThrowAnyException();
|
||||
|
@ -77,22 +72,15 @@ class ExecOperationTest {
|
|||
|
||||
@Test
|
||||
void testTimeout() {
|
||||
List<String> sleep;
|
||||
if (IS_WINDOWS) {
|
||||
sleep = List.of("timeout", "/t", "10");
|
||||
} else {
|
||||
sleep = List.of("sleep", "10");
|
||||
}
|
||||
var op = new ExecOperation()
|
||||
.fromProject(new BaseProject())
|
||||
.timeout(5)
|
||||
.command(sleep);
|
||||
.command(List.of("sleep", "10"));
|
||||
assertThat(op.timeout()).isEqualTo(5);
|
||||
assertThatCode(op::execute).isInstanceOf(ExitStatusException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
@EnabledOnOs({OS.LINUX, OS.MAC})
|
||||
void testTouch() throws Exception {
|
||||
var tmpFile = new File("hello.tmp");
|
||||
tmpFile.deleteOnExit();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue