<commit_before>#
# This file contains helper targets used by the CI.
#

# (HACK) get actual flash binary from FFLAGS if not defined.
FLASHFILE ?= $(filter $(HEXFILE) $(ELFFILE:.elf=.bin) $(ELFFILE),$(FFLAGS))

#
# This target will run "make test" on the CI cluster.
#
# In order to work, these requirements must be fulfilled:
# - DWQ_REPO and DWQ_COMMIT are set correctly
# - the user has set up autossh & proper authentication for connecting to the CI
# (intended to be used by CI only for now)
test-murdock:
	cd $(RIOTBASE) && \
		./.murdock test_job \
		$$(realpath --relative-to $(RIOTBASE) $(APPDIR)) \
		"$(BOARD):$(TOOLCHAIN)" \
		$(FLASHFILE)

# don't whitelist tests if there's no binary
ifeq (1,$(RIOTNOLINK))
  TEST_ON_CI_WHITELIST:=
endif

# create $(BINDIR)/.test file only if BOARD is in $(TEST_ON_CI_WHITELIST)
.PHONY: $(BINDIR)/.test
link: $(BINDIR)/.test
$(BINDIR)/.test: $(filter clean, $(MAKECMDGOALS))
ifneq (,$(filter $(BOARD) all, $(TEST_ON_CI_WHITELIST)))
	$(Q)mkdir -p $(BINDIR)
	$(Q)touch $@
else
	$(Q)rm -f $@
endif<commit_msg>murdock: refactor handling of TEST_ON_CI_WHITELIST<commit_after>#
# This file contains helper targets used by the CI.
#

# (HACK) get actual flash binary from FFLAGS if not defined.
FLASHFILE ?= $(filter $(HEXFILE) $(ELFFILE:.elf=.bin) $(ELFFILE),$(FFLAGS))

#
# This target will run "make test" on the CI cluster.
#
# In order to work, these requirements must be fulfilled:
# - DWQ_REPO and DWQ_COMMIT are set correctly
# - the user has set up autossh & proper authentication for connecting to the CI
# (intended to be used by CI only for now)
test-murdock:
	cd $(RIOTBASE) && \
		./.murdock test_job \
		$$(realpath --relative-to $(RIOTBASE) $(APPDIR)) \
		"$(BOARD):$(TOOLCHAIN)" \
		$(FLASHFILE)


# Control running tests on boards during the CI tests.
#
# Testing is enabled if all the following conditions are met:
#
#  * the board is whitelisted
#  * the board has enough memory and the executable is being linked
#
# TEST_ON_CI_WHITELIST can be empty, a board list or 'all'

TEST_ON_CI_WHITELIST ?=
TEST_ON_BOARD_ENABLED ?= $(filter $(TEST_ON_CI_WHITELIST:all=%),$(BOARD))

TEST_ON_CI_ENABLED ?= $(if $(RIOTNOLINK),,$(TEST_ON_BOARD_ENABLED))

.PHONY: test-on-ci-enabled
test-on-ci-enabled:
	$(Q)test -n "$(TEST_ON_CI_ENABLED)"


# create $(BINDIR)/.test file only if the test is enabled for this board
.PHONY: $(BINDIR)/.test
link: $(BINDIR)/.test
$(BINDIR)/.test: $(filter clean, $(MAKECMDGOALS))
ifneq (,$(TEST_ON_CI_ENABLED))
	$(Q)mkdir -p $(BINDIR)
	$(Q)touch $@
else
	$(Q)rm -f $@
endif
{'fraction_non_alphanumeric': 0.1469435736677116, 'fraction_numerical': 0.00039184952978056425, 'mean_word_length': 4.514038876889849, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1274283', 'n_tokens_mistral': 984, 'n_tokens_neox': 959, 'n_words': 296}