forked from vieter-v/libvieter
chore: allow tests to access internal methods
This commit is contained in:
parent
6823050c2f
commit
ef625ed14e
2 changed files with 8 additions and 3 deletions
10
Makefile
10
Makefile
|
|
@ -56,11 +56,15 @@ build-test: $(BINS_TEST)
|
|||
$(BINS_TEST): %: %.c.o $(OBJS)
|
||||
$(CC) $^ -o $@
|
||||
|
||||
# Each test includes the test directory, which contains the acutest header file
|
||||
# Allow with the include directory, each test includes $(TEST_DIR) (which
|
||||
# contains the acutest.h header file), and the src directory of the module it's
|
||||
# testing. This allows tests to access internal methods, which aren't publicly
|
||||
# exposed.
|
||||
$(BUILD_DIR)/$(TEST_DIR)/%.c.o: $(TEST_DIR)/%.c
|
||||
mkdir -p $(dir $@)
|
||||
$(CC) $(CFLAGS) -I$(TEST_DIR) -c $< -o $@
|
||||
|
||||
$(CC) $(CFLAGS) -I$(TEST_DIR) \
|
||||
-I$(dir $(@:$(BUILD_DIR)/$(TEST_DIR)/%=$(SRC_DIR)/%)) \
|
||||
-c $< -o $@
|
||||
|
||||
# =====MAINTENANCE=====
|
||||
.PHONY: lint
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue