Commit a1651414 authored by Hunter Loftis's avatar Hunter Loftis

test and implementation for more robust output formatting

parent caf4d3c9
......@@ -2,16 +2,19 @@ info() {
echo " $*"
}
# sed has a problem with the huge build output from npm 3
# try awk? awk '{ print " " $0 }'
# format output on both OSX and Ubuntu, cedar-10 and cedar-14, while also splitting to a log file
output() {
local logfile="$1"
local c='s/^/ /'
if [ "${STACK:-cedar-14}" = "cedar" ]; then
tee -a "$logfile" | awk -W interactive '{ print " " $0 }'
else
case $(uname) in
Darwin) tee -a "$logfile" | awk '{ print " " $0 }';;
*) tee -a "$logfile" | awk -W interactive '{ print " " $0 }';;
Darwin) sed -l "$c" | tee -i -a "$logfile" 2> /dev/null;;
*) stdbuf -oL -eL sed -u "$c" | tee -i -a "$logfile" 2> /dev/null;;
esac
fi
}
header() {
......
......@@ -2,12 +2,12 @@ test: test-cedar-14 test-cedar-10
test-cedar-14:
@echo "Running tests in docker (cedar-14)..."
@docker run -v $(shell pwd):/buildpack:ro --rm -it heroku/cedar:14 bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run;'
@docker run -v $(shell pwd):/buildpack:ro --rm -it -e "STACK=cedar-14" heroku/cedar:14 bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run;'
@echo ""
test-cedar-10:
@echo "Running tests in docker (cedar)..."
@docker run -v $(shell pwd):/buildpack:ro --rm -it fabiokung/cedar bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run;'
@docker run -v $(shell pwd):/buildpack:ro --rm -it -e "STACK=cedar" fabiokung/cedar bash -c 'cp -r /buildpack /buildpack_test; cd /buildpack_test/; test/run;'
shell:
@echo "Opening cedar-14 shell..."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment