mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2026-01-22 17:16:11 +00:00
Updating CLTH to 2.0 along with the related CLI tests.
This commit is contained in:
@@ -29,6 +29,7 @@ import org.junit.jupiter.params.provider.MethodSource;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import io.github.a2geek.clth.TestSuite;
|
||||
@@ -37,7 +38,12 @@ public class AcCommandLineTest {
|
||||
@ParameterizedTest(name = "{1}: {2}")
|
||||
@MethodSource("testCases")
|
||||
public void test(TestSuite testSuite, String name, String parameters) {
|
||||
TestHarness.run(testSuite, JUnitHelper::execute, TestHarness.FilePreservation.DELETE);
|
||||
TestHarness.Settings settings = TestHarness.settings()
|
||||
.deleteFiles()
|
||||
.baseDirectory(Path.of("cli-tests/src/test/resources"))
|
||||
.enableAlwaysShowOutput()
|
||||
.get();
|
||||
TestHarness.run(testSuite, JUnitHelper::execute, settings);
|
||||
}
|
||||
|
||||
public static Stream<Arguments> testCases() {
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.junit.jupiter.params.provider.MethodSource;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import io.github.a2geek.clth.TestSuite;
|
||||
@@ -37,7 +38,12 @@ public class AcxCommandLineTest {
|
||||
@ParameterizedTest(name = "{1}: {2}")
|
||||
@MethodSource("testCases")
|
||||
public void test(TestSuite testSuite, String name, String parameters) {
|
||||
TestHarness.run(testSuite, JUnitHelper::execute, TestHarness.FilePreservation.DELETE);
|
||||
TestHarness.Settings settings = TestHarness.settings()
|
||||
.deleteFiles()
|
||||
.baseDirectory(Path.of("cli-tests/src/test/resources"))
|
||||
.enableAlwaysShowOutput()
|
||||
.get();
|
||||
TestHarness.run(testSuite, JUnitHelper::execute, settings);
|
||||
}
|
||||
|
||||
public static Stream<Arguments> testCases() {
|
||||
|
||||
@@ -35,7 +35,7 @@ files:
|
||||
suffix: .po
|
||||
|
||||
tests:
|
||||
- name: ticket192-ac
|
||||
- name: ticket192
|
||||
variables:
|
||||
# All arrays must be same length -- only iterated over, not matrixed
|
||||
flag: ["-dos140", "-pro140", "-pas140"]
|
||||
@@ -54,6 +54,15 @@ tests:
|
||||
volname: ["", "TEST"]
|
||||
disk: ["$testdisk.dsk", "$testdisk.po"]
|
||||
format: ["Disk Format: DOS 3.3", "Disk Format: ProDOS"]
|
||||
directory:
|
||||
- |
|
||||
.*T 003 TEXTFILE.*
|
||||
.*A 002 BASFILE.*
|
||||
.*B 002 BINFILE.*
|
||||
- |
|
||||
.*TEXTFILE TXT 001.*
|
||||
.*BASFILE BAS 001.*
|
||||
.*BINFILE BIN 001.*
|
||||
steps:
|
||||
# Create our image
|
||||
- command: ac $flag $disk $volname
|
||||
@@ -65,16 +74,20 @@ tests:
|
||||
stdin: $binfile
|
||||
# List image
|
||||
- command: ac -i $disk
|
||||
match: contains
|
||||
criteria:
|
||||
match: contains
|
||||
stdout: $format
|
||||
- command: ac -l $disk
|
||||
match: contains
|
||||
stdout: TEXTFILE
|
||||
criteria:
|
||||
match: regex
|
||||
whitespace: ignore
|
||||
stdout: $directory
|
||||
# Verify contents of files
|
||||
- command: ac -e $disk TEXTFILE
|
||||
stdout: $txtfile
|
||||
- command: ac -e $disk BASFILE
|
||||
match: trim
|
||||
criteria:
|
||||
whitespace: trim
|
||||
stdout: |
|
||||
10 TEXT : HOME
|
||||
20 PRINT "HELLO, WORLD"
|
||||
|
||||
@@ -69,7 +69,7 @@ files:
|
||||
suffix: .po
|
||||
|
||||
tests:
|
||||
- name: ticket192-acx
|
||||
- name: ticket192
|
||||
variables:
|
||||
# All arrays must be same length -- only iterated over, not matrixed
|
||||
flag: ["--dos", "--prodos", "--pascal"]
|
||||
@@ -85,6 +85,15 @@ tests:
|
||||
volname: ["", "TEST"]
|
||||
disk: ["$testdisk.dsk", "$testdisk.po"]
|
||||
format: ["Disk Format: DOS 3.3", "Disk Format: ProDOS"]
|
||||
directory:
|
||||
- |
|
||||
.*T 003 TEXTFILE.*
|
||||
.*A 002 BASFILE.*
|
||||
.*B 002 BINFILE.*
|
||||
- |
|
||||
.*TEXTFILE TXT 001.*
|
||||
.*BASFILE BAS 001.*
|
||||
.*BINFILE BIN 001.*
|
||||
# Note that DOS assumes 6502 while ProDOS assumes 65C02...
|
||||
disassembly: ["$disassemblyDOS", "$disassemblyPRODOS"]
|
||||
steps:
|
||||
@@ -95,20 +104,25 @@ tests:
|
||||
- command: acx import -d $disk --name BINFILE --binary --addr=0x300 $binfile
|
||||
# List image
|
||||
- command: acx info -d $disk
|
||||
match: contains
|
||||
criteria:
|
||||
match: contains
|
||||
stdout: $format
|
||||
- command: acx list -d $disk
|
||||
match: contains
|
||||
stdout: TEXTFILE
|
||||
criteria:
|
||||
match: regex
|
||||
whitespace: ignore
|
||||
stdout: $directory
|
||||
# Verify contents of files
|
||||
- command: acx get -d $disk TEXTFILE
|
||||
stdout: $txtfile
|
||||
- command: acx get -d $disk BASFILE
|
||||
match: trim
|
||||
criteria:
|
||||
whitespace: trim
|
||||
stdout: |
|
||||
10 TEXT : HOME
|
||||
20 PRINT "HELLO, WORLD"
|
||||
30 END
|
||||
- command: acx get -d $disk BINFILE --assembly
|
||||
match: trim
|
||||
criteria:
|
||||
whitespace: trim
|
||||
stdout: $disassembly
|
||||
|
||||
@@ -17,5 +17,5 @@ ext {
|
||||
springBoot = "2.7.18"
|
||||
acdasmVersion = "6.1"
|
||||
graalvmBuildVersion = "0.10.6"
|
||||
clthVersion = "1.3"
|
||||
clthVersion = "2.0"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user