Permalink
Browse files

Move unit tests to 'test' directory

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
  • Loading branch information...
1 parent 4436cc6 commit a5a40ab7c3c176fe1b2485f64a8ad87affe47172 Pekka Enberg committed Nov 29, 2009
Showing with 13 additions and 7 deletions.
  1. +11 −5 Makefile
  2. +1 −1 scripts/gen-test-proto
  3. +1 −1 scripts/gen-test-runner
  4. 0 { → test}/csv-test.c
View
@@ -94,8 +94,14 @@ CFLAGS += $(CONFIG_OPTS)
DEPS := $(patsubst %.o,%.d,$(OBJS))
TEST_PROGRAM := test-pstore
-TEST_SUITE_H := test-suite.h
-TEST_OBJS := test-runner.c harness.o csv-test.o csv.o die.o
+TEST_SUITE_H := test/test-suite.h
+
+TEST_OBJS := csv.o
+TEST_OBJS += die.o
+TEST_OBJS += harness.o
+TEST_OBJS += test/csv-test.o
+TEST_OBJS += test/test-runner.o
+
TEST_DEPS := $(patsubst %.o,%.d,$(TEST_OBJS))
# Targets
@@ -135,13 +141,13 @@ test: $(TEST_PROGRAM)
$(Q) ./$(TEST_PROGRAM)
.PHONY: test
-test-runner.c: $(FORCE)
+test/test-runner.c: $(FORCE)
$(E) " GEN " $@
- $(Q) sh scripts/gen-test-runner > $@
+ $(Q) sh scripts/gen-test-runner test/*-test.c > $@
$(TEST_SUITE_H): $(FORCE)
$(E) " GEN " $@
- $(Q) sh scripts/gen-test-proto > $@
+ $(Q) sh scripts/gen-test-proto test/*-test.c > $@
$(TEST_PROGRAM): $(TEST_SUITE_H) $(TEST_DEPS) $(TEST_OBJS)
$(E) " LINK " $@
View
@@ -3,6 +3,6 @@
echo "#ifndef TEST_SUITE_H"
echo "#define TEST_SUITE_H"
-grep -h "^void test_" *|sed -e "s/^void /extern void /g"|sed -e "s/(void)/(void);/g"
+grep -h "^void test_" $1|sed -e "s/^void /extern void /g"|sed -e "s/(void)/(void);/g"
echo "#endif"
View
@@ -6,7 +6,7 @@ echo \
'
int main(int argc, char *argv[])
{'
-grep -h "^void test_" *|sed -e "s/^void //g"|sed -e "s/(void)/();/g"
+grep -h "^void test_" $1|sed -e "s/^void //g"|sed -e "s/(void)/();/g"
echo \
'
File renamed without changes.

0 comments on commit a5a40ab

Please sign in to comment.