summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2013-05-05 04:45:47 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2013-05-05 19:51:23 +0200
commitcdb0ec474cc2c2ef11566b8e45e639115bd49529 (patch)
tree4cbc5fc4cbe9dca82166889d9187f9bb615b1d33 /Makefile
parent4f4a86529adc896ed4d3bc922ef88aec89e3fd53 (diff)
downloadtdv-cdb0ec474cc2c2ef11566b8e45e639115bd49529.tar.gz
tdv-cdb0ec474cc2c2ef11566b8e45e639115bd49529.tar.xz
tdv-cdb0ec474cc2c2ef11566b8e45e639115bd49529.zip
Add a test for the dictionary
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 11 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index e354dff..4ca0280 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,15 @@
SHELL = /bin/sh
pkgs = ncursesw glib-2.0 gio-2.0
-targets = sdcli
+tests = test-stardict
+targets = sdcli $(tests)
CC = clang
CFLAGS = -ggdb -std=gnu99 -Wall -Wextra -Wno-missing-field-initializers \
`pkg-config --cflags $(pkgs)`
LDFLAGS = `pkg-config --libs $(pkgs)`
-.PHONY: all clean
+.PHONY: all clean test
all: $(targets)
@@ -18,5 +19,13 @@ clean:
sdcli: sdcli.o stardict.o
$(CC) $^ -o $@ $(LDFLAGS)
+test-stardict: test-stardict.o stardict.o
+ $(CC) $^ -o $@ $(LDFLAGS)
+
+test: $(tests)
+ for i in $(tests); do \
+ gtester --verbose ./$$i; \
+ done
+
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@