Skip to content

Commit

Permalink
Add tap reporter to test targets
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Dec 12, 2014
1 parent cf54cd8 commit a6b58f4
Show file tree
Hide file tree
Showing 6 changed files with 711 additions and 17 deletions.
46 changes: 31 additions & 15 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -81,32 +81,48 @@ nodist_EXTRA_sassc_bin_SOURCES = non-existent-file-to-force-CXX-linking.cxx
nodist_EXTRA_libsass_la_SOURCES = non-existent-file-to-force-CXX-linking.cxx
endif

TESTS = \
$(SASS_SPEC_PATH)/spec/basic \
$(SASS_SPEC_PATH)/spec/benchmarks \
$(SASS_SPEC_PATH)/spec/bourbon \
$(SASS_SPEC_PATH)/spec/libsass \
$(SASS_SPEC_PATH)/spec/scss \
$(SASS_SPEC_PATH)/spec/todo

LOG_COMPILER = $(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb
AM_LOG_FLAGS = -c ./sass-tester

SASS_SASSC_PATH ?= sassc
SASS_SPEC_PATH ?= sass-spec
SASSC_BIN = $(SASS_SASSC_PATH)/bin/sassc
RUBY_BIN = ruby

TESTS = $(SASS_SPEC_PATH)/spec/basic \
$(SASS_SPEC_PATH)/spec/css \
$(SASS_SPEC_PATH)/spec/extend-tests \
$(SASS_SPEC_PATH)/spec/extends \
$(SASS_SPEC_PATH)/spec/libsass \
$(SASS_SPEC_PATH)/spec/libsass-closed-issues \
$(SASS_SPEC_PATH)/spec/maps \
$(SASS_SPEC_PATH)/spec/misc \
$(SASS_SPEC_PATH)/spec/regressions \
$(SASS_SPEC_PATH)/spec/scss \
$(SASS_SPEC_PATH)/spec/scss-tests \
$(SASS_SPEC_PATH)/spec/types

SASS_TEST_FLAGS =
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) ./scripts/tap-driver
AM_LOG_FLAGS = -c ./sassc_bin --ignore-todo $(LOG_FLAGS)
if USE_TAP
AM_LOG_FLAGS += -t
SASS_TEST_FLAGS += -t | tapout
# route everything throught the tap runner to produce tap output
LOG_COMPILER = ./scripts/tap-runner $(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb
else
LOG_COMPILER = $(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb
endif

$(SASSC_BIN): libsass.la
cd $(SASS_SASSC_PATH) && $(MAKE)

test: $(SASSC_BIN)
$(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) -s $(LOG_FLAGS) $(SASS_SPEC_PATH)
$(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) --ignore-todo $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)

test_build: $(SASSC_BIN)
$(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) -s --ignore-todo $(LOG_FLAGS) $(SASS_SPEC_PATH)
$(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) --ignore-todo $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)

test_full: $(SASSC_BIN)
$(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) $(LOG_FLAGS) $(SASS_SPEC_PATH) $(SASS_TEST_FLAGS)

test_issues: $(SASSC_BIN)
$(RUBY_BIN) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) $(LOG_FLAGS) $(SASS_SPEC_PATH)/spec/issues
$(RUBY) $(SASS_SPEC_PATH)/sass-spec.rb -c $(SASSC_BIN) $(LOG_FLAGS) $(SASS_SPEC_PATH)/spec/issues $(SASS_TEST_FLAGS)

endif
21 changes: 19 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ AC_INIT([libsass], [1.0], [support@moovweb.com])
AC_CONFIG_SRCDIR([ast.hpp])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.10 foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_AUX_DIR([script])
AM_INIT_AUTOMAKE([1.10 foreign parallel-tests])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
LT_INIT

# Checks for programs.
Expand All @@ -32,7 +33,11 @@ AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests], [enable testing the build]
if test "x$enable_tests" = "xyes"; then
AC_PROG_CC
AC_PROG_AWK
# test need minitest gem
AC_PATH_PROG(RUBY, [ruby])
AC_PATH_PROG(TAPOUT, [tapout])
AC_REQUIRE_AUX_FILE([tap-driver])
AC_REQUIRE_AUX_FILE([tap-runner])
AC_ARG_WITH(sassc-dir,
AS_HELP_STRING([--with-sassc-dir=<dir>], [specify directory of sassc sources for testing (default: sassc)]),
[sassc_dir="$withval"], [sassc_dir="sassc"])
Expand Down Expand Up @@ -64,9 +69,21 @@ the --with-sass-spec-dir=<dir> argument.
;;
esac
AC_SUBST(SASS_SPEC_PATH)

# TODO: Remove this when automake requirements are 1.12+
AC_MSG_CHECKING([whether we can use TAP mode])
tmp=`$AWK '/TEST_LOG_DRIVER/' $srcdir/Makefile.in`
if test "x$tmp" != "x"; then
use_tap=yes
else
use_tap=no
fi
AC_MSG_RESULT([$use_tap])

fi

AM_CONDITIONAL(ENABLE_TESTS, test "x$enable_tests" = "xyes")
AM_CONDITIONAL(USE_TAP, test "x$use_tap" = "xyes")

AC_ARG_ENABLE([coverage],
[AS_HELP_STRING([--enable-coverage],
Expand Down
1 change: 1 addition & 0 deletions script/ci-install-compiler
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash

gem install minitest
gem install minitap
7 changes: 7 additions & 0 deletions script/ci-install-deps
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ if [ "x$COVERAGE" == "xyes" ]; then
else
echo "no dependencies to install"
fi

if [ "x$AUTOTOOLS" == "xyes" ]; then
sudo add-apt-repository -y ppa:rbose-debianizer/automake &> /dev/null
sudo apt-get -qq update
sudo apt-get -qq install automake
AUTOTOOLS=yes
fi
Loading

0 comments on commit a6b58f4

Please sign in to comment.