Skip to content

Commit

Permalink
Convert pass_compile tests to CTest
Browse files Browse the repository at this point in the history
  • Loading branch information
kulp committed Jan 3, 2021
1 parent 9b08818 commit d385066
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,18 @@ foreach(case ${fail_compile_INPUTS})

endforeach()

file(GLOB pass_compile_INPUTS test/pass_compile/*.tas)
foreach(case ${pass_compile_INPUTS})

file(RELATIVE_PATH basename ${CMAKE_CURRENT_SOURCE_DIR}/test/pass_compile/ ${case})
check_success(
NAME "pass_compile_${basename}"
COMMAND tas
ARGUMENTS ${case}
)

endforeach()

check_failure(
NAME "early end of file"
EXPECT "End of file unexpectedly reached"
Expand Down
3 changes: 0 additions & 3 deletions mk/misc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,6 @@ check_hw_icarus_op: PERIODS.mk
check_hw_icarus_op check_hw_icarus_run: export run=$(MAKE) -s --no-print-directory -C $(TOP)/hw/icarus -f $(abspath $(BUILDDIR))/PERIODS.mk -f Makefile run_$* VPATH=$(TOP)/test/op:$(TOP)/test/run BUILDDIR=$(abspath $(BUILDDIR)) PLUSARGS_EXTRA=+DUMPENDSTATE | grep -v -e ^WARNING: -e ^ERROR: -e ^VCD | grep -o 'B.[[:xdigit:]]\{8\}' | tail -n1 | grep -q 'f\{8\}'

check_compile: $(build_tas) $(build_tld)
@$(MAKESTEP) "Building tests from test/ ..."
$(MAKE) $S -C $(TOP)/test
@$(MAKESTEP) "Done building in test/."
@$(MAKESTEP) -n "Building examples from ex/ ... "
$(MAKE) $S MAKESTEP=true --always-make -C $(TOP)/ex && $(MAKESTEP) ok

9 changes: 1 addition & 8 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,8 @@ CPPFLAGS += -I$(TOP)/lib

vpath %.tas $(TOP)/lib

vpath %.tas pass_compile/

get_obj_name = $(notdir $(patsubst %.tas,%.to,$1))

PASS_ASSEMBLE := $(call get_obj_name,$(wildcard pass_compile/*))

clean_FILES += *.to *.texe
clean_FILES += ops/*.texe

all: positive
positive: $(PASS_ASSEMBLE)
all: ;

0 comments on commit d385066

Please sign in to comment.