Skip to content

Commit ea0b30d

Browse files
committed
Refactor Makefile and specs to allow running a narrow spec target.
1 parent 00d1f5d commit ea0b30d

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

Makefile

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@ test: PHONY
1313
docker exec -ti mare-dev make extra_args="$(extra_args)" test.inner
1414
/tmp/bin/spec: $(shell find src -name '*.cr') $(shell find spec -name '*.cr')
1515
mkdir -p /tmp/bin
16-
crystal build --debug spec/spec_helper.cr -o $@
16+
crystal build --debug spec/all.cr -o $@
1717
test.inner: PHONY /tmp/bin/spec
1818
echo && /tmp/bin/spec $(extra_args)
1919

20+
# Run a narrow target within the test suite.
21+
test.narrow: PHONY
22+
docker exec -ti mare-dev make target="$(target)" test.narrow.inner
23+
test.narrow.inner: PHONY
24+
crystal spec spec/spec_helper.cr "$(target)"
25+
2026
# Evaluate a Hello World example.
2127
example-eval: PHONY
2228
docker exec -ti mare-dev make extra_args="$(extra_args)" example-eval.inner

spec/all.cr

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require "./**"

spec/spec_helper.cr

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
require "spec"
22
require "../src/mare"
3-
require "./**"
43

54
module Spec::Methods
65
def fixture(*parts)

0 commit comments

Comments
 (0)