tests: bonsai/mm.mk, bonsai/intcmp.mk: updates for regression testing

This commit is contained in:
Emma Tebibyte 2024-08-10 14:24:33 -06:00
parent e253cdf79c
commit 851f729ebd
Signed by: emma
GPG Key ID: 06FA419A1698C270
2 changed files with 10 additions and 6 deletions

View File

@ -7,7 +7,7 @@
# notice are preserved. This file is offered as-is, without any warranty. # notice are preserved. This file is offered as-is, without any warranty.
.PHONY: intcmp_tests .PHONY: intcmp_tests
intcmp_tests: intcmp_help intcmp_e intcmp_g intcmp_l intcmp_combined intcmp_tests: intcmp_help intcmp_none intcmp_e intcmp_g intcmp_l intcmp_combined
.PHONY: intcmp_help .PHONY: intcmp_help
intcmp_help: $(BIN)/intcmp intcmp_help: $(BIN)/intcmp
@ -31,6 +31,10 @@ intcmp_help: $(BIN)/intcmp
# the invocation. If this test failed, intcmp(1) would be confusing -l for -g, # the invocation. If this test failed, intcmp(1) would be confusing -l for -g,
# so that would be a good place to start looking for bugs. # so that would be a good place to start looking for bugs.
.PHONY: intcmp_none
intcmp_none: $(BIN)/intcmp
! $(BIN)/intcmp 1 2
.PHONY: intcmp_e .PHONY: intcmp_e
intcmp_e: $(BIN)/intcmp intcmp_e: $(BIN)/intcmp
$(BIN)/intcmp -e 3 3 3 # == $(BIN)/intcmp -e 3 3 3 # ==

View File

@ -5,13 +5,13 @@
# permitted in any medium without royalty provided the copyright notice and this # permitted in any medium without royalty provided the copyright notice and this
# notice are preserved. This file is offered as-is, without any warranty. # notice are preserved. This file is offered as-is, without any warranty.
NAME = mm
TARGET = $(NAME)_tests
BINARY = $(BIN)/$(NAME)
.PHONY: mm_tests .PHONY: mm_tests
mm_tests: mm_args mm_help mm_stderr mm_tests: mm_args mm_help mm_stderr
.PHONY: mm_none
mm_none: $(BIN)/mm
test "$$(printf 'meow\n' | $(BIN)/mm)" = meow
.PHONY: mm_args .PHONY: mm_args
# mm(1) will error if positional arguments are given without -i or -o # mm(1) will error if positional arguments are given without -i or -o
mm_args: $(BIN)/mm mm_args: $(BIN)/mm
@ -24,4 +24,4 @@ mm_help: $(BIN)/mm
.PHONY: mm_stderr .PHONY: mm_stderr
# check if stderr is empty upon specifying -e # check if stderr is empty upon specifying -e
mm_stderr: $(BIN)/mm mm_stderr: $(BIN)/mm
! test "$$(printf 'test\n' | $(BIN)/mm -e 2>&1 >/dev/null)" = "test" test "$$(printf 'test\n' | $(BIN)/mm -e 2>&1 >/dev/null )" = "test"