<commit_before># Makefile for testing Trac (see doc/dev/testing.rst)
# ----------------------------------------------------------------------------

# copy Makefile.cfg.sample to Makefile.cfg and adapt to your local environment.
-include Makefile.cfg

# ----------------------------------------------------------------------------
ifeq "$(OS)" "Windows_NT"
    SEP = ;
else
    SEP = :
endif

export TRAC_TEST_DB_URI = $($(db).uri)
export PATH := $(python.$(if $(python),$(python),$($(db).python))):$(PATH)
export PYTHONPATH := .$(SEP)$(PYTHONPATH)
# ----------------------------------------------------------------------------


.PHONY: all
ifdef test
all: status
	python $(test)
else
all:
	@echo "make test|unit-test|functional-test|test=... [db=...] [python=...]"
endif

.PHONY: status
status:
	@python -V
	@echo PYTHONPATH=$$PYTHONPATH

.PHONY: clean
clean:
	find -name \*.py[co] | xargs -d"\n" --no-run-if-empty rm -f
	rm -rf .figleaf* html

.PHONY: test unit-test functional-test
test: unit-test functional-test

unit-test: Trac.egg-info
	python ./trac/test.py --skip-functional-tests

functional-test: Trac.egg-info
	python trac/tests/functional/__init__.py -v

.PHONY: coverage
coverage: html/index.html

html/index.html: .figleaf.functional .figleaf.unittests
	figleaf2html --exclude-patterns=trac/tests/figleaf-exclude .figleaf.functional .figleaf.unittests<commit_msg>testing: make status also shows the current value for TRAC_TEST_DB_URI<commit_after># Makefile for testing Trac (see doc/dev/testing.rst)
# ----------------------------------------------------------------------------

# copy Makefile.cfg.sample to Makefile.cfg and adapt to your local environment.
-include Makefile.cfg

# ----------------------------------------------------------------------------
ifeq "$(OS)" "Windows_NT"
    SEP = ;
else
    SEP = :
endif

export TRAC_TEST_DB_URI = $($(db).uri)
export PATH := $(python.$(if $(python),$(python),$($(db).python))):$(PATH)
export PYTHONPATH := .$(SEP)$(PYTHONPATH)
# ----------------------------------------------------------------------------


.PHONY: all
ifdef test
all: status
	python $(test)
else
all:
	@echo "make test|unit-test|functional-test|test=... [db=...] [python=...]"
endif

.PHONY: status
status:
	@python -V
	@echo PYTHONPATH=$$PYTHONPATH
	@echo TRAC_TEST_DB_URI=$$TRAC_TEST_DB_URI

.PHONY: clean
clean:
	find -name \*.py[co] | xargs -d"\n" --no-run-if-empty rm -f
	rm -rf .figleaf* html

.PHONY: test unit-test functional-test
test: unit-test functional-test

unit-test: Trac.egg-info
	python ./trac/test.py --skip-functional-tests

functional-test: Trac.egg-info
	python trac/tests/functional/__init__.py -v

.PHONY: coverage
coverage: html/index.html

html/index.html: .figleaf.functional .figleaf.unittests
	figleaf2html --exclude-patterns=trac/tests/figleaf-exclude .figleaf.functional .figleaf.unittests
{'fraction_non_alphanumeric': 0.29356193142057385, 'fraction_numerical': 0.0006997900629811056, 'mean_word_length': 2.0841423948220066, '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': '5742565', 'n_tokens_mistral': 958, 'n_tokens_neox': 919, 'n_words': 214}