Skip to content

Commit

Permalink
Convert check_obj tests to CTest
Browse files Browse the repository at this point in the history
  • Loading branch information
kulp committed Aug 6, 2021
1 parent 49cb507 commit 359e4e2
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
36 changes: 36 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -583,3 +583,39 @@ set_tests_properties(
DEPENDS "create irc.texe"
LABELS "tool=tsim"
)

check_failure(
NAME "corrupted object at word offset 0"
COMMAND tas
ARGS -d ${CMAKE_SOURCE_DIR}/test/misc/obj/check_obj_0.to
EXPECT "Bad magic when loading object"
)

check_failure(
NAME "corrupted object at word offset 2"
COMMAND tas
ARGS -d ${CMAKE_SOURCE_DIR}/test/misc/obj/check_obj_2.to
EXPECT "Error during initialisation for format 'obj'"
)

check_failure(
NAME "corrupted object at word offset 4"
COMMAND tas
ARGS -d ${CMAKE_SOURCE_DIR}/test/misc/obj/check_obj_4.to
EXPECT "Error during initialisation for format 'obj'"
)

check_failure(
NAME "corrupted object at word offset 5"
COMMAND tas
ARGS -d ${CMAKE_SOURCE_DIR}/test/misc/obj/check_obj_5.to
EXPECT "Error during initialisation for format 'obj'"
)

check_failure(
NAME "corrupted object at word offset 6"
COMMAND tas
ARGS -d ${CMAKE_SOURCE_DIR}/test/misc/obj/check_obj_6.to
EXPECT "Error during initialisation for format 'obj'"
)

6 changes: 0 additions & 6 deletions mk/misc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,14 @@ coverage_html: coverage.info
genhtml --output-directory $@ $^

check: check_sw
CHECK_SW_TASKS ?= check_obj
check_sw: check_ctest
check_sw: $(CHECK_SW_TASKS)

check_ctest: vpi jit
cmake -S $(TOP) -B $(BUILDDIR)/ctest
$(MAKE) --directory=$(TOP)/hw/icarus BUILDDIR=$(realpath $(BUILDDIR))
cmake --build $(BUILDDIR)/ctest
export PATH=$(abspath $(BUILDDIR)):$$PATH && cd $(BUILDDIR)/ctest && ctest

check_obj: check_obj_0 check_obj_2 check_obj_4 check_obj_5 check_obj_6
check_obj_%: $(TOP)/test/misc/obj/check_obj_%.to | $(build_tas)
(! $(tas) -d $< 2> /dev/null)

vpi:
$(MAKE) -C $(BUILDDIR) -f $(TOP)/hw/vpi/Makefile $@

Expand Down

0 comments on commit 359e4e2

Please sign in to comment.