make2tap is in your path (using
npm scripts), simply pipe
make output to it
Assuming this is your
clean: ## Clean # remove /dist @rm -rf dist build: ## Build js files # compile to js @echo 'compile output...' # minify @echo 'minify output...'
make clean compile 2>&1 | make2tap
2>&1 is quite important here, it allows
make stderr stream to be piped to
make2tap as well so we can handle errors.
TAP version 13 # Clean ok 1 - remove /dist TAP version 13 # Build js files ok 2 - compile to js compile output... ok 3 - minify minify output... 1..3
Of course, you should pipe it to the TAP reporter of your choice:
make clean build | make2tap | tap-spec
make2tap understand a few kinds of lines:
## Task title: as a TAP Diagnostic, aka a section, or title
# Step name: as a TAP test line, which will use a single step
anything else: as regular output, not handled as part of the result but still shown, will us it to show commands output.
You'll probably want to structure your makefile as such:
build: ## Build js files # compile to js @echo 'compile output...' # minify @echo 'minify output...'