aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorrodrigosiqueira <rodrigosiqueiramelo@gmail.com>2016-12-04 11:28:25 -0200
committerrodrigosiqueira <rodrigosiqueiramelo@gmail.com>2016-12-04 11:34:27 -0200
commite0152319f5ed6d99eb38bf6da40157a60fd48e04 (patch)
tree7441f203a9564ae4073297d2215b5bf35d7303d5 /Makefile
parenta44cc7a3d1c21c37c7dfb88b92bb479389dfce16 (diff)
downloadyosys-e0152319f5ed6d99eb38bf6da40157a60fd48e04.tar.gz
yosys-e0152319f5ed6d99eb38bf6da40157a60fd48e04.tar.bz2
yosys-e0152319f5ed6d99eb38bf6da40157a60fd48e04.zip
Added required structure to implement unit tests
Added modifications inside the main Makefile to refers the unit test Makefile. Added separated Makefile only for compiling unit tests. Added simple example of unit test. Signed-off-by: Charles Oliveira <18oliveira.charles@gmail.com> Signed-off-by: Pablo Alejandro <pabloabur@usp.br> Signed-off-by: Rodrigo Siqueira <siqueira@ime.usp.br>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 14 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 9bf67d349..340fe1229 100644
--- a/Makefile
+++ b/Makefile
@@ -45,6 +45,9 @@ TARGETS = yosys$(EXE) yosys-config
PRETTY = 1
SMALL = 0
+# Unit test
+UNITESTPATH := tests/unit
+
all: top-all
YOSYS_SRC := $(dir $(firstword $(MAKEFILE_LIST)))
@@ -447,6 +450,17 @@ vloghtb: $(TARGETS) $(EXTRA_TARGETS)
@echo " Passed \"make vloghtb\"."
@echo ""
+# Unit test
+unit-test: libyosys.so
+ @$(MAKE) -C $(UNITESTPATH) CXX="$(CXX)" CPPFLAGS="$(CPPFLAGS)" \
+ CXXFLAGS="$(CXXFLAGS)" LDLIBS="$(LDLIBS)" ROOTPATH="$(CURDIR)"
+
+run-all-unitest:
+ @$(MAKE) -C $(UNITESTPATH) run-tests
+
+clean-unit-test:
+ @$(MAKE) -C $(UNITESTPATH) clean
+
install: $(TARGETS) $(EXTRA_TARGETS)
$(INSTALL_SUDO) mkdir -p $(DESTDIR)$(BINDIR)
$(INSTALL_SUDO) install $(TARGETS) $(DESTDIR)$(BINDIR)