Sha256: 8b5d6d0f690019090947c035ca31f6bd9d00c53b1666f424932f9051f3355c21

Contents?: true

Size: 1.5 KB

Versions: 22

Compression:

Stored size: 1.5 KB

Contents

# assignments
ASSIGNMENT ?= ""
IGNOREDIRS := "^(\.git|bin|docs|exercises)$$"
ASSIGNMENTS = $(shell find ./exercises -maxdepth 1 -mindepth 1 -type d | awk -F/ '{print $$NF}' | sort | grep -Ev $(IGNOREDIRS))

# output directories
TMPDIR ?= "/tmp"
OUTDIR := $(shell mktemp -d "$(TMPDIR)/$(ASSIGNMENT).XXXXXXXXXX")

# language specific config (tweakable per language)
FILEEXT := "php"
EXAMPLE := "example.$(FILEEXT)"
TSTFILE := "$(ASSIGNMENT)_test.$(FILEEXT)"

# development dependencies
bin/phpunit.phar:
	@wget --no-check-certificate https://phar.phpunit.de/phpunit.phar -O $@
	chmod +x $@

bin/phpcs.phar:
	@wget --no-check-certificate https://github.com/squizlabs/PHP_CodeSniffer/releases/download/2.0.0a2/phpcs.phar -O $@
	chmod +x $@

# single test
test-assignment: bin/phpunit.phar
	@echo "running tests for: $(ASSIGNMENT)"
	@cat ./exercises/$(ASSIGNMENT)/$(TSTFILE) | sed '/markTestSkipped()/d' > $(OUTDIR)/$(TSTFILE)
	@cp ./exercises/$(ASSIGNMENT)/$(EXAMPLE) $(OUTDIR)/$(ASSIGNMENT).$(FILEEXT)
	@bin/phpunit.phar --no-configuration $(OUTDIR)/$(TSTFILE)

# all tests
test:
	@for assignment in $(ASSIGNMENTS); do ASSIGNMENT=$$assignment $(MAKE) -s test-assignment || exit 1; done

# style check single test
style-check-assignment: bin/phpcs.phar
	@echo "checking $(ASSIGNMENT) against xPHP code standards"
	@bin/phpcs.phar -sp --standard=phpcs-xphp.xml ./exercises/$(ASSIGNMENT)

# style c heck all tests
style-check:
	@for assignment in $(ASSIGNMENTS); do ASSIGNMENT=$$assignment $(MAKE) -s style-check-assignment || exit 1; done

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
trackler-2.0.1.0 tracks/php/Makefile
trackler-2.0.0.10 tracks/php/Makefile
trackler-2.0.0.9 tracks/php/Makefile
trackler-2.0.0.8 tracks/php/Makefile
trackler-2.0.0.7 tracks/php/Makefile
trackler-2.0.0.6 tracks/php/Makefile
trackler-2.0.0.5 tracks/php/Makefile
trackler-2.0.0.4 tracks/php/Makefile
trackler-2.0.0.3 tracks/php/Makefile
trackler-2.0.0.2 tracks/php/Makefile
trackler-2.0.0.1 tracks/php/Makefile
trackler-2.0.0.0 tracks/php/Makefile
trackler-1.0.4.1 tracks/php/Makefile
trackler-1.0.4.0 tracks/php/Makefile
trackler-1.0.3.0 tracks/php/Makefile
trackler-1.0.2.1 tracks/php/Makefile
trackler-1.0.2.0 tracks/php/Makefile
trackler-1.0.1.2 tracks/php/Makefile
trackler-1.0.1.1 tracks/php/Makefile
trackler-1.0.1.0 tracks/php/Makefile