<commit_before>include ../../../Mk/macports.autoconf.mk

.PHONY: test

PWD=$(shell dirname `pwd`)

$(bindir)/port:
	@echo "Please install MacPorts before running this test"
	@exit 1

test:
	@PORTSRC=$(PORTSRC) $(bindir)/port clean > /dev/null
	@mkdir -p ../tracetesttmp
	@chown $(RUNUSR) ../tracetesttmp
	@sudo -u $(RUNUSR) touch ../tracetesttmp/delete-trace
	@sudo -u $(RUNUSR) touch ../tracetesttmp/rename-trace
	@sudo -u $(RUNUSR) mkdir -p ../tracetesttmp/rmdir-trace
	@rm -f /tmp/hello-trace
	@ln -sf /usr/include/unistd.h /tmp/link-trace2
	@chown -h $(RUNUSR) /tmp/link-trace2
	@PORTSRC=$(PORTSRC) $(bindir)/port -t test > output 2>&1 || (cat output; exit 1)
	@rm -f /tmp/link-trace2
	@rm -f /tmp/hello-trace
	@rm -rf ../tracetesttmp
	@sed -e "s|$(PWD)|PWD|g" < output > output.sed
	@diff -u master output.sed 2>&1 | tee difference
	@if [ -s difference ]; then \
		exit 1; \
	else \
		rm -f difference output.sed; \
	fi<commit_msg>trace test: add clean target, attempt to fix buildbot error<commit_after>include ../../../Mk/macports.autoconf.mk

.PHONY: test

PWD=$(shell dirname `pwd`)

$(bindir)/port:
	@echo "Please install MacPorts before running this test"
	@exit 1

test:
	@PORTSRC=$(PORTSRC) $(bindir)/port clean > /dev/null
	@mkdir -p ../tracetesttmp
	@chown $(RUNUSR) ../tracetesttmp || true
	@sudo -u $(RUNUSR) touch ../tracetesttmp/delete-trace
	@sudo -u $(RUNUSR) touch ../tracetesttmp/rename-trace
	@sudo -u $(RUNUSR) mkdir -p ../tracetesttmp/rmdir-trace
	@rm -f /tmp/hello-trace
	@ln -sf /usr/include/unistd.h /tmp/link-trace2
	@chown -h $(RUNUSR) /tmp/link-trace2
	@PORTSRC=$(PORTSRC) $(bindir)/port -t test > output 2>&1 || (cat output; exit 1)
	@rm -f /tmp/link-trace2
	@rm -f /tmp/hello-trace
	@rm -rf ../tracetesttmp
	@sed -e "s|$(PWD)|PWD|g" < output > output.sed
	@diff -u master output.sed 2>&1 | tee difference
	@if [ -s difference ]; then \
		exit 1; \
	else \
		rm -f difference output.sed; \
	fi

clean::
	@PORTSRC=$(PORTSRC) $(bindir)/port clean >/dev/null
	@rm -f output output.sed difference
	@rm -rf ../tracetesttmp
{'fraction_non_alphanumeric': 0.18341463414634146, 'fraction_numerical': 0.00975609756097561, 'mean_word_length': 3.2551867219917012, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '3918625', 'n_tokens_mistral': 877, 'n_tokens_neox': 836, 'n_words': 220}