9191 endif
9292endif
9393
94+ ifndef CC_TOOL
95+ FETCH_CC_TOOL := tests/fetch_cc-test-reporter
96+ CC_TOOL := ./cc-test-reporter
97+ CC_TOOL_ARGS := after-build --exit-code 0 -t coverage.py
98+ DS_TOOL := ./bin/deepsource
99+ DS_TOOL_ARGS := report --analyzer test-coverage --key python --value-file ./coverage.xml
100+ endif
101+
94102ifndef PIP_COMMON_FLAGS
95103 # Define common pip install flags
96104 PIP_COMMON_FLAGS := --use-pep517 --exists-action s --upgrade --upgrade-strategy eager
97105endif
98106
99- # Define environment-specific pip install flags
100- ifeq ($(shell uname) , Darwin)
107+ # Define environment-specific flags
108+ ifeq ($(shell uname -s) , Darwin)
101109 PIP_ENV_FLAGS := --break-system-packages
110+ else ifeq ($(shell uname -s), Linux)
111+ PIP_ENV_FLAGS :=
102112else
103113 PIP_ENV_FLAGS :=
114+ FETCH_CC_TOOL :=
115+ CC_TOOL :=
116+ CC_TOOL_ARGS :=
117+ DS_TOOL :=
118+ DS_TOOL_ARGS :=
104119endif
105120
106121ifeq "$(WAIT ) " ""
@@ -222,7 +237,7 @@ test: just-test cc-test-reporter
222237 $(QUIET )$(DO_FAIL ) ;
223238 $(QUIET )$(COVERAGE ) combine 2> $(ERROR_LOG_PATH ) || : ;
224239 $(QUIET )$(COVERAGE ) report -m --include=* 2> $(ERROR_LOG_PATH ) || : ;
225- $(QUIET ) ./cc-test-reporter after-build --exit-code 0 -t coverage.py 2> /dev/null || : ;
240+ $(QUIET )$( CC_TOOL ) $( CC_TOOL_ARGS ) 2> $( ERROR_LOG_PATH ) || : ;
226241 $(QUIET )$(ECHO ) " $@ : Done."
227242
228243test-tox : cleanup
@@ -231,8 +246,8 @@ test-tox: cleanup
231246
232247test-pytest : cleanup MANIFEST.in cc-test-reporter must_have_pytest test-reports
233248 $(QUIET )$(PYTHON ) -m pytest --cache-clear --doctest-glob=pythonrepo/* .py --doctest-modules --cov=. --cov-append --cov-report=xml --junitxml=test-reports/junit.xml -v --rootdir=. || DO_FAIL=" exit 2" ;
234- $(QUIET ) ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml || : ;
235- $(QUIET ) ./cc-test-reporter after-build --exit-code 0 -t coverage.py 2> /dev/null || : ;
249+ $(QUIET )$( DS_TOOL ) $( DS_TOOL_ARGS ) || : ;
250+ $(QUIET )$( CC_TOOL ) $( CC_TOOL_ARGS ) 2> $( ERROR_LOG_PATH ) || : ;
236251 $(QUIET )$(WAIT ) ;
237252 $(QUIET )$(DO_FAIL ) ;
238253 $(QUIET )$(ECHO ) " $@ : Done."
@@ -244,7 +259,7 @@ test-style: cleanup
244259 $(QUIET )$(ECHO ) " $@ : Done."
245260
246261cc-test-reporter : tests/fetch_cc-test-reporter
247- $(QUIET ) tests/fetch_cc-test-reporter ;
262+ $(QUIET )$( FETCH_CC_TOOL ) ;
248263 $(QUIET )$(WAIT ) ;
249264 $(QUIET )$(DO_FAIL ) ;
250265 $(QUIET )$(ECHO ) " $@ : Done."
0 commit comments