Skip to content

Commit 1c639c9

Browse files
feedback
1 parent 1079a9a commit 1c639c9

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

Makefile

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -134,21 +134,6 @@ ifneq (,$(STATIC_BINARY))
134134
CFLAGS += -static -fdata-sections -ffunction-sections -Wl,--gc-sections
135135
endif
136136

137-
# Default is to run cpp unit tests
138-
RUN_CPP_TESTS :=
139-
140-
# Determine if the target should run unit tests (test-cpp is explicitly invoked, or test is invoked and TESTS is empty)
141-
ifeq ($(filter test-cpp,$(MAKECMDGOALS)),test-cpp)
142-
RUN_CPP_TESTS := 1
143-
endif
144-
145-
ifeq ($(filter test,$(MAKECMDGOALS)),test)
146-
ifeq ($(strip $(TESTS)),)
147-
RUN_CPP_TESTS := 1
148-
endif
149-
endif
150-
151-
152137
.PHONY: all jar release build-test test clean coverage clean-coverage build-test-java build-test-cpp test-cpp test-java check-md format-md
153138

154139
all: build/bin build/lib build/$(LIB_PROFILER) build/$(ASPROF) jar build/$(JFRCONV) build/$(ASPROF_HEADER)
@@ -227,14 +212,12 @@ build/$(CONVERTER_JAR): $(CONVERTER_SOURCES) $(RESOURCES)
227212

228213
build/test/cpptests: $(CPP_TEST_SOURCES) $(CPP_TEST_HEADER) $(SOURCES) $(HEADERS) $(RESOURCES) $(JAVA_HELPER_CLASSES)
229214
mkdir -p build/test
230-
ifneq ($(RUN_CPP_TESTS),)
231215
ifeq ($(MERGE),true)
232216
for f in src/*.cpp test/native/*.cpp; do echo '#include "'$$f'"'; done |\
233217
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFS) $(INCLUDES) $(CPP_TEST_INCLUDES) -fPIC -o $@ -xc++ - $(LIBS)
234218
else
235219
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFS) $(INCLUDES) $(CPP_TEST_INCLUDES) -fPIC -o $@ $(SOURCES) $(CPP_TEST_SOURCES) $(LIBS)
236220
endif
237-
endif
238221

239222
build-test-java: all build/$(TEST_JAR) build/test/build-test-libs build/test/build-test-bins
240223

@@ -275,10 +258,8 @@ build/test/build-test-bins: $(CPP_TEST_BIN_SOURCES)
275258
@touch $@
276259

277260
test-cpp: build-test-cpp
278-
ifneq ($(RUN_CPP_TESTS),)
279261
@echo "Running cpp tests..."
280262
LD_LIBRARY_PATH="$(TEST_LIB_DIR)" DYLD_LIBRARY_PATH="$(TEST_LIB_DIR)" build/test/cpptests
281-
endif
282263

283264
test-java: build-test-java
284265
echo "Running tests against $(LIB_PROFILER)"
@@ -291,7 +272,12 @@ coverage: clean-coverage
291272
cd build/test/ && gcovr -r ../.. --html-details --gcov-executable "$(GCOV)" -o coverage/index.html
292273
rm -rf -- -.gc*
293274

294-
test: test-cpp test-java
275+
# unit tests shouldn't run if the user selects an integration test target
276+
ifeq ($(TESTS),)
277+
TEST_CPP := test-cpp
278+
endif
279+
280+
test: $(TEST_CPP) test-java
295281

296282
$(TEST_DEPS_DIR):
297283
mkdir -p $@

0 commit comments

Comments
 (0)