Skip to content

Commit 0ed9333

Browse files
committed
Update mock makefiles to work with libpq objfiles
mock.mk before this has trouble to filter out mocked objects from src/backend/objfiles.txt, because the filenames in it have redundant "src/backend/../../" and suffix "_for_backend". This commit removes them before mocking to make it work.
1 parent 974c414 commit 0ed9333

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/backend/common.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ SUBSYS.o: $(SUBDIROBJS) $(OBJS)
2828

2929
objfiles.txt: Makefile $(SUBDIROBJS) $(OBJS)
3030
# Don't rebuild the list if only the OBJS have changed.
31-
$(if $(filter-out $(OBJS),$?),( $(if $(SUBDIROBJS),cat $(SUBDIROBJS); )echo $(addprefix $(subdir)/,$(OBJS)) ) >$@,touch $@)
31+
$(if $(filter-out $(OBJS),$?),( $(if $(SUBDIROBJS),cat $(SUBDIROBJS); )echo $(subst src/backend/../../,,$(addprefix $(subdir)/,$(OBJS))) ) >$@,touch $@)
3232

3333
# make function to expand objfiles.txt contents
3434
expand_subsys = $(foreach file,$(1),$(if $(filter %/objfiles.txt,$(file)),$(patsubst ../../src/backend/%,%,$(addprefix $(top_builddir)/,$(shell cat $(file)))),$(file)))

src/backend/mock.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ ALL_OBJS=$(addprefix $(top_srcdir)/, \
125125
# in a test program.
126126
#
127127
# The argument is a list of backend object files that should *not* be included
128-
BACKEND_OBJS=$(filter-out $(1), $(ALL_OBJS))
128+
BACKEND_OBJS=$(filter-out $(1), $(subst _for_backend,,$(ALL_OBJS)))
129129

130130
# If we are using linker's wrap feature in unit test, add wrap flags for
131131
# those mocked functions

src/test/unit/mock/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
backend
2+
interfaces

0 commit comments

Comments
 (0)