Sha256: 29207f283d1b86bbfb12080f98e955c792a68f8be88344285eee70c93b64914a

Contents?: true

Size: 1.85 KB

Versions: 153

Compression:

Stored size: 1.85 KB

Contents

EXERCISE ?= ""
IGNOREDIRS := "^(\.git|.crystal|docs|bin|img|script)$$"
EXERCISESDIR ?= "exercises"
EXERCISES = $(shell find exercises -maxdepth 1 -mindepth 1 -type d | cut -d'/' -f2 | sort | grep -Ev $(IGNOREDIRS))

FILEEXT = "cr"
SPECDIR = "spec"
EXERCISENAME := "$(subst -,_,$(EXERCISE))"
EXERCISESPECDIR := $(EXERCISESDIR)/$(EXERCISE)/$(SPECDIR)
SPECFILE := "$(EXERCISENAME)_spec.$(FILEEXT)"
SUPERSPECFILE := "$(SPECFILE).super"
TMPSPECFILE := "$(SPECFILE).tmp"

GENERATORDIR ?= "generator"
GENERATORSDIR := $(GENERATORDIR)/src/generators
GENERATORS = $(shell find $(GENERATORSDIR) -type f | cut -d '/' -f 4 | cut -d '.' -f 1 | sed 's/_/-/g')

test-exercise:
	@echo "running formatting check for: $(EXERCISE)"
	@crystal tool format --check $(EXERCISESDIR)/$(EXERCISE)
	@echo "moving files around"
	@sed 's/pending/it/g' $(EXERCISESPECDIR)/$(SPECFILE) > $(EXERCISESPECDIR)/$(TMPSPECFILE)
	@mv $(EXERCISESPECDIR)/$(SPECFILE) $(EXERCISESPECDIR)/$(SUPERSPECFILE)
	@mv $(EXERCISESPECDIR)/$(TMPSPECFILE) $(EXERCISESPECDIR)/$(SPECFILE)
	@echo "running tests for: $(EXERCISE)"
	@cd $(EXERCISESDIR)/$(EXERCISE) && crystal spec
	@rm $(EXERCISESPECDIR)/$(SPECFILE)
	@mv $(EXERCISESPECDIR)/$(SUPERSPECFILE) $(EXERCISESPECDIR)/$(SPECFILE)
	@printf "\n"

test-exercises:
	@for exercise in $(EXERCISES); do EXERCISE=$$exercise $(MAKE) -s test-exercise || exit 1; done

build-generator:
	@crystal build $(GENERATORDIR)/generator.$(FILEEXT) -o generator/bin/generator

generate-exercise:
	@echo "generating spec file for generator: $(GENERATOR)"
	@generator/bin/generator $(GENERATOR)

generate-exercises:
	@for generator in $(GENERATORS); do GENERATOR=$$generator $(MAKE) -s generate-exercise || exit 1; done

test-generator:
	@echo "running generator tests"
	@cd $(GENERATORDIR) && crystal deps && crystal spec

test:
	@echo "running all the tests"
	@$(MAKE) -s test-exercises
	@$(MAKE) -s test-generator

Version data entries

153 entries across 153 versions & 1 rubygems

Version Path
trackler-2.2.1.63 tracks/crystal/Makefile
trackler-2.2.1.62 tracks/crystal/Makefile
trackler-2.2.1.61 tracks/crystal/Makefile
trackler-2.2.1.60 tracks/crystal/Makefile
trackler-2.2.1.59 tracks/crystal/Makefile
trackler-2.2.1.58 tracks/crystal/Makefile
trackler-2.2.1.57 tracks/crystal/Makefile
trackler-2.2.1.56 tracks/crystal/Makefile
trackler-2.2.1.55 tracks/crystal/Makefile
trackler-2.2.1.54 tracks/crystal/Makefile
trackler-2.2.1.53 tracks/crystal/Makefile
trackler-2.2.1.52 tracks/crystal/Makefile
trackler-2.2.1.51 tracks/crystal/Makefile
trackler-2.2.1.50 tracks/crystal/Makefile
trackler-2.2.1.49 tracks/crystal/Makefile
trackler-2.2.1.48 tracks/crystal/Makefile
trackler-2.2.1.47 tracks/crystal/Makefile
trackler-2.2.1.46 tracks/crystal/Makefile
trackler-2.2.1.45 tracks/crystal/Makefile
trackler-2.2.1.44 tracks/crystal/Makefile