Sha256: 24cb9aac59ec460fa36abb2294c371e1cf384560c7b89fa7b8762461f6db3c94

Contents?: true

Size: 1.07 KB

Versions: 14

Compression:

Stored size: 1.07 KB

Contents

# assignments
ASSIGNMENT ?= ""
IGNOREDIRS := "^(\.git|docs)$$"
EXERCISESDIR ?= "exercises"
ASSIGNMENTS = $(shell find exercises -maxdepth 1 -mindepth 1 -type d | cut -d'/' -f2 | sort | grep -Ev $(IGNOREDIRS))

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

# language specific config (tweakable per language)
FILEEXT := "cr"
EXAMPLE := "example.$(FILEEXT)"
TESTNAME := "$(subst -,_,$(ASSIGNMENT))"
SPECFILE := "$(TESTNAME)_spec.$(FILEEXT)"
TESTFILE := "$(TESTNAME).$(FILEEXT)"

test-assignment:
	@echo "running formatting check for: $(ASSIGNMENT)"
	@crystal tool format --check $(EXERCISESDIR)/$(ASSIGNMENT)
	@echo "running tests for: $(ASSIGNMENT)"
	@cp $(EXERCISESDIR)/$(ASSIGNMENT)/$(SPECFILE) $(OUTDIR)
	@cp $(EXERCISESDIR)/$(ASSIGNMENT)/$(EXAMPLE) $(OUTDIR)/$(TESTFILE)
	@sed 's/pending/it/g' $(EXERCISESDIR)/$(ASSIGNMENT)/$(SPECFILE) > $(OUTDIR)/$(SPECFILE)
	@cd $(OUTDIR) && crystal spec $(SPECFILE)
	@printf "\n"

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
trackler-2.0.0.3 tracks/crystal/Makefile
trackler-2.0.0.2 tracks/crystal/Makefile
trackler-2.0.0.1 tracks/crystal/Makefile
trackler-2.0.0.0 tracks/crystal/Makefile
trackler-1.0.4.1 tracks/crystal/Makefile
trackler-1.0.4.0 tracks/crystal/Makefile
trackler-1.0.3.0 tracks/crystal/Makefile
trackler-1.0.2.1 tracks/crystal/Makefile
trackler-1.0.2.0 tracks/crystal/Makefile
trackler-1.0.1.2 tracks/crystal/Makefile
trackler-1.0.1.1 tracks/crystal/Makefile
trackler-1.0.1.0 tracks/crystal/Makefile
trackler-1.0.0.1 tracks/crystal/Makefile
trackler-1.0.0 tracks/crystal/Makefile