mirror of
https://github.com/iustin/mt-st.git
synced 2025-12-23 05:45:13 +00:00
Switch 'make check' to be done via shelltestrunner
The embedding of tests in the Makefile works only for that is there today - a few `--version` and `stinit -p` calls. For expanding the test coverage, as much as it can be done for `mt`, let's use a proper shell test runner. `shelltestrunner` is available in Debian/Ubuntu, so it's likely to be available in other distributions too, and as such should not be a big barrier to contribution.
This commit is contained in:
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@@ -46,6 +46,9 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get install -yy shelltestrunner
|
||||
|
||||
- name: Build the code
|
||||
run: make CFLAGS=-coverage
|
||||
|
||||
|
||||
8
Makefile
8
Makefile
@@ -87,13 +87,7 @@ distcheck: dist
|
||||
test "$$numfiles" -eq 5
|
||||
|
||||
check: $(PROGS)
|
||||
echo Checking version output
|
||||
./mt --version
|
||||
./stinit --version
|
||||
echo Checking parse status
|
||||
./stinit -p -f stinit.def.examples
|
||||
echo Checking complete stinit parsing
|
||||
( ./stinit -v -v -p -f stinit.def.examples 2>&1 | grep -q 'Mode 1 definition: scsi2logical=1 can-bsr=1 auto-lock=0 two-fms=0 drive-buffering=1 buffer-writes read-ahead=1 async-writes=1 can-partitions=0 fast-eom=1 blocksize=0 sili=1 timeout=900 long-timeout=14400 density=0x44 compression=0' )
|
||||
shelltest -DVERSION=$(VERSION) tests
|
||||
|
||||
# This needs lcov installed, and it's useful for local testing.
|
||||
coverage: clean
|
||||
|
||||
21
tests/basic.test
Normal file
21
tests/basic.test
Normal file
@@ -0,0 +1,21 @@
|
||||
# Check --version works
|
||||
./mt --version
|
||||
>>> /VERSION/
|
||||
>>>= 0
|
||||
|
||||
./mt -v
|
||||
>>> /VERSION/
|
||||
>>>= 0
|
||||
|
||||
./stinit --version
|
||||
>>> /VERSION/
|
||||
>>>= 0
|
||||
|
||||
# Check -h works
|
||||
./mt -h
|
||||
>>>2 /commands: weof, wset, eof/
|
||||
>>>= 0
|
||||
|
||||
./stinit -h
|
||||
>>>2 /Usage: stinit/
|
||||
>>>= 0
|
||||
9
tests/stinit-parsing.test
Normal file
9
tests/stinit-parsing.test
Normal file
@@ -0,0 +1,9 @@
|
||||
# Check example file parsing
|
||||
./stinit -p -f stinit.def.examples
|
||||
>>>= 0
|
||||
|
||||
# Checking complete stinit parsing
|
||||
./stinit -v -v -p -f stinit.def.examples
|
||||
>>> /No errors found./
|
||||
>>>2 /Mode 1 definition: scsi2logical=1 can-bsr=1 auto-lock=0 two-fms=0 drive-buffering=1 buffer-writes read-ahead=1 async-writes=1 can-partitions=0 fast-eom=1 blocksize=0 sili=1 timeout=900 long-timeout=14400 density=0x44 compression=0/
|
||||
>>>= 0
|
||||
Reference in New Issue
Block a user