Sha256: 30ac00408fb58dfd7918734315148295fd1e242d382eebbcc0056f586802cac4

Contents?: true

Size: 1.32 KB

Versions: 20

Compression:

Stored size: 1.32 KB

Contents

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

# output directories
OUTDIR ?= "exercises/$(ASSIGNMENT)/tmp"

# language specific config (tweakable per language)
FILEEXT := "js"
EXAMPLE := "example.$(FILEEXT)"
TSTFILE := "$(subst _,-,$(ASSIGNMENT)).spec.$(FILEEXT)"

# package.json MD5 hash
SOURCE_PKG_MD5 ?= "`./bin/md5-hash ./package.json`"
PKG_FILES= $(shell find ./exercises/*/* -maxdepth 1 -name package.json)

test-package-files:
	@for pkg in $(PKG_FILES); do \
		! ./bin/md5-hash $$pkg | grep -qv $(SOURCE_PKG_MD5) || { echo "$$pkg does not match main package.json"; exit 1; }; \
	done

test-assignment:
	@cp package.json exercises/$(ASSIGNMENT)
	@echo "running tests for: $(ASSIGNMENT)"
	@mkdir -p $(OUTDIR)
	@cp exercises/grains/lib/big-integer.$(FILEEXT) $(OUTDIR)
	@cp exercises/$(ASSIGNMENT)/$(TSTFILE) $(OUTDIR)
	@cp exercises/$(ASSIGNMENT)/$(EXAMPLE) $(OUTDIR)/$(subst _,-,$(ASSIGNMENT)).$(FILEEXT)
	@sed 's/xtest/test/g' exercises/$(ASSIGNMENT)/$(TSTFILE) > $(OUTDIR)/temp.$(TSTFILE)
	@node_modules/.bin/jest $(OUTDIR)/temp.*.spec.js
	@rm $(OUTDIR)/*
	@rmdir $(OUTDIR)

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
trackler-2.2.1.10 tracks/ecmascript/Makefile
trackler-2.2.1.9 tracks/ecmascript/Makefile
trackler-2.2.1.8 tracks/ecmascript/Makefile
trackler-2.2.1.7 tracks/ecmascript/Makefile
trackler-2.2.1.6 tracks/ecmascript/Makefile
trackler-2.2.1.5 tracks/ecmascript/Makefile
trackler-2.2.1.4 tracks/ecmascript/Makefile
trackler-2.2.1.3 tracks/ecmascript/Makefile
trackler-2.2.1.2 tracks/ecmascript/Makefile
trackler-2.2.1.1 tracks/ecmascript/Makefile
trackler-2.2.1.0 tracks/ecmascript/Makefile
trackler-2.2.0.6 tracks/ecmascript/Makefile
trackler-2.2.0.5 tracks/ecmascript/Makefile
trackler-2.2.0.4 tracks/ecmascript/Makefile
trackler-2.2.0.3 tracks/ecmascript/Makefile
trackler-2.2.0.2 tracks/ecmascript/Makefile
trackler-2.2.0.1 tracks/ecmascript/Makefile
trackler-2.2.0.0 tracks/ecmascript/Makefile
trackler-2.1.0.55 tracks/ecmascript/Makefile
trackler-2.1.0.54 tracks/ecmascript/Makefile