bf5b5ff
From 418ef87bda575be30e9f1c06615a0406ea4adc16 Mon Sep 17 00:00:00 2001
9859a2c
From: Peter Lemenkov <lemenkov@gmail.com>
9859a2c
Date: Thu, 27 May 2010 15:22:37 +0400
bf5b5ff
Subject: [PATCH 4/9] Remove bundled erlang-etap library
9859a2c
9859a2c
---
fc422f3
 configure                     |    3 -
fc422f3
 configure.ac                  |    1 -
fc422f3
 src/Makefile.am               |    2 +-
fc422f3
 src/Makefile.in               |    2 +-
fc422f3
 src/etap/Makefile.am          |   44 ----
fc422f3
 src/etap/Makefile.in          |  467 -----------------------------------------
fc422f3
 src/etap/etap.erl             |  416 ------------------------------------
fc422f3
 src/etap/etap_application.erl |   72 -------
fc422f3
 src/etap/etap_can.erl         |   79 -------
fc422f3
 src/etap/etap_exception.erl   |   66 ------
fc422f3
 src/etap/etap_process.erl     |   42 ----
fc422f3
 src/etap/etap_report.erl      |  343 ------------------------------
fc422f3
 src/etap/etap_request.erl     |   89 --------
fc422f3
 src/etap/etap_string.erl      |   47 ----
fc422f3
 src/etap/etap_web.erl         |   65 ------
fc422f3
 test/etap/test_util.erl.in    |    2 +-
fc422f3
 16 files changed, 3 insertions(+), 1737 deletions(-)
fc422f3
 delete mode 100644 src/etap/Makefile.am
fc422f3
 delete mode 100644 src/etap/Makefile.in
fc422f3
 delete mode 100644 src/etap/etap.erl
fc422f3
 delete mode 100644 src/etap/etap_application.erl
fc422f3
 delete mode 100644 src/etap/etap_can.erl
fc422f3
 delete mode 100644 src/etap/etap_exception.erl
fc422f3
 delete mode 100644 src/etap/etap_process.erl
fc422f3
 delete mode 100644 src/etap/etap_report.erl
fc422f3
 delete mode 100644 src/etap/etap_request.erl
fc422f3
 delete mode 100644 src/etap/etap_string.erl
fc422f3
 delete mode 100644 src/etap/etap_web.erl
9859a2c
9859a2c
diff --git a/configure b/configure
9859a2c
index 39dda91..ca7732f 100755
9859a2c
--- a/configure
9859a2c
+++ b/configure
9859a2c
@@ -12137,8 +12137,6 @@ ac_config_files="$ac_config_files src/couchdb/Makefile"
9859a2c
 
9859a2c
 ac_config_files="$ac_config_files src/couchdb/priv/Makefile"
9859a2c
 
9859a2c
-ac_config_files="$ac_config_files src/etap/Makefile"
9859a2c
-
9859a2c
 ac_config_files="$ac_config_files src/ibrowse/Makefile"
9859a2c
 
9859a2c
 ac_config_files="$ac_config_files src/mochiweb/Makefile"
9859a2c
@@ -13158,7 +13156,6 @@ do
9859a2c
     "src/couchdb/couch.app.tpl") CONFIG_FILES="$CONFIG_FILES src/couchdb/couch.app.tpl" ;;
9859a2c
     "src/couchdb/Makefile") CONFIG_FILES="$CONFIG_FILES src/couchdb/Makefile" ;;
9859a2c
     "src/couchdb/priv/Makefile") CONFIG_FILES="$CONFIG_FILES src/couchdb/priv/Makefile" ;;
9859a2c
-    "src/etap/Makefile") CONFIG_FILES="$CONFIG_FILES src/etap/Makefile" ;;
9859a2c
     "src/ibrowse/Makefile") CONFIG_FILES="$CONFIG_FILES src/ibrowse/Makefile" ;;
9859a2c
     "src/mochiweb/Makefile") CONFIG_FILES="$CONFIG_FILES src/mochiweb/Makefile" ;;
9859a2c
     "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
9859a2c
diff --git a/configure.ac b/configure.ac
9859a2c
index effb28b..0478b4f 100644
9859a2c
--- a/configure.ac
9859a2c
+++ b/configure.ac
9859a2c
@@ -335,7 +335,6 @@ AC_CONFIG_FILES([src/Makefile])
9859a2c
 AC_CONFIG_FILES([src/couchdb/couch.app.tpl])
9859a2c
 AC_CONFIG_FILES([src/couchdb/Makefile])
9859a2c
 AC_CONFIG_FILES([src/couchdb/priv/Makefile])
9859a2c
-AC_CONFIG_FILES([src/etap/Makefile])
9859a2c
 AC_CONFIG_FILES([src/ibrowse/Makefile])
9859a2c
 AC_CONFIG_FILES([src/mochiweb/Makefile])
9859a2c
 AC_CONFIG_FILES([test/Makefile])
9859a2c
diff --git a/src/Makefile.am b/src/Makefile.am
9859a2c
index e577138..19a5d20 100644
9859a2c
--- a/src/Makefile.am
9859a2c
+++ b/src/Makefile.am
9859a2c
@@ -10,4 +10,4 @@
9859a2c
 ## License for the specific language governing permissions and limitations under
9859a2c
 ## the License.
9859a2c
 
9859a2c
-SUBDIRS = couchdb etap ibrowse mochiweb
9859a2c
+SUBDIRS = couchdb ibrowse mochiweb
9859a2c
diff --git a/src/Makefile.in b/src/Makefile.in
9859a2c
index 480da98..2422e39 100644
9859a2c
--- a/src/Makefile.in
9859a2c
+++ b/src/Makefile.in
9859a2c
@@ -239,7 +239,7 @@ version_minor = @version_minor@
9859a2c
 version_release = @version_release@
9859a2c
 version_revision = @version_revision@
9859a2c
 version_stage = @version_stage@
9859a2c
-SUBDIRS = couchdb etap ibrowse mochiweb
9859a2c
+SUBDIRS = couchdb ibrowse mochiweb
9859a2c
 all: all-recursive
9859a2c
 
9859a2c
 .SUFFIXES:
fc422f3
diff --git a/src/etap/Makefile.am b/src/etap/Makefile.am
fc422f3
deleted file mode 100644
fc422f3
index 732347b..0000000
fc422f3
--- a/src/etap/Makefile.am
fc422f3
+++ /dev/null
fc422f3
@@ -1,44 +0,0 @@
fc422f3
-## Licensed under the Apache License, Version 2.0 (the "License"); you may not
fc422f3
-## use this file except in compliance with the License.  You may obtain a copy
fc422f3
-## of the License at
fc422f3
-##
fc422f3
-##   http://www.apache.org/licenses/LICENSE-2.0
fc422f3
-##
fc422f3
-## Unless required by applicable law or agreed to in writing, software
fc422f3
-## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
fc422f3
-## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
fc422f3
-## License for the specific language governing permissions and limitations under
fc422f3
-## the License.
fc422f3
-
fc422f3
-etapebindir = $(localerlanglibdir)/etap/ebin
fc422f3
-
fc422f3
-etap_file_collection = \
fc422f3
-    etap.erl \
fc422f3
-   	etap_application.erl \
fc422f3
-    etap_can.erl \
fc422f3
-    etap_exception.erl \
fc422f3
-    etap_process.erl \
fc422f3
-	etap_report.erl \
fc422f3
-	etap_request.erl \
fc422f3
-	etap_string.erl \
fc422f3
-   	etap_web.erl
fc422f3
-
fc422f3
-etapebin_make_generated_file_list = \
fc422f3
-    etap.beam \
fc422f3
-   	etap_application.beam \
fc422f3
-    etap_can.beam \
fc422f3
-    etap_exception.beam \
fc422f3
-    etap_process.beam \
fc422f3
-	etap_report.beam \
fc422f3
-	etap_request.beam \
fc422f3
-	etap_string.beam \
fc422f3
-   	etap_web.beam
fc422f3
-
fc422f3
-etapebin_DATA = $(etapebin_make_generated_file_list)
fc422f3
-
fc422f3
-EXTRA_DIST =  $(etap_file_collection)
fc422f3
-
fc422f3
-CLEANFILES = $(etapebin_make_generated_file_list)
fc422f3
-
fc422f3
-%.beam: %.erl
fc422f3
-	$(ERLC) $(ERLC_FLAGS) $<
fc422f3
diff --git a/src/etap/Makefile.in b/src/etap/Makefile.in
fc422f3
deleted file mode 100644
fc422f3
index 2c752b3..0000000
fc422f3
--- a/src/etap/Makefile.in
fc422f3
+++ /dev/null
fc422f3
@@ -1,467 +0,0 @@
fc422f3
-# Makefile.in generated by automake 1.11 from Makefile.am.
fc422f3
-# @configure_input@
fc422f3
-
fc422f3
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
fc422f3
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
fc422f3
-# Inc.
fc422f3
-# This Makefile.in is free software; the Free Software Foundation
fc422f3
-# gives unlimited permission to copy and/or distribute it,
fc422f3
-# with or without modifications, as long as this notice is preserved.
fc422f3
-
fc422f3
-# This program is distributed in the hope that it will be useful,
fc422f3
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
fc422f3
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
fc422f3
-# PARTICULAR PURPOSE.
fc422f3
-
fc422f3
-@SET_MAKE@
fc422f3
-
fc422f3
-VPATH = @srcdir@
fc422f3
-pkgdatadir = $(datadir)/@PACKAGE@
fc422f3
-pkgincludedir = $(includedir)/@PACKAGE@
fc422f3
-pkglibdir = $(libdir)/@PACKAGE@
fc422f3
-pkglibexecdir = $(libexecdir)/@PACKAGE@
fc422f3
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
fc422f3
-install_sh_DATA = $(install_sh) -c -m 644
fc422f3
-install_sh_PROGRAM = $(install_sh) -c
fc422f3
-install_sh_SCRIPT = $(install_sh) -c
fc422f3
-INSTALL_HEADER = $(INSTALL_DATA)
fc422f3
-transform = $(program_transform_name)
fc422f3
-NORMAL_INSTALL = :
fc422f3
-PRE_INSTALL = :
fc422f3
-POST_INSTALL = :
fc422f3
-NORMAL_UNINSTALL = :
fc422f3
-PRE_UNINSTALL = :
fc422f3
-POST_UNINSTALL = :
fc422f3
-build_triplet = @build@
fc422f3
-host_triplet = @host@
fc422f3
-subdir = src/etap
fc422f3
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
fc422f3
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
fc422f3
-am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_curl.m4 \
fc422f3
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/m4/ac_check_icu.m4 \
fc422f3
-	$(top_srcdir)/configure.ac
fc422f3
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
fc422f3
-	$(ACLOCAL_M4)
fc422f3
-mkinstalldirs = $(install_sh) -d
fc422f3
-CONFIG_HEADER = $(top_builddir)/config.h
fc422f3
-CONFIG_CLEAN_FILES =
fc422f3
-CONFIG_CLEAN_VPATH_FILES =
fc422f3
-SOURCES =
fc422f3
-DIST_SOURCES =
fc422f3
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
fc422f3
-am__vpath_adj = case $$p in \
fc422f3
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
fc422f3
-    *) f=$$p;; \
fc422f3
-  esac;
fc422f3
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
fc422f3
-am__install_max = 40
fc422f3
-am__nobase_strip_setup = \
fc422f3
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
fc422f3
-am__nobase_strip = \
fc422f3
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
fc422f3
-am__nobase_list = $(am__nobase_strip_setup); \
fc422f3
-  for p in $$list; do echo "$$p $$p"; done | \
fc422f3
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
fc422f3
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
fc422f3
-    if (++n[$$2] == $(am__install_max)) \
fc422f3
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
fc422f3
-    END { for (dir in files) print dir, files[dir] }'
fc422f3
-am__base_list = \
fc422f3
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
fc422f3
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
fc422f3
-am__installdirs = "$(DESTDIR)$(etapebindir)"
fc422f3
-DATA = $(etapebin_DATA)
fc422f3
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
fc422f3
-ACLOCAL = @ACLOCAL@
fc422f3
-AMTAR = @AMTAR@
fc422f3
-AR = @AR@
fc422f3
-AUTOCONF = @AUTOCONF@
fc422f3
-AUTOHEADER = @AUTOHEADER@
fc422f3
-AUTOMAKE = @AUTOMAKE@
fc422f3
-AWK = @AWK@
fc422f3
-CC = @CC@
fc422f3
-CCDEPMODE = @CCDEPMODE@
fc422f3
-CFLAGS = @CFLAGS@
fc422f3
-CPP = @CPP@
fc422f3
-CPPFLAGS = @CPPFLAGS@
fc422f3
-CURL_CFLAGS = @CURL_CFLAGS@
fc422f3
-CURL_CONFIG = @CURL_CONFIG@
fc422f3
-CURL_LDFLAGS = @CURL_LDFLAGS@
fc422f3
-CURL_LIBS = @CURL_LIBS@
fc422f3
-CYGPATH_W = @CYGPATH_W@
fc422f3
-DEFS = @DEFS@
fc422f3
-DEPDIR = @DEPDIR@
fc422f3
-DSYMUTIL = @DSYMUTIL@
fc422f3
-DUMPBIN = @DUMPBIN@
fc422f3
-ECHO_C = @ECHO_C@
fc422f3
-ECHO_N = @ECHO_N@
fc422f3
-ECHO_T = @ECHO_T@
fc422f3
-EGREP = @EGREP@
fc422f3
-ERL = @ERL@
fc422f3
-ERLC = @ERLC@
fc422f3
-ERLC_FLAGS = @ERLC_FLAGS@
fc422f3
-EXEEXT = @EXEEXT@
fc422f3
-FGREP = @FGREP@
fc422f3
-FLAGS = @FLAGS@
fc422f3
-GREP = @GREP@
fc422f3
-HELP2MAN_EXECUTABLE = @HELP2MAN_EXECUTABLE@
fc422f3
-ICU_CFLAGS = @ICU_CFLAGS@
fc422f3
-ICU_CONFIG = @ICU_CONFIG@
fc422f3
-ICU_CXXFLAGS = @ICU_CXXFLAGS@
fc422f3
-ICU_LIBS = @ICU_LIBS@
fc422f3
-ICU_LOCAL_BIN = @ICU_LOCAL_BIN@
fc422f3
-ICU_LOCAL_CFLAGS = @ICU_LOCAL_CFLAGS@
fc422f3
-ICU_LOCAL_LDFLAGS = @ICU_LOCAL_LDFLAGS@
fc422f3
-INSTALL = @INSTALL@
fc422f3
-INSTALL_DATA = @INSTALL_DATA@
fc422f3
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
fc422f3
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
fc422f3
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
fc422f3
-JSLIB = @JSLIB@
fc422f3
-LD = @LD@
fc422f3
-LDFLAGS = @LDFLAGS@
fc422f3
-LIBOBJS = @LIBOBJS@
fc422f3
-LIBS = @LIBS@
fc422f3
-LIBTOOL = @LIBTOOL@
fc422f3
-LIPO = @LIPO@
fc422f3
-LN_S = @LN_S@
fc422f3
-LTLIBOBJS = @LTLIBOBJS@
fc422f3
-MAKEINFO = @MAKEINFO@
fc422f3
-MKDIR_P = @MKDIR_P@
fc422f3
-NM = @NM@
fc422f3
-NMEDIT = @NMEDIT@
fc422f3
-OBJDUMP = @OBJDUMP@
fc422f3
-OBJEXT = @OBJEXT@
fc422f3
-OTOOL = @OTOOL@
fc422f3
-OTOOL64 = @OTOOL64@
fc422f3
-PACKAGE = @PACKAGE@
fc422f3
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
fc422f3
-PACKAGE_NAME = @PACKAGE_NAME@
fc422f3
-PACKAGE_STRING = @PACKAGE_STRING@
fc422f3
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
fc422f3
-PACKAGE_URL = @PACKAGE_URL@
fc422f3
-PACKAGE_VERSION = @PACKAGE_VERSION@
fc422f3
-PATH_SEPARATOR = @PATH_SEPARATOR@
fc422f3
-RANLIB = @RANLIB@
fc422f3
-SED = @SED@
fc422f3
-SET_MAKE = @SET_MAKE@
fc422f3
-SHELL = @SHELL@
fc422f3
-STRIP = @STRIP@
fc422f3
-VERSION = @VERSION@
fc422f3
-abs_builddir = @abs_builddir@
fc422f3
-abs_srcdir = @abs_srcdir@
fc422f3
-abs_top_builddir = @abs_top_builddir@
fc422f3
-abs_top_srcdir = @abs_top_srcdir@
fc422f3
-ac_ct_CC = @ac_ct_CC@
fc422f3
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
fc422f3
-am__include = @am__include@
fc422f3
-am__leading_dot = @am__leading_dot@
fc422f3
-am__quote = @am__quote@
fc422f3
-am__tar = @am__tar@
fc422f3
-am__untar = @am__untar@
fc422f3
-bindir = @bindir@
fc422f3
-bug_uri = @bug_uri@
fc422f3
-build = @build@
fc422f3
-build_alias = @build_alias@
fc422f3
-build_cpu = @build_cpu@
fc422f3
-build_os = @build_os@
fc422f3
-build_vendor = @build_vendor@
fc422f3
-builddir = @builddir@
fc422f3
-datadir = @datadir@
fc422f3
-datarootdir = @datarootdir@
fc422f3
-docdir = @docdir@
fc422f3
-dvidir = @dvidir@
fc422f3
-exec_prefix = @exec_prefix@
fc422f3
-host = @host@
fc422f3
-host_alias = @host_alias@
fc422f3
-host_cpu = @host_cpu@
fc422f3
-host_os = @host_os@
fc422f3
-host_vendor = @host_vendor@
fc422f3
-htmldir = @htmldir@
fc422f3
-includedir = @includedir@
fc422f3
-infodir = @infodir@
fc422f3
-initdir = @initdir@
fc422f3
-install_sh = @install_sh@
fc422f3
-launchddir = @launchddir@
fc422f3
-libdir = @libdir@
fc422f3
-libexecdir = @libexecdir@
fc422f3
-localconfdir = @localconfdir@
fc422f3
-localdatadir = @localdatadir@
fc422f3
-localdocdir = @localdocdir@
fc422f3
-localedir = @localedir@
fc422f3
-localerlanglibdir = @localerlanglibdir@
fc422f3
-locallibbindir = @locallibbindir@
fc422f3
-locallibdir = @locallibdir@
fc422f3
-localstatedir = @localstatedir@
fc422f3
-localstatelibdir = @localstatelibdir@
fc422f3
-localstatelogdir = @localstatelogdir@
fc422f3
-localstaterundir = @localstaterundir@
fc422f3
-lt_ECHO = @lt_ECHO@
fc422f3
-mandir = @mandir@
fc422f3
-mkdir_p = @mkdir_p@
fc422f3
-oldincludedir = @oldincludedir@
fc422f3
-package_author_address = @package_author_address@
fc422f3
-package_author_name = @package_author_name@
fc422f3
-package_identifier = @package_identifier@
fc422f3
-package_name = @package_name@
fc422f3
-package_tarname = @package_tarname@
fc422f3
-pdfdir = @pdfdir@
fc422f3
-prefix = @prefix@
fc422f3
-program_transform_name = @program_transform_name@
fc422f3
-psdir = @psdir@
fc422f3
-sbindir = @sbindir@
fc422f3
-sharedstatedir = @sharedstatedir@
fc422f3
-srcdir = @srcdir@
fc422f3
-sysconfdir = @sysconfdir@
fc422f3
-target_alias = @target_alias@
fc422f3
-top_build_prefix = @top_build_prefix@
fc422f3
-top_builddir = @top_builddir@
fc422f3
-top_srcdir = @top_srcdir@
fc422f3
-version = @version@
fc422f3
-version_major = @version_major@
fc422f3
-version_minor = @version_minor@
fc422f3
-version_release = @version_release@
fc422f3
-version_revision = @version_revision@
fc422f3
-version_stage = @version_stage@
fc422f3
-etapebindir = $(localerlanglibdir)/etap/ebin
fc422f3
-etap_file_collection = \
fc422f3
-    etap.erl \
fc422f3
-   	etap_application.erl \
fc422f3
-    etap_can.erl \
fc422f3
-    etap_exception.erl \
fc422f3
-    etap_process.erl \
fc422f3
-	etap_report.erl \
fc422f3
-	etap_request.erl \
fc422f3
-	etap_string.erl \
fc422f3
-   	etap_web.erl
fc422f3
-
fc422f3
-etapebin_make_generated_file_list = \
fc422f3
-    etap.beam \
fc422f3
-   	etap_application.beam \
fc422f3
-    etap_can.beam \
fc422f3
-    etap_exception.beam \
fc422f3
-    etap_process.beam \
fc422f3
-	etap_report.beam \
fc422f3
-	etap_request.beam \
fc422f3
-	etap_string.beam \
fc422f3
-   	etap_web.beam
fc422f3
-
fc422f3
-etapebin_DATA = $(etapebin_make_generated_file_list)
fc422f3
-EXTRA_DIST = $(etap_file_collection)
fc422f3
-CLEANFILES = $(etapebin_make_generated_file_list)
fc422f3
-all: all-am
fc422f3
-
fc422f3
-.SUFFIXES:
fc422f3
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
fc422f3
-	@for dep in $?; do \
fc422f3
-	  case '$(am__configure_deps)' in \
fc422f3
-	    *$$dep*) \
fc422f3
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
fc422f3
-	        && { if test -f $@; then exit 0; else break; fi; }; \
fc422f3
-	      exit 1;; \
fc422f3
-	  esac; \
fc422f3
-	done; \
fc422f3
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/etap/Makefile'; \
fc422f3
-	$(am__cd) $(top_srcdir) && \
fc422f3
-	  $(AUTOMAKE) --foreign src/etap/Makefile
fc422f3
-.PRECIOUS: Makefile
fc422f3
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
fc422f3
-	@case '$?' in \
fc422f3
-	  *config.status*) \
fc422f3
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
fc422f3
-	  *) \
fc422f3
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
fc422f3
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
fc422f3
-	esac;
fc422f3
-
fc422f3
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
fc422f3
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
fc422f3
-
fc422f3
-$(top_srcdir)/configure:  $(am__configure_deps)
fc422f3
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
fc422f3
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
fc422f3
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
fc422f3
-$(am__aclocal_m4_deps):
fc422f3
-
fc422f3
-mostlyclean-libtool:
fc422f3
-	-rm -f *.lo
fc422f3
-
fc422f3
-clean-libtool:
fc422f3
-	-rm -rf .libs _libs
fc422f3
-install-etapebinDATA: $(etapebin_DATA)
fc422f3
-	@$(NORMAL_INSTALL)
fc422f3
-	test -z "$(etapebindir)" || $(MKDIR_P) "$(DESTDIR)$(etapebindir)"
fc422f3
-	@list='$(etapebin_DATA)'; test -n "$(etapebindir)" || list=; \
fc422f3
-	for p in $$list; do \
fc422f3
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
fc422f3
-	  echo "$$d$$p"; \
fc422f3
-	done | $(am__base_list) | \
fc422f3
-	while read files; do \
fc422f3
-	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(etapebindir)'"; \
fc422f3
-	  $(INSTALL_DATA) $$files "$(DESTDIR)$(etapebindir)" || exit $$?; \
fc422f3
-	done
fc422f3
-
fc422f3
-uninstall-etapebinDATA:
fc422f3
-	@$(NORMAL_UNINSTALL)
fc422f3
-	@list='$(etapebin_DATA)'; test -n "$(etapebindir)" || list=; \
fc422f3
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
fc422f3
-	test -n "$$files" || exit 0; \
fc422f3
-	echo " ( cd '$(DESTDIR)$(etapebindir)' && rm -f" $$files ")"; \
fc422f3
-	cd "$(DESTDIR)$(etapebindir)" && rm -f $$files
fc422f3
-tags: TAGS
fc422f3
-TAGS:
fc422f3
-
fc422f3
-ctags: CTAGS
fc422f3
-CTAGS:
fc422f3
-
fc422f3
-
fc422f3
-distdir: $(DISTFILES)
fc422f3
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
fc422f3
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
fc422f3
-	list='$(DISTFILES)'; \
fc422f3
-	  dist_files=`for file in $$list; do echo $$file; done | \
fc422f3
-	  sed -e "s|^$$srcdirstrip/||;t" \
fc422f3
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
fc422f3
-	case $$dist_files in \
fc422f3
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
fc422f3
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
fc422f3
-			   sort -u` ;; \
fc422f3
-	esac; \
fc422f3
-	for file in $$dist_files; do \
fc422f3
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
fc422f3
-	  if test -d $$d/$$file; then \
fc422f3
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
fc422f3
-	    if test -d "$(distdir)/$$file"; then \
fc422f3
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fc422f3
-	    fi; \
fc422f3
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
fc422f3
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
fc422f3
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fc422f3
-	    fi; \
fc422f3
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
fc422f3
-	  else \
fc422f3
-	    test -f "$(distdir)/$$file" \
fc422f3
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
fc422f3
-	    || exit 1; \
fc422f3
-	  fi; \
fc422f3
-	done
fc422f3
-check-am: all-am
fc422f3
-check: check-am
fc422f3
-all-am: Makefile $(DATA)
fc422f3
-installdirs:
fc422f3
-	for dir in "$(DESTDIR)$(etapebindir)"; do \
fc422f3
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
fc422f3
-	done
fc422f3
-install: install-am
fc422f3
-install-exec: install-exec-am
fc422f3
-install-data: install-data-am
fc422f3
-uninstall: uninstall-am
fc422f3
-
fc422f3
-install-am: all-am
fc422f3
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
fc422f3
-
fc422f3
-installcheck: installcheck-am
fc422f3
-install-strip:
fc422f3
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
fc422f3
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
fc422f3
-	  `test -z '$(STRIP)' || \
fc422f3
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
fc422f3
-mostlyclean-generic:
fc422f3
-
fc422f3
-clean-generic:
fc422f3
-	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
fc422f3
-
fc422f3
-distclean-generic:
fc422f3
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
fc422f3
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
fc422f3
-
fc422f3
-maintainer-clean-generic:
fc422f3
-	@echo "This command is intended for maintainers to use"
fc422f3
-	@echo "it deletes files that may require special tools to rebuild."
fc422f3
-clean: clean-am
fc422f3
-
fc422f3
-clean-am: clean-generic clean-libtool mostlyclean-am
fc422f3
-
fc422f3
-distclean: distclean-am
fc422f3
-	-rm -f Makefile
fc422f3
-distclean-am: clean-am distclean-generic
fc422f3
-
fc422f3
-dvi: dvi-am
fc422f3
-
fc422f3
-dvi-am:
fc422f3
-
fc422f3
-html: html-am
fc422f3
-
fc422f3
-html-am:
fc422f3
-
fc422f3
-info: info-am
fc422f3
-
fc422f3
-info-am:
fc422f3
-
fc422f3
-install-data-am: install-etapebinDATA
fc422f3
-
fc422f3
-install-dvi: install-dvi-am
fc422f3
-
fc422f3
-install-dvi-am:
fc422f3
-
fc422f3
-install-exec-am:
fc422f3
-
fc422f3
-install-html: install-html-am
fc422f3
-
fc422f3
-install-html-am:
fc422f3
-
fc422f3
-install-info: install-info-am
fc422f3
-
fc422f3
-install-info-am:
fc422f3
-
fc422f3
-install-man:
fc422f3
-
fc422f3
-install-pdf: install-pdf-am
fc422f3
-
fc422f3
-install-pdf-am:
fc422f3
-
fc422f3
-install-ps: install-ps-am
fc422f3
-
fc422f3
-install-ps-am:
fc422f3
-
fc422f3
-installcheck-am:
fc422f3
-
fc422f3
-maintainer-clean: maintainer-clean-am
fc422f3
-	-rm -f Makefile
fc422f3
-maintainer-clean-am: distclean-am maintainer-clean-generic
fc422f3
-
fc422f3
-mostlyclean: mostlyclean-am
fc422f3
-
fc422f3
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
fc422f3
-
fc422f3
-pdf: pdf-am
fc422f3
-
fc422f3
-pdf-am:
fc422f3
-
fc422f3
-ps: ps-am
fc422f3
-
fc422f3
-ps-am:
fc422f3
-
fc422f3
-uninstall-am: uninstall-etapebinDATA
fc422f3
-
fc422f3
-.MAKE: install-am install-strip
fc422f3
-
fc422f3
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
fc422f3
-	distclean distclean-generic distclean-libtool distdir dvi \
fc422f3
-	dvi-am html html-am info info-am install install-am \
fc422f3
-	install-data install-data-am install-dvi install-dvi-am \
fc422f3
-	install-etapebinDATA install-exec install-exec-am install-html \
fc422f3
-	install-html-am install-info install-info-am install-man \
fc422f3
-	install-pdf install-pdf-am install-ps install-ps-am \
fc422f3
-	install-strip installcheck installcheck-am installdirs \
fc422f3
-	maintainer-clean maintainer-clean-generic mostlyclean \
fc422f3
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
fc422f3
-	uninstall uninstall-am uninstall-etapebinDATA
fc422f3
-
fc422f3
-
fc422f3
-%.beam: %.erl
fc422f3
-	$(ERLC) $(ERLC_FLAGS) $<
fc422f3
-
fc422f3
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
fc422f3
-# Otherwise a system limit (for SysV at least) may be exceeded.
fc422f3
-.NOEXPORT:
fc422f3
diff --git a/src/etap/etap.erl b/src/etap/etap.erl
fc422f3
deleted file mode 100644
fc422f3
index 5ad5dba..0000000
fc422f3
--- a/src/etap/etap.erl
fc422f3
+++ /dev/null
fc422f3
@@ -1,416 +0,0 @@
fc422f3
-%% Copyright (c) 2008-2009 Nick Gerakines <nick@gerakines.net>
fc422f3
-%% 
fc422f3
-%% Permission is hereby granted, free of charge, to any person
fc422f3
-%% obtaining a copy of this software and associated documentation
fc422f3
-%% files (the "Software"), to deal in the Software without
fc422f3
-%% restriction, including without limitation the rights to use,
fc422f3
-%% copy, modify, merge, publish, distribute, sublicense, and/or sell
fc422f3
-%% copies of the Software, and to permit persons to whom the
fc422f3
-%% Software is furnished to do so, subject to the following
fc422f3
-%% conditions:
fc422f3
-%% 
fc422f3
-%% The above copyright notice and this permission notice shall be
fc422f3
-%% included in all copies or substantial portions of the Software.
fc422f3
-%% 
fc422f3
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
fc422f3
-%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
fc422f3
-%% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
fc422f3
-%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
fc422f3
-%% HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
fc422f3
-%% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
fc422f3
-%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
fc422f3
-%% OTHER DEALINGS IN THE SOFTWARE.
fc422f3
-%% 
fc422f3
-%% @author Nick Gerakines <nick@gerakines.net> [http://socklabs.com/]
fc422f3
-%% @author Jeremy Wall <jeremy@marzhillstudios.com>
fc422f3
-%% @version 0.3.4
fc422f3
-%% @copyright 2007-2008 Jeremy Wall, 2008-2009 Nick Gerakines
fc422f3
-%% @reference http://testanything.org/wiki/index.php/Main_Page
fc422f3
-%% @reference http://en.wikipedia.org/wiki/Test_Anything_Protocol
fc422f3
-%% @todo Finish implementing the skip directive.
fc422f3
-%% @todo Document the messages handled by this receive loop.
fc422f3
-%% @todo Explain in documentation why we use a process to handle test input.
fc422f3
-%% @doc etap is a TAP testing module for Erlang components and applications.
fc422f3
-%% This module allows developers to test their software using the TAP method.
fc422f3
-%% 
fc422f3
-%% 

fc422f3
-%% TAP, the Test Anything Protocol, is a simple text-based interface between
fc422f3
-%% testing modules in a test harness. TAP started life as part of the test
fc422f3
-%% harness for Perl but now has implementations in C/C++, Python, PHP, Perl
fc422f3
-%% and probably others by the time you read this.
fc422f3
-%% 

fc422f3
-%% 
fc422f3
-%% The testing process begins by defining a plan using etap:plan/1, running
fc422f3
-%% a number of etap tests and then calling eta:end_tests/0. Please refer to
fc422f3
-%% the Erlang modules in the t directory of this project for example tests.
fc422f3
--module(etap).
fc422f3
--export([
fc422f3
-    ensure_test_server/0, start_etap_server/0, test_server/1,
fc422f3
-    diag/1, diag/2, plan/1, end_tests/0, not_ok/2, ok/2, is/3, isnt/3,
fc422f3
-    any/3, none/3, fun_is/3, is_greater/3, skip/1, skip/2,
fc422f3
-    ensure_coverage_starts/0, ensure_coverage_ends/0, coverage_report/0,
fc422f3
-    datetime/1, skip/3, bail/0, bail/1
fc422f3
-]).
fc422f3
--record(test_state, {planned = 0, count = 0, pass = 0, fail = 0, skip = 0, skip_reason = ""}).
fc422f3
--vsn("0.3.4").
fc422f3
-
fc422f3
-%% @spec plan(N) -> Result
fc422f3
-%%       N = unknown | skip | {skip, string()} | integer()
fc422f3
-%%       Result = ok
fc422f3
-%% @doc Create a test plan and boot strap the test server.
fc422f3
-plan(unknown) ->
fc422f3
-    ensure_coverage_starts(),
fc422f3
-    ensure_test_server(),
fc422f3
-    etap_server ! {self(), plan, unknown},
fc422f3
-    ok;
fc422f3
-plan(skip) ->
fc422f3
-    io:format("1..0 # skip~n");
fc422f3
-plan({skip, Reason}) ->
fc422f3
-    io:format("1..0 # skip ~s~n", [Reason]);
fc422f3
-plan(N) when is_integer(N), N > 0 ->
fc422f3
-    ensure_coverage_starts(),
fc422f3
-    ensure_test_server(),
fc422f3
-    etap_server ! {self(), plan, N},
fc422f3
-    ok.
fc422f3
-
fc422f3
-%% @spec end_tests() -> ok
fc422f3
-%% @doc End the current test plan and output test results.
fc422f3
-%% @todo This should probably be done in the test_server process.
fc422f3
-end_tests() ->
fc422f3
-    ensure_coverage_ends(),
fc422f3
-    etap_server ! {self(), state},
fc422f3
-    State = receive X -> X end,
fc422f3
-    if
fc422f3
-        State#test_state.planned == -1 ->
fc422f3
-            io:format("1..~p~n", [State#test_state.count]);
fc422f3
-        true ->
fc422f3
-            ok
fc422f3
-    end,
fc422f3
-    case whereis(etap_server) of
fc422f3
-        undefined -> ok;
fc422f3
-        _ -> etap_server ! done, ok
fc422f3
-    end.
fc422f3
-
fc422f3
-%% @private
fc422f3
-ensure_coverage_starts() ->
fc422f3
-    case os:getenv("COVER") of
fc422f3
-        false -> ok;
fc422f3
-        _ ->
fc422f3
-            BeamDir = case os:getenv("COVER_BIN") of false -> "ebin"; X -> X end,
fc422f3
-            cover:compile_beam_directory(BeamDir)
fc422f3
-    end.
fc422f3
-
fc422f3
-%% @private
fc422f3
-%% @doc Attempts to write out any collected coverage data to the cover/
fc422f3
-%% directory. This function should not be called externally, but it could be.
fc422f3
-ensure_coverage_ends() ->
fc422f3
-    case os:getenv("COVER") of
fc422f3
-        false -> ok;
fc422f3
-        _ ->
fc422f3
-            filelib:ensure_dir("cover/"),
fc422f3
-            Name = lists:flatten([
fc422f3
-                io_lib:format("~.16b", [X]) || X <- binary_to_list(erlang:md5(
fc422f3
-                     term_to_binary({make_ref(), now()})
fc422f3
-                ))
fc422f3
-            ]),
fc422f3
-            cover:export("cover/" ++ Name ++ ".coverdata")
fc422f3
-    end.
fc422f3
-
fc422f3
-%% @spec coverage_report() -> ok
fc422f3
-%% @doc Use the cover module's covreage report builder to create code coverage
fc422f3
-%% reports from recently created coverdata files.
fc422f3
-coverage_report() ->
fc422f3
-    [cover:import(File) || File <- filelib:wildcard("cover/*.coverdata")],
fc422f3
-    lists:foreach(
fc422f3
-        fun(Mod) ->
fc422f3
-            cover:analyse_to_file(Mod, atom_to_list(Mod) ++ "_coverage.txt", [])
fc422f3
-        end,
fc422f3
-        cover:imported_modules()
fc422f3
-    ),
fc422f3
-    ok.
fc422f3
-
fc422f3
-bail() ->
fc422f3
-    bail("").
fc422f3
-
fc422f3
-bail(Reason) ->
fc422f3
-    etap_server ! {self(), diag, "Bail out! " ++ Reason},
fc422f3
-    ensure_coverage_ends(),
fc422f3
-    etap_server ! done, ok,
fc422f3
-    ok.
fc422f3
-
fc422f3
-
fc422f3
-%% @spec diag(S) -> ok
fc422f3
-%%       S = string()
fc422f3
-%% @doc Print a debug/status message related to the test suite.
fc422f3
-diag(S) -> etap_server ! {self(), diag, "# " ++ S}, ok.
fc422f3
-
fc422f3
-%% @spec diag(Format, Data) -> ok
fc422f3
-%%      Format = atom() | string() | binary()
fc422f3
-%%      Data = [term()]
fc422f3
-%%      UnicodeList = [Unicode]
fc422f3
-%%      Unicode = int()
fc422f3
-%% @doc Print a debug/status message related to the test suite.
fc422f3
-%% Function arguments are passed through io_lib:format/2.
fc422f3
-diag(Format, Data) -> diag(io_lib:format(Format, Data)).
fc422f3
-
fc422f3
-%% @spec ok(Expr, Desc) -> Result
fc422f3
-%%       Expr = true | false
fc422f3
-%%       Desc = string()
fc422f3
-%%       Result = true | false
fc422f3
-%% @doc Assert that a statement is true.
fc422f3
-ok(Expr, Desc) -> mk_tap(Expr == true, Desc).
fc422f3
-
fc422f3
-%% @spec not_ok(Expr, Desc) -> Result
fc422f3
-%%       Expr = true | false
fc422f3
-%%       Desc = string()
fc422f3
-%%       Result = true | false
fc422f3
-%% @doc Assert that a statement is false.
fc422f3
-not_ok(Expr, Desc) -> mk_tap(Expr == false, Desc).
fc422f3
-
fc422f3
-%% @spec is(Got, Expected, Desc) -> Result
fc422f3
-%%       Got = any()
fc422f3
-%%       Expected = any()
fc422f3
-%%       Desc = string()
fc422f3
-%%       Result = true | false
fc422f3
-%% @doc Assert that two values are the same.
fc422f3
-is(Got, Expected, Desc) ->
fc422f3
-    case mk_tap(Got == Expected, Desc) of
fc422f3
-        false ->
fc422f3
-            etap_server ! {self(), diag, "    ---"},
fc422f3
-            etap_server ! {self(), diag, io_lib:format("    description: ~p", [Desc])},
fc422f3
-            etap_server ! {self(), diag, io_lib:format("    found:       ~p", [Got])},
fc422f3
-            etap_server ! {self(), diag, io_lib:format("    wanted:      ~p", [Expected])},
fc422f3
-            etap_server ! {self(), diag, "    ..."},
fc422f3
-            false;
fc422f3
-        true -> true
fc422f3
-    end.
fc422f3
-
fc422f3
-%% @spec isnt(Got, Expected, Desc) -> Result
fc422f3
-%%       Got = any()
fc422f3
-%%       Expected = any()
fc422f3
-%%       Desc = string()
fc422f3
-%%       Result = true | false
fc422f3
-%% @doc Assert that two values are not the same.
fc422f3
-isnt(Got, Expected, Desc) -> mk_tap(Got /= Expected, Desc).
fc422f3
-
fc422f3
-%% @spec is_greater(ValueA, ValueB, Desc) -> Result
fc422f3
-%%       ValueA = number()
fc422f3
-%%       ValueB = number()
fc422f3
-%%       Desc = string()
fc422f3
-%%       Result = true | false
fc422f3
-%% @doc Assert that an integer is greater than another.
fc422f3
-is_greater(ValueA, ValueB, Desc) when is_integer(ValueA), is_integer(ValueB) ->
fc422f3
-    mk_tap(ValueA > ValueB, Desc).
fc422f3
-
fc422f3
-%% @spec any(Got, Items, Desc) -> Result
fc422f3
-%%       Got = any()
fc422f3
-%%       Items = [any()]
fc422f3
-%%       Desc = string()
fc422f3
-%%       Result = true | false
fc422f3
-%% @doc Assert that an item is in a list.
fc422f3
-any(Got, Items, Desc) ->
fc422f3
-    is(lists:member(Got, Items), true, Desc).
fc422f3
-
fc422f3
-%% @spec none(Got, Items, Desc) -> Result
fc422f3
-%%       Got = any()
fc422f3
-%%       Items = [any()]
fc422f3
-%%       Desc = string()
fc422f3
-%%       Result = true | false
fc422f3
-%% @doc Assert that an item is not in a list.
fc422f3
-none(Got, Items, Desc) ->
fc422f3
-    is(lists:member(Got, Items), false, Desc).
fc422f3
-
fc422f3
-%% @spec fun_is(Fun, Expected, Desc) -> Result
fc422f3
-%%       Fun = function()
fc422f3
-%%       Expected = any()
fc422f3
-%%       Desc = string()
fc422f3
-%%       Result = true | false
fc422f3
-%% @doc Use an anonymous function to assert a pattern match.
fc422f3
-fun_is(Fun, Expected, Desc) when is_function(Fun) ->
fc422f3
-    is(Fun(Expected), true, Desc).
fc422f3
-
fc422f3
-%% @equiv skip(TestFun, "")
fc422f3
-skip(TestFun) when is_function(TestFun) ->
fc422f3
-    skip(TestFun, "").
fc422f3
-
fc422f3
-%% @spec skip(TestFun, Reason) -> ok
fc422f3
-%%       TestFun = function()
fc422f3
-%%       Reason = string()
fc422f3
-%% @doc Skip a test.
fc422f3
-skip(TestFun, Reason) when is_function(TestFun), is_list(Reason) ->
fc422f3
-    begin_skip(Reason),
fc422f3
-    catch TestFun(),
fc422f3
-    end_skip(),
fc422f3
-    ok.
fc422f3
-
fc422f3
-%% @spec skip(Q, TestFun, Reason) -> ok
fc422f3
-%%       Q = true | false | function() 
fc422f3
-%%       TestFun = function()
fc422f3
-%%       Reason = string()
fc422f3
-%% @doc Skips a test conditionally. The first argument to this function can
fc422f3
-%% either be the 'true' or 'false' atoms or a function that returns 'true' or
fc422f3
-%% 'false'.
fc422f3
-skip(QFun, TestFun, Reason) when is_function(QFun), is_function(TestFun), is_list(Reason) ->
fc422f3
-    case QFun() of
fc422f3
-        true -> begin_skip(Reason), TestFun(), end_skip();
fc422f3
-        _ -> TestFun()
fc422f3
-    end,
fc422f3
-    ok;
fc422f3
-
fc422f3
-skip(Q, TestFun, Reason) when is_function(TestFun), is_list(Reason), Q == true ->
fc422f3
-    begin_skip(Reason),
fc422f3
-    TestFun(),
fc422f3
-    end_skip(),
fc422f3
-    ok;
fc422f3
-
fc422f3
-skip(_, TestFun, Reason) when is_function(TestFun), is_list(Reason) ->
fc422f3
-    TestFun(),
fc422f3
-    ok.
fc422f3
-
fc422f3
-%% @private
fc422f3
-begin_skip(Reason) ->
fc422f3
-    etap_server ! {self(), begin_skip, Reason}.
fc422f3
-
fc422f3
-%% @private
fc422f3
-end_skip() ->
fc422f3
-    etap_server ! {self(), end_skip}.
fc422f3
-
fc422f3
-% ---
fc422f3
-% Internal / Private functions
fc422f3
-
fc422f3
-%% @private
fc422f3
-%% @doc Start the etap_server process if it is not running already.
fc422f3
-ensure_test_server() ->
fc422f3
-    case whereis(etap_server) of
fc422f3
-        undefined ->
fc422f3
-            proc_lib:start(?MODULE, start_etap_server,[]);
fc422f3
-        _ ->
fc422f3
-            diag("The test server is already running.")
fc422f3
-    end.
fc422f3
-
fc422f3
-%% @private
fc422f3
-%% @doc Start the etap_server loop and register itself as the etap_server
fc422f3
-%% process.
fc422f3
-start_etap_server() ->
fc422f3
-    catch register(etap_server, self()),
fc422f3
-    proc_lib:init_ack(ok),
fc422f3
-    etap:test_server(#test_state{
fc422f3
-        planned = 0,
fc422f3
-        count = 0,
fc422f3
-        pass = 0,
fc422f3
-        fail = 0,
fc422f3
-        skip = 0,
fc422f3
-        skip_reason = ""
fc422f3
-    }).
fc422f3
-
fc422f3
-
fc422f3
-%% @private
fc422f3
-%% @doc The main etap_server receive/run loop. The etap_server receive loop
fc422f3
-%% responds to seven messages apperatining to failure or passing of tests.
fc422f3
-%% It is also used to initiate the testing process with the {_, plan, _}
fc422f3
-%% message that clears the current test state.
fc422f3
-test_server(State) ->
fc422f3
-    NewState = receive
fc422f3
-        {_From, plan, unknown} ->
fc422f3
-            io:format("# Current time local ~s~n", [datetime(erlang:localtime())]),
fc422f3
-            io:format("# Using etap version ~p~n", [ proplists:get_value(vsn, proplists:get_value(attributes, etap:module_info())) ]),
fc422f3
-            State#test_state{
fc422f3
-                planned = -1,
fc422f3
-                count = 0,
fc422f3
-                pass = 0,
fc422f3
-                fail = 0,
fc422f3
-                skip = 0,
fc422f3
-                skip_reason = ""
fc422f3
-            };
fc422f3
-        {_From, plan, N} ->
fc422f3
-            io:format("# Current time local ~s~n", [datetime(erlang:localtime())]),
fc422f3
-            io:format("# Using etap version ~p~n", [ proplists:get_value(vsn, proplists:get_value(attributes, etap:module_info())) ]),
fc422f3
-            io:format("1..~p~n", [N]),
fc422f3
-            State#test_state{
fc422f3
-                planned = N,
fc422f3
-                count = 0,
fc422f3
-                pass = 0,
fc422f3
-                fail = 0,
fc422f3
-                skip = 0,
fc422f3
-                skip_reason = ""
fc422f3
-            };
fc422f3
-        {_From, begin_skip, Reason} ->
fc422f3
-            State#test_state{
fc422f3
-                skip = 1,
fc422f3
-                skip_reason = Reason
fc422f3
-            };
fc422f3
-        {_From, end_skip} ->
fc422f3
-            State#test_state{
fc422f3
-                skip = 0,
fc422f3
-                skip_reason = ""
fc422f3
-            };
fc422f3
-        {_From, pass, Desc} ->
fc422f3
-            FullMessage = skip_diag(
fc422f3
-                " - " ++ Desc,
fc422f3
-                State#test_state.skip,
fc422f3
-                State#test_state.skip_reason
fc422f3
-            ),
fc422f3
-            io:format("ok ~p ~s~n", [State#test_state.count + 1, FullMessage]),
fc422f3
-            State#test_state{
fc422f3
-                count = State#test_state.count + 1,
fc422f3
-                pass = State#test_state.pass + 1
fc422f3
-            };
fc422f3
-            
fc422f3
-        {_From, fail, Desc} ->
fc422f3
-            FullMessage = skip_diag(
fc422f3
-                " - " ++ Desc,
fc422f3
-                State#test_state.skip,
fc422f3
-                State#test_state.skip_reason
fc422f3
-            ),
fc422f3
-            io:format("not ok ~p ~s~n", [State#test_state.count + 1, FullMessage]),
fc422f3
-            State#test_state{
fc422f3
-                count = State#test_state.count + 1,
fc422f3
-                fail = State#test_state.fail + 1
fc422f3
-            };
fc422f3
-        {From, state} ->
fc422f3
-            From ! State,
fc422f3
-            State;
fc422f3
-        {_From, diag, Message} ->
fc422f3
-            io:format("~s~n", [Message]),
fc422f3
-            State;
fc422f3
-        {From, count} ->
fc422f3
-            From ! State#test_state.count,
fc422f3
-            State;
fc422f3
-        {From, is_skip} ->
fc422f3
-            From ! State#test_state.skip,
fc422f3
-            State;
fc422f3
-        done ->
fc422f3
-            exit(normal)
fc422f3
-    end,
fc422f3
-    test_server(NewState).
fc422f3
-
fc422f3
-%% @private
fc422f3
-%% @doc Process the result of a test and send it to the etap_server process.
fc422f3
-mk_tap(Result, Desc) ->
fc422f3
-    IsSkip = lib:sendw(etap_server, is_skip),
fc422f3
-    case [IsSkip, Result] of
fc422f3
-        [_, true] ->
fc422f3
-            etap_server ! {self(), pass, Desc},
fc422f3
-            true;                        
fc422f3
-        [1, _] ->                        
fc422f3
-            etap_server ! {self(), pass, Desc},
fc422f3
-            true;                        
fc422f3
-        _ ->                             
fc422f3
-            etap_server ! {self(), fail, Desc},
fc422f3
-            false
fc422f3
-    end.
fc422f3
-
fc422f3
-%% @private
fc422f3
-%% @doc Format a date/time string.
fc422f3
-datetime(DateTime) ->
fc422f3
-    {{Year, Month, Day}, {Hour, Min, Sec}} = DateTime,
fc422f3
-    io_lib:format("~4.10.0B-~2.10.0B-~2.10.0B ~2.10.0B:~2.10.0B:~2.10.0B", [Year, Month, Day, Hour, Min, Sec]).
fc422f3
-
fc422f3
-%% @private
fc422f3
-%% @doc Craft an output message taking skip/todo into consideration.
fc422f3
-skip_diag(Message, 0, _) ->
fc422f3
-    Message;
fc422f3
-skip_diag(_Message, 1, "") ->
fc422f3
-    " # SKIP";
fc422f3
-skip_diag(_Message, 1, Reason) ->
fc422f3
-    " # SKIP : " ++ Reason.
fc422f3
diff --git a/src/etap/etap_application.erl b/src/etap/etap_application.erl
fc422f3
deleted file mode 100644
fc422f3
index 98b5275..0000000
fc422f3
--- a/src/etap/etap_application.erl
fc422f3
+++ /dev/null
fc422f3
@@ -1,72 +0,0 @@
fc422f3
-%% Copyright (c) 2008-2009 Nick Gerakines <nick@gerakines.net>
fc422f3
-%% 
fc422f3
-%% Permission is hereby granted, free of charge, to any person
fc422f3
-%% obtaining a copy of this software and associated documentation
fc422f3
-%% files (the "Software"), to deal in the Software without
fc422f3
-%% restriction, including without limitation the rights to use,
fc422f3
-%% copy, modify, merge, publish, distribute, sublicense, and/or sell
fc422f3
-%% copies of the Software, and to permit persons to whom the
fc422f3
-%% Software is furnished to do so, subject to the following
fc422f3
-%% conditions:
fc422f3
-%% 
fc422f3
-%% The above copyright notice and this permission notice shall be
fc422f3
-%% included in all copies or substantial portions of the Software.
fc422f3
-%% 
fc422f3
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
fc422f3
-%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
fc422f3
-%% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
fc422f3
-%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
fc422f3
-%% HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
fc422f3
-%% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
fc422f3
-%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
fc422f3
-%% OTHER DEALINGS IN THE SOFTWARE.
fc422f3
-%%
fc422f3
-%% @author Nick Gerakines <nick@gerakines.net> [http://socklabs.com/]
fc422f3
-%% @copyright 2008 Nick Gerakines
fc422f3
-%% @reference http://testanything.org/wiki/index.php/Main_Page
fc422f3
-%% @reference http://en.wikipedia.org/wiki/Test_Anything_Protocol
fc422f3
-%% @todo Explain in documentation why we use a process to handle test input.
fc422f3
-%% @todo Add test to verify the number of members in a pg2 group.
fc422f3
-%% @doc Provide test functionality to the application and related behaviors.
fc422f3
--module(etap_application).
fc422f3
--export([
fc422f3
-    start_ok/2, ensure_loaded/3, load_ok/2,
fc422f3
-    pg2_group_exists/2, pg2_group_doesntexist/2
fc422f3
-]).
fc422f3
-
fc422f3
-%% @spec load_ok(string(), string()) -> true | false
fc422f3
-%% @doc Assert that an application can be loaded successfully.
fc422f3
-load_ok(AppName, Desc) ->
fc422f3
-    etap:ok(application:load(AppName) == ok, Desc).
fc422f3
-
fc422f3
-%% @spec start_ok(string(), string()) -> true | false
fc422f3
-%% @doc Assert that an application can be started successfully.
fc422f3
-start_ok(AppName, Desc) ->
fc422f3
-    etap:ok(application:start(AppName) == ok, Desc).
fc422f3
-
fc422f3
-%% @spec ensure_loaded(string(), string(), string()) -> true | false
fc422f3
-%% @doc Assert that an application has been loaded successfully.
fc422f3
-ensure_loaded(AppName, AppVsn, Desc) ->
fc422f3
-    etap:any(
fc422f3
-        fun(Match) -> case Match of {AppName, _, AppVsn} -> true; _ -> false end end,
fc422f3
-        application:loaded_applications(),
fc422f3
-        Desc
fc422f3
-    ).
fc422f3
-
fc422f3
-%% @spec pg2_group_exists(string(), string()) -> true | false
fc422f3
-%% @doc Assert that a pg2 group exists.
fc422f3
-pg2_group_exists(GroupName, Desc) ->
fc422f3
-    etap:any(
fc422f3
-        fun(Match) -> Match == GroupName end,
fc422f3
-        pg2:which_groups(),
fc422f3
-        Desc
fc422f3
-    ).
fc422f3
-
fc422f3
-%% @spec pg2_group_doesntexist(string(), string()) -> true | false
fc422f3
-%% @doc Assert that a pg2 group does not exists.
fc422f3
-pg2_group_doesntexist(GroupName, Desc) ->
fc422f3
-    etap:none(
fc422f3
-        fun(Match) -> Match == GroupName end,
fc422f3
-        pg2:which_groups(),
fc422f3
-        Desc
fc422f3
-    ).
fc422f3
diff --git a/src/etap/etap_can.erl b/src/etap/etap_can.erl
fc422f3
deleted file mode 100644
fc422f3
index 552b717..0000000
fc422f3
--- a/src/etap/etap_can.erl
fc422f3
+++ /dev/null
fc422f3
@@ -1,79 +0,0 @@
fc422f3
-%% Copyright (c) 2008-2009 Nick Gerakines <nick@gerakines.net>
fc422f3
-%% 
fc422f3
-%% Permission is hereby granted, free of charge, to any person
fc422f3
-%% obtaining a copy of this software and associated documentation
fc422f3
-%% files (the "Software"), to deal in the Software without
fc422f3
-%% restriction, including without limitation the rights to use,
fc422f3
-%% copy, modify, merge, publish, distribute, sublicense, and/or sell
fc422f3
-%% copies of the Software, and to permit persons to whom the
fc422f3
-%% Software is furnished to do so, subject to the following
fc422f3
-%% conditions:
fc422f3
-%% 
fc422f3
-%% The above copyright notice and this permission notice shall be
fc422f3
-%% included in all copies or substantial portions of the Software.
fc422f3
-%% 
fc422f3
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
fc422f3
-%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
fc422f3
-%% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
fc422f3
-%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
fc422f3
-%% HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
fc422f3
-%% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
fc422f3
-%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
fc422f3
-%% OTHER DEALINGS IN THE SOFTWARE.
fc422f3
-%%
fc422f3
-%% @reference http://testanything.org/wiki/index.php/Main_Page
fc422f3
-%% @reference http://en.wikipedia.org/wiki/Test_Anything_Protocol
fc422f3
-%% @doc Provide test functionality modules
fc422f3
--module(etap_can).
fc422f3
-
fc422f3
--export([
fc422f3
-    loaded_ok/2, can_ok/2, can_ok/3,
fc422f3
-    has_attrib/2, is_attrib/3, is_behaviour/2
fc422f3
-]).
fc422f3
-
fc422f3
-%% @spec loaded_ok(atom(), string()) -> true | false
fc422f3
-%% @doc Assert that a module has been loaded successfully.
fc422f3
-loaded_ok(M, Desc) when is_atom(M) ->
fc422f3
-    etap:fun_is(fun({module, _}) -> true; (_) -> false end, code:load_file(M), Desc).
fc422f3
-
fc422f3
-%% @spec can_ok(atom(), atom()) -> true | false
fc422f3
-%% @doc Assert that a module exports a given function.
fc422f3
-can_ok(M, F) when is_atom(M), is_atom(F) ->
fc422f3
-    Matches = [X || {X, _} <- M:module_info(exports), X == F],
fc422f3
-    etap:ok(Matches > 0, lists:concat([M, " can ", F])).
fc422f3
-
fc422f3
-%% @spec can_ok(atom(), atom(), integer()) -> true | false
fc422f3
-%% @doc Assert that a module exports a given function with a given arity.
fc422f3
-can_ok(M, F, A) when is_atom(M); is_atom(F), is_number(A) ->
fc422f3
-    Matches = [X || X <- M:module_info(exports), X == {F, A}],
fc422f3
-    etap:ok(Matches > 0, lists:concat([M, " can ", F, "/", A])).
fc422f3
-
fc422f3
-%% @spec has_attrib(M, A) -> true | false
fc422f3
-%%       M = atom()
fc422f3
-%%       A = atom()
fc422f3
-%% @doc Asserts that a module has a given attribute.
fc422f3
-has_attrib(M, A) when is_atom(M), is_atom(A) ->
fc422f3
-    etap:isnt(
fc422f3
-        proplists:get_value(A, M:module_info(attributes), 'asdlkjasdlkads'),
fc422f3
-        'asdlkjasdlkads',
fc422f3
-        lists:concat([M, " has attribute ", A])
fc422f3
-    ).
fc422f3
-
fc422f3
-%% @spec has_attrib(M, A. V) -> true | false
fc422f3
-%%       M = atom()
fc422f3
-%%       A = atom()
fc422f3
-%%       V = any()
fc422f3
-%% @doc Asserts that a module has a given attribute with a given value.
fc422f3
-is_attrib(M, A, V) when is_atom(M) andalso is_atom(A) ->
fc422f3
-    etap:is(
fc422f3
-        proplists:get_value(A, M:module_info(attributes)),
fc422f3
-        [V],
fc422f3
-        lists:concat([M, "'s ", A, " is ", V])
fc422f3
-    ).
fc422f3
-
fc422f3
-%% @spec is_behavior(M, B) -> true | false
fc422f3
-%%       M = atom()
fc422f3
-%%       B = atom()
fc422f3
-%% @doc Asserts that a given module has a specific behavior.
fc422f3
-is_behaviour(M, B) when is_atom(M) andalso is_atom(B) ->
fc422f3
-    is_attrib(M, behaviour, B).
fc422f3
diff --git a/src/etap/etap_exception.erl b/src/etap/etap_exception.erl
fc422f3
deleted file mode 100644
fc422f3
index ba66072..0000000
fc422f3
--- a/src/etap/etap_exception.erl
fc422f3
+++ /dev/null
fc422f3
@@ -1,66 +0,0 @@
fc422f3
-%% Copyright (c) 2008-2009 Nick Gerakines <nick@gerakines.net>
fc422f3
-%% 
fc422f3
-%% Permission is hereby granted, free of charge, to any person
fc422f3
-%% obtaining a copy of this software and associated documentation
fc422f3
-%% files (the "Software"), to deal in the Software without
fc422f3
-%% restriction, including without limitation the rights to use,
fc422f3
-%% copy, modify, merge, publish, distribute, sublicense, and/or sell
fc422f3
-%% copies of the Software, and to permit persons to whom the
fc422f3
-%% Software is furnished to do so, subject to the following
fc422f3
-%% conditions:
fc422f3
-%% 
fc422f3
-%% The above copyright notice and this permission notice shall be
fc422f3
-%% included in all copies or substantial portions of the Software.
fc422f3
-%% 
fc422f3
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
fc422f3
-%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
fc422f3
-%% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
fc422f3
-%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
fc422f3
-%% HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
fc422f3
-%% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
fc422f3
-%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
fc422f3
-%% OTHER DEALINGS IN THE SOFTWARE.
fc422f3
-%%
fc422f3
-%% @reference http://testanything.org/wiki/index.php/Main_Page
fc422f3
-%% @reference http://en.wikipedia.org/wiki/Test_Anything_Protocol
fc422f3
-%% @doc Adds exception based testing to the etap suite.
fc422f3
--module(etap_exception).
fc422f3
-
fc422f3
--export([dies_ok/2, lives_ok/2, throws_ok/3]).
fc422f3
-
fc422f3
-% ---
fc422f3
-% External / Public functions
fc422f3
-
fc422f3
-%% @doc Assert that an exception is raised when running a given function.
fc422f3
-dies_ok(F, Desc) ->
fc422f3
-    case (catch F()) of
fc422f3
-        {'EXIT', _} -> etap:ok(true, Desc);
fc422f3
-        _ -> etap:ok(false, Desc)
fc422f3
-    end.
fc422f3
-
fc422f3
-%% @doc Assert that an exception is not raised when running a given function.
fc422f3
-lives_ok(F, Desc) ->
fc422f3
-    etap:is(try_this(F), success, Desc).
fc422f3
-
fc422f3
-%% @doc Assert that the exception thrown by a function matches the given exception.
fc422f3
-throws_ok(F, Exception, Desc) ->
fc422f3
-    try F() of
fc422f3
-        _ -> etap:ok(nok, Desc)
fc422f3
-    catch
fc422f3
-        _:E ->
fc422f3
-            etap:is(E, Exception, Desc)
fc422f3
-    end.
fc422f3
-
fc422f3
-% ---
fc422f3
-% Internal / Private functions
fc422f3
-
fc422f3
-%% @private
fc422f3
-%% @doc Run a function and catch any exceptions.
fc422f3
-try_this(F) when is_function(F, 0) ->
fc422f3
-    try F() of
fc422f3
-        _ -> success
fc422f3
-    catch
fc422f3
-        throw:E -> {throw, E};
fc422f3
-        error:E -> {error, E};
fc422f3
-        exit:E -> {exit, E}
fc422f3
-    end.
fc422f3
diff --git a/src/etap/etap_process.erl b/src/etap/etap_process.erl
fc422f3
deleted file mode 100644
fc422f3
index 69f5ba0..0000000
fc422f3
--- a/src/etap/etap_process.erl
fc422f3
+++ /dev/null
fc422f3
@@ -1,42 +0,0 @@
fc422f3
-%% Copyright (c) 2008-2009 Nick Gerakines <nick@gerakines.net>
fc422f3
-%% 
fc422f3
-%% Permission is hereby granted, free of charge, to any person
fc422f3
-%% obtaining a copy of this software and associated documentation
fc422f3
-%% files (the "Software"), to deal in the Software without
fc422f3
-%% restriction, including without limitation the rights to use,
fc422f3
-%% copy, modify, merge, publish, distribute, sublicense, and/or sell
fc422f3
-%% copies of the Software, and to permit persons to whom the
fc422f3
-%% Software is furnished to do so, subject to the following
fc422f3
-%% conditions:
fc422f3
-%% 
fc422f3
-%% The above copyright notice and this permission notice shall be
fc422f3
-%% included in all copies or substantial portions of the Software.
fc422f3
-%% 
fc422f3
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
fc422f3
-%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
fc422f3
-%% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
fc422f3
-%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
fc422f3
-%% HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
fc422f3
-%% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
fc422f3
-%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
fc422f3
-%% OTHER DEALINGS IN THE SOFTWARE.
fc422f3
-%%
fc422f3
-%% @doc Adds process/pid testing to the etap suite.
fc422f3
--module(etap_process).
fc422f3
-
fc422f3
--export([is_pid/2, is_alive/2, is_mfa/3]).
fc422f3
-
fc422f3
-% ---
fc422f3
-% External / Public functions
fc422f3
-
fc422f3
-%% @doc Assert that a given variable is a pid.
fc422f3
-is_pid(Pid, Desc) when is_pid(Pid) -> etap:ok(true, Desc);
fc422f3
-is_pid(_, Desc) -> etap:ok(false, Desc).
fc422f3
-
fc422f3
-%% @doc Assert that a given process/pid is alive.
fc422f3
-is_alive(Pid, Desc) ->
fc422f3
-    etap:ok(erlang:is_process_alive(Pid), Desc).
fc422f3
-
fc422f3
-%% @doc Assert that the current function of a pid is a given {M, F, A} tuple.
fc422f3
-is_mfa(Pid, MFA, Desc) ->
fc422f3
-    etap:is({current_function, MFA}, erlang:process_info(Pid, current_function), Desc).
fc422f3
diff --git a/src/etap/etap_report.erl b/src/etap/etap_report.erl
fc422f3
deleted file mode 100644
fc422f3
index 6d692fb..0000000
fc422f3
--- a/src/etap/etap_report.erl
fc422f3
+++ /dev/null
fc422f3
@@ -1,343 +0,0 @@
fc422f3
-%% Copyright (c) 2008-2009 Nick Gerakines <nick@gerakines.net>
fc422f3
-%% 
fc422f3
-%% Permission is hereby granted, free of charge, to any person
fc422f3
-%% obtaining a copy of this software and associated documentation
fc422f3
-%% files (the "Software"), to deal in the Software without
fc422f3
-%% restriction, including without limitation the rights to use,
fc422f3
-%% copy, modify, merge, publish, distribute, sublicense, and/or sell
fc422f3
-%% copies of the Software, and to permit persons to whom the
fc422f3
-%% Software is furnished to do so, subject to the following
fc422f3
-%% conditions:
fc422f3
-%% 
fc422f3
-%% The above copyright notice and this permission notice shall be
fc422f3
-%% included in all copies or substantial portions of the Software.
fc422f3
-%% 
fc422f3
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
fc422f3
-%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
fc422f3
-%% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
fc422f3
-%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
fc422f3
-%% HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
fc422f3
-%% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
fc422f3
-%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
fc422f3
-%% OTHER DEALINGS IN THE SOFTWARE.
fc422f3
-%%
fc422f3
-%% @doc A module for creating nice looking code coverage reports.
fc422f3
--module(etap_report).
fc422f3
--export([create/0]).
fc422f3
-
fc422f3
-%% @spec create() -> ok
fc422f3
-%% @doc Create html code coverage reports for each module that code coverage
fc422f3
-%% data exists for.
fc422f3
-create() ->
fc422f3
-    [cover:import(File) || File <- filelib:wildcard("cover/*.coverdata")],
fc422f3
-    Modules = lists:foldl(
fc422f3
-        fun(Module, Acc) ->
fc422f3
-            [{Module, file_report(Module)} | Acc]
fc422f3
-        end,
fc422f3
-        [],
fc422f3
-        cover:imported_modules()
fc422f3
-    ),
fc422f3
-    index(Modules).
fc422f3
-
fc422f3
-%% @private
fc422f3
-index(Modules) ->
fc422f3
-    {ok, IndexFD} = file:open("cover/index.html", [write]),
fc422f3
-    io:format(IndexFD, "<html><head><style>
fc422f3
-    table.percent_graph { height: 12px; border:1px solid #E2E6EF; empty-cells: show; }
fc422f3
-    table.percent_graph td.covered { height: 10px; background: #00f000; }
fc422f3
-    table.percent_graph td.uncovered { height: 10px; background: #e00000; }
fc422f3
-    .odd { background-color: #ddd; }
fc422f3
-    .even { background-color: #fff; }
fc422f3
-    </style></head>", []),
fc422f3
-    io:format(IndexFD, "<body>", []),
fc422f3
-    lists:foldl(
fc422f3
-        fun({Module, {Good, Bad, Source}}, LastRow) ->
fc422f3
-            case {Good + Bad, Source} of
fc422f3
-                {0, _} -> LastRow;
fc422f3
-                {_, none} -> LastRow;
fc422f3
-                _ ->
fc422f3
-                    CovPer = round((Good / (Good + Bad)) * 100),
fc422f3
-                    UnCovPer = round((Bad / (Good + Bad)) * 100),
fc422f3
-                    RowClass = case LastRow of 1 -> "odd"; _ -> "even" end,
fc422f3
-                    io:format(IndexFD, "
", [RowClass]),
fc422f3
-                    io:format(IndexFD, "~s", [atom_to_list(Module) ++ "_report.html", atom_to_list(Module)]),
fc422f3
-                    io:format(IndexFD, "
fc422f3
-                    
fc422f3
-                      
fc422f3
-                        <tt>~p%</tt> 
fc422f3
-                          
fc422f3
-                          
fc422f3
-                          
fc422f3
-                        
fc422f3
-                      
fc422f3
-                    
fc422f3
-                    ", [CovPer, CovPer, UnCovPer]),
fc422f3
-                    io:format(IndexFD, "", []),
fc422f3
-                    case LastRow of
fc422f3
-                        1 -> 0;
fc422f3
-                        0 -> 1
fc422f3
-                    end
fc422f3
-            end
fc422f3
-        end,
fc422f3
-        0,
fc422f3
-        lists:sort(Modules)
fc422f3
-    ),
fc422f3
-    {TotalGood, TotalBad} = lists:foldl(
fc422f3
-        fun({_, {Good, Bad, Source}}, {TGood, TBad}) ->
fc422f3
-            case Source of none -> {TGood, TBad}; _ -> {TGood + Good, TBad + Bad} end
fc422f3
-        end,
fc422f3
-        {0, 0},
fc422f3
-        Modules
fc422f3
-    ),
fc422f3
-    io:format(IndexFD, "

Generated on ~s.

~n", [etap:datetime({date(), time()})]),
fc422f3
-    case TotalGood + TotalBad of
fc422f3
-        0 -> ok;
fc422f3
-        _ ->
fc422f3
-            TotalCovPer = round((TotalGood / (TotalGood + TotalBad)) * 100),
fc422f3
-            TotalUnCovPer = round((TotalBad / (TotalGood + TotalBad)) * 100),
fc422f3
-            io:format(IndexFD, "
", []),
fc422f3
-            io:format(IndexFD, "Total 
fc422f3
-            
fc422f3
-              
fc422f3
-                <tt>~p%</tt> 
fc422f3
-                  
fc422f3
-                  
fc422f3
-                  
fc422f3
-                
fc422f3
-              
fc422f3
-            
fc422f3
-            ", [TotalCovPer, TotalCovPer, TotalUnCovPer]),
fc422f3
-            io:format(IndexFD, "", [])
fc422f3
-    end,
fc422f3
-    io:format(IndexFD, "</body></html>", []),
fc422f3
-    file:close(IndexFD),
fc422f3
-    ok.
fc422f3
-
fc422f3
-%% @private
fc422f3
-file_report(Module) ->
fc422f3
-    {ok, Data} = cover:analyse(Module, calls, line),
fc422f3
-    Source = find_source(Module),
fc422f3
-    {Good, Bad} = collect_coverage(Data, {0, 0}),
fc422f3
-    case {Source, Good + Bad} of
fc422f3
-        {none, _} -> ok;
fc422f3
-        {_, 0} -> ok;
fc422f3
-        _ ->
fc422f3
-            {ok, SourceFD} = file:open(Source, [read]),
fc422f3
-            {ok, WriteFD} = file:open("cover/" ++ atom_to_list(Module) ++ "_report.html", [write]),
fc422f3
-            io:format(WriteFD, "~s", [header(Module, Good, Bad)]),
fc422f3
-            output_lines(Data, WriteFD, SourceFD, 1),
fc422f3
-            io:format(WriteFD, "~s", [footer()]),
fc422f3
-            file:close(WriteFD),
fc422f3
-            file:close(SourceFD),
fc422f3
-            ok
fc422f3
-    end,
fc422f3
-    {Good, Bad, Source}.
fc422f3
-
fc422f3
-%% @private
fc422f3
-collect_coverage([], Acc) -> Acc;
fc422f3
-collect_coverage([{{_, _}, 0} | Data], {Good, Bad}) ->
fc422f3
-    collect_coverage(Data, {Good, Bad + 1});
fc422f3
-collect_coverage([_ | Data], {Good, Bad}) ->
fc422f3
-    collect_coverage(Data, {Good + 1, Bad}).
fc422f3
-
fc422f3
-%% @private
fc422f3
-output_lines(Data, WriteFD, SourceFD, LineNumber) ->
fc422f3
-    {Match, NextData} = datas_match(Data, LineNumber),
fc422f3
-    case io:get_line(SourceFD, '') of
fc422f3
-        eof -> ok;
fc422f3
-        Line = "%% @todo" ++ _ ->
fc422f3
-            io:format(WriteFD, "~s", [out_line(LineNumber, highlight, Line)]),
fc422f3
-            output_lines(NextData, WriteFD, SourceFD, LineNumber + 1);
fc422f3
-        Line = "% " ++ _ ->
fc422f3
-            io:format(WriteFD, "~s", [out_line(LineNumber, none, Line)]),
fc422f3
-            output_lines(NextData, WriteFD, SourceFD, LineNumber + 1);
fc422f3
-        Line ->
fc422f3
-            case Match of
fc422f3
-                {true, CC} ->
fc422f3
-                    io:format(WriteFD, "~s", [out_line(LineNumber, CC, Line)]),
fc422f3
-                    output_lines(NextData, WriteFD, SourceFD, LineNumber + 1);
fc422f3
-                false ->
fc422f3
-                    io:format(WriteFD, "~s", [out_line(LineNumber, none, Line)]),
fc422f3
-                    output_lines(NextData, WriteFD, SourceFD, LineNumber + 1)
fc422f3
-            end
fc422f3
-    end.
fc422f3
-
fc422f3
-%% @private
fc422f3
-out_line(Number, none, Line) ->
fc422f3
-    PadNu = string:right(integer_to_list(Number), 5, $.),
fc422f3
-    io_lib:format("~s ~s", [Number, PadNu, Line]);
fc422f3
-out_line(Number, highlight, Line) ->
fc422f3
-    PadNu = string:right(integer_to_list(Number), 5, $.),
fc422f3
-    io_lib:format("~s ~s", [Number, PadNu, Line]);
fc422f3
-out_line(Number, 0, Line) ->
fc422f3
-    PadNu = string:right(integer_to_list(Number), 5, $.),
fc422f3
-    io_lib:format("~s ~s", [Number, PadNu, Line]);
fc422f3
-out_line(Number, _, Line) ->
fc422f3
-    PadNu = string:right(integer_to_list(Number), 5, $.),
fc422f3
-    io_lib:format("~s ~s", [Number, PadNu, Line]).
fc422f3
-
fc422f3
-%% @private
fc422f3
-datas_match([], _) -> {false, []};
fc422f3
-datas_match([{{_, Line}, CC} | Datas], LineNumber) when Line == LineNumber -> {{true, CC}, Datas};
fc422f3
-datas_match(Data, _) -> {false, Data}.
fc422f3
-
fc422f3
-%% @private
fc422f3
-find_source(Module) when is_atom(Module) ->
fc422f3
-    Root = filename:rootname(Module),
fc422f3
-    Dir = filename:dirname(Root),
fc422f3
-    XDir = case os:getenv("SRC") of false -> "src"; X -> X end,
fc422f3
-    find_source([
fc422f3
-        filename:join([Dir, Root ++ ".erl"]),
fc422f3
-        filename:join([Dir, "..", "src", Root ++ ".erl"]),
fc422f3
-        filename:join([Dir, "src", Root ++ ".erl"]),
fc422f3
-        filename:join([Dir, "elibs", Root ++ ".erl"]),
fc422f3
-        filename:join([Dir, "..", "elibs", Root ++ ".erl"]),
fc422f3
-        filename:join([Dir, XDir, Root ++ ".erl"])
fc422f3
-    ]);
fc422f3
-find_source([]) -> none;
fc422f3
-find_source([Test | Tests]) ->
fc422f3
-    case filelib:is_file(Test) of
fc422f3
-        true -> Test;
fc422f3
-        false -> find_source(Tests)
fc422f3
-    end.
fc422f3
-
fc422f3
-%% @private
fc422f3
-header(Module, Good, Bad) ->
fc422f3
-    io:format("Good ~p~n", [Good]),
fc422f3
-    io:format("Bad ~p~n", [Bad]),
fc422f3
-    CovPer = round((Good / (Good + Bad)) * 100),
fc422f3
-    UnCovPer = round((Bad / (Good + Bad)) * 100),
fc422f3
-    io:format("CovPer ~p~n", [CovPer]),
fc422f3
-    io_lib:format("
fc422f3
-        <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
fc422f3
-          <head>
fc422f3
-            <title>~s - C0 code coverage information</title>
fc422f3
-            <style type='text/css'>body { background-color: rgb(240, 240, 245); }</style>
fc422f3
-            <style type='text/css'>span.marked0 {
fc422f3
-     background-color: rgb(185, 210, 200);
fc422f3
-     display: block;
fc422f3
-    }
fc422f3
-    span.marked { display: block; background-color: #ffffff; }
fc422f3
-    span.highlight { display: block; background-color: #fff9d7; }
fc422f3
-    span.covered { display: block; background-color: #f7f7f7 ; }
fc422f3
-    span.uncovered { display: block; background-color: #ffebe8 ; }
fc422f3
-    span.overview {
fc422f3
-     border-bottom: 1px solid #E2E6EF; 
fc422f3
-    }
fc422f3
-    div.overview {
fc422f3
-     border-bottom: 1px solid #E2E6EF; 
fc422f3
-    }
fc422f3
-    body {
fc422f3
-     font-family: verdana, arial, helvetica;
fc422f3
-    }
fc422f3
-    div.footer {
fc422f3
-     font-size: 68%;
fc422f3
-     margin-top: 1.5em;
fc422f3
-    }
fc422f3
-    h1, h2, h3, h4, h5, h6 {
fc422f3
-     margin-bottom: 0.5em;
fc422f3
-    }
fc422f3
-    h5 {
fc422f3
-     margin-top: 0.5em;
fc422f3
-    }
fc422f3
-    .hidden {
fc422f3
-     display: none;
fc422f3
-    }
fc422f3
-    div.separator {
fc422f3
-     height: 10px;
fc422f3
-    }
fc422f3
-    table.percent_graph {
fc422f3
-     height: 12px;
fc422f3
-     border: 1px solid #E2E6EF; 
fc422f3
-     empty-cells: show;
fc422f3
-    }
fc422f3
-    table.percent_graph td.covered {
fc422f3
-     height: 10px;
fc422f3
-     background: #00f000;
fc422f3
-    }
fc422f3
-    table.percent_graph td.uncovered {
fc422f3
-     height: 10px;
fc422f3
-     background: #e00000;
fc422f3
-    }
fc422f3
-    table.percent_graph td.NA {
fc422f3
-     height: 10px;
fc422f3
-     background: #eaeaea;
fc422f3
-    }
fc422f3
-    table.report {
fc422f3
-     border-collapse: collapse;
fc422f3
-     width: 100%;
fc422f3
-    }
fc422f3
-    table.report td.heading {
fc422f3
-     background: #dcecff;
fc422f3
-     border: 1px solid #E2E6EF; 
fc422f3
-     font-weight: bold;
fc422f3
-     text-align: center;
fc422f3
-    }
fc422f3
-    table.report td.heading:hover {
fc422f3
-     background: #c0ffc0;
fc422f3
-    }
fc422f3
-    table.report td.text {
fc422f3
-     border: 1px solid #E2E6EF; 
fc422f3
-    }
fc422f3
-    table.report td.value {
fc422f3
-     text-align: right;
fc422f3
-     border: 1px solid #E2E6EF; 
fc422f3
-    }
fc422f3
-    table.report tr.light {
fc422f3
-     background-color: rgb(240, 240, 245);
fc422f3
-    }
fc422f3
-    table.report tr.dark {
fc422f3
-     background-color: rgb(230, 230, 235);
fc422f3
-    }
fc422f3
-    </style>
fc422f3
-          </head>
fc422f3
-          <body>
fc422f3
-            

C0 code coverage information

fc422f3
-            

Generated on ~s with etap 0.3.4.

fc422f3
-            

fc422f3
-        
fc422f3
-          
fc422f3
-            
fc422f3
-              Name
fc422f3
-              Total lines
fc422f3
-              Lines of code
fc422f3
-              Total coverage
fc422f3
-              Code coverage
fc422f3
-            
fc422f3
-          
fc422f3
-          
fc422f3
-            
fc422f3
-
fc422f3
-              
fc422f3
-                ~s
fc422f3
-              
fc422f3
-              
fc422f3
-                <tt>??</tt>
fc422f3
-              
fc422f3
-              
fc422f3
-                <tt>??</tt>
fc422f3
-              
fc422f3
-              
fc422f3
-                <tt>??</tt>
fc422f3
-              
fc422f3
-              
fc422f3
-                
fc422f3
-                  
fc422f3
-                    <tt>~p%</tt> 
fc422f3
-                      
fc422f3
-                      
fc422f3
-                      
fc422f3
-                    
fc422f3
-                  
fc422f3
-                
fc422f3
-              
fc422f3
-            
fc422f3
-          
fc422f3
-        
", [Module, etap:datetime({date(), time()}), atom_to_list(Module) ++ "_report.html", Module, CovPer, CovPer, UnCovPer]).
fc422f3
-
fc422f3
-%% @private
fc422f3
-footer() ->
fc422f3
-    "

Generated using etap 0.3.4.

fc422f3
-          </body>
fc422f3
-        </html>
fc422f3
-    ".
fc422f3
diff --git a/src/etap/etap_request.erl b/src/etap/etap_request.erl
fc422f3
deleted file mode 100644
fc422f3
index 9fd23ac..0000000
fc422f3
--- a/src/etap/etap_request.erl
fc422f3
+++ /dev/null
fc422f3
@@ -1,89 +0,0 @@
fc422f3
-%% Copyright (c) 2008-2009 Nick Gerakines <nick@gerakines.net>
fc422f3
-%% 
fc422f3
-%% Permission is hereby granted, free of charge, to any person
fc422f3
-%% obtaining a copy of this software and associated documentation
fc422f3
-%% files (the "Software"), to deal in the Software without
fc422f3
-%% restriction, including without limitation the rights to use,
fc422f3
-%% copy, modify, merge, publish, distribute, sublicense, and/or sell
fc422f3
-%% copies of the Software, and to permit persons to whom the
fc422f3
-%% Software is furnished to do so, subject to the following
fc422f3
-%% conditions:
fc422f3
-%% 
fc422f3
-%% The above copyright notice and this permission notice shall be
fc422f3
-%% included in all copies or substantial portions of the Software.
fc422f3
-%% 
fc422f3
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
fc422f3
-%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
fc422f3
-%% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
fc422f3
-%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
fc422f3
-%% HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
fc422f3
-%% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
fc422f3
-%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
fc422f3
-%% OTHER DEALINGS IN THE SOFTWARE.
fc422f3
-%%
fc422f3
-%% @doc Provides test functionality against a specific web request. Many of
fc422f3
-%% the exported methods can be used to build your own more complex tests.
fc422f3
--module(etap_request, [Method, Url, InHeaders, InBody, Status, OutHeaders, OutBody]).
fc422f3
-
fc422f3
--export([status_is/2]).
fc422f3
-
fc422f3
--export([
fc422f3
-    method/0, url/0, status/0, status_code/0, status_line/0, rheaders/0,
fc422f3
-    has_rheader/1, rheader/1, rbody/0, header_is/3, body_is/2,
fc422f3
-    body_has_string/2
fc422f3
-]).
fc422f3
-
fc422f3
-% ---
fc422f3
-% Tests
fc422f3
-
fc422f3
-%% @doc Assert that response status code is the given status code.
fc422f3
-status_is(Code, Desc) ->
fc422f3
-    etap:is(status_code(), Code, Desc).
fc422f3
-
fc422f3
-header_is(Name, Value, Desc) ->
fc422f3
-    etap:is(rheader(Name), Value, Desc).
fc422f3
-
fc422f3
-body_is(Value, Desc) ->
fc422f3
-    etap:is(rbody(), Value, Desc).
fc422f3
-
fc422f3
-body_has_string(String, Desc) when is_list(OutBody), is_list(String) ->
fc422f3
-    etap_string:contains_ok(OutBody, String, Desc).
fc422f3
-
fc422f3
-% ---
fc422f3
-% Accessor functions
fc422f3
-
fc422f3
-%% @doc Access a request's method.
fc422f3
-method() -> Method.
fc422f3
-
fc422f3
-%% @doc Access a request's URL.
fc422f3
-url() -> Url.
fc422f3
-
fc422f3
-%% @doc Access a request's status.
fc422f3
-status() -> Status.
fc422f3
-
fc422f3
-%% @doc Access a request's status code.
fc422f3
-status_code() ->
fc422f3
-    {_, Code, _} = Status,
fc422f3
-    Code.
fc422f3
-
fc422f3
-%% @doc Access a request's status line.
fc422f3
-status_line() ->
fc422f3
-    {_, _, Line} = Status,
fc422f3
-    Line.
fc422f3
-
fc422f3
-%% @doc Access a request's headers.
fc422f3
-rheaders() -> OutHeaders.
fc422f3
-
fc422f3
-%% @doc Dertermine if a specific request header exists.
fc422f3
-has_rheader(Key) ->
fc422f3
-    lists:keymember(Key, 1, OutHeaders).
fc422f3
-
fc422f3
-%% @doc Return a specific request header.
fc422f3
-rheader(Key) ->
fc422f3
-    case lists:keysearch(Key, 1, OutHeaders) of
fc422f3
-        false -> undefined;
fc422f3
-        {value, {Key, Value}} -> Value
fc422f3
-    end.
fc422f3
-
fc422f3
-%% @doc Access the request's body.
fc422f3
-rbody() -> OutBody.
fc422f3
diff --git a/src/etap/etap_string.erl b/src/etap/etap_string.erl
fc422f3
deleted file mode 100644
fc422f3
index 67aa3d5..0000000
fc422f3
--- a/src/etap/etap_string.erl
fc422f3
+++ /dev/null
fc422f3
@@ -1,47 +0,0 @@
fc422f3
-%% Copyright (c) 2008-2009 Nick Gerakines <nick@gerakines.net>
fc422f3
-%% 
fc422f3
-%% Permission is hereby granted, free of charge, to any person
fc422f3
-%% obtaining a copy of this software and associated documentation
fc422f3
-%% files (the "Software"), to deal in the Software without
fc422f3
-%% restriction, including without limitation the rights to use,
fc422f3
-%% copy, modify, merge, publish, distribute, sublicense, and/or sell
fc422f3
-%% copies of the Software, and to permit persons to whom the
fc422f3
-%% Software is furnished to do so, subject to the following
fc422f3
-%% conditions:
fc422f3
-%% 
fc422f3
-%% The above copyright notice and this permission notice shall be
fc422f3
-%% included in all copies or substantial portions of the Software.
fc422f3
-%% 
fc422f3
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
fc422f3
-%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
fc422f3
-%% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
fc422f3
-%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
fc422f3
-%% HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
fc422f3
-%% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
fc422f3
-%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
fc422f3
-%% OTHER DEALINGS IN THE SOFTWARE.
fc422f3
-%%
fc422f3
-%% @author Nick Gerakines <nick@gerakines.net> [http://socklabs.com/]
fc422f3
-%% @copyright 2008 Nick Gerakines
fc422f3
-%% @doc Provide testing functionality for strings.
fc422f3
--module(etap_string).
fc422f3
-
fc422f3
--export([contains_ok/3, is_before/4]).
fc422f3
-
fc422f3
-%% @spec contains_ok(string(), string(), string()) -> true | false
fc422f3
-%% @doc Assert that a string is contained in another string.
fc422f3
-contains_ok(Source, String, Desc) ->
fc422f3
-    etap:isnt(
fc422f3
-        string:str(Source, String),
fc422f3
-        0,
fc422f3
-        Desc
fc422f3
-    ).
fc422f3
-
fc422f3
-%% @spec is_before(string(), string(), string(), string()) -> true | false
fc422f3
-%% @doc Assert that a string comes before another string within a larger body.
fc422f3
-is_before(Source, StringA, StringB, Desc) ->
fc422f3
-    etap:is_greater(
fc422f3
-        string:str(Source, StringB),
fc422f3
-        string:str(Source, StringA),
fc422f3
-        Desc
fc422f3
-    ).
fc422f3
diff --git a/src/etap/etap_web.erl b/src/etap/etap_web.erl
fc422f3
deleted file mode 100644
fc422f3
index fb7aee1..0000000
fc422f3
--- a/src/etap/etap_web.erl
fc422f3
+++ /dev/null
fc422f3
@@ -1,65 +0,0 @@
fc422f3
-%% Copyright (c) 2008-2009 Nick Gerakines <nick@gerakines.net>
fc422f3
-%% 
fc422f3
-%% Permission is hereby granted, free of charge, to any person
fc422f3
-%% obtaining a copy of this software and associated documentation
fc422f3
-%% files (the "Software"), to deal in the Software without
fc422f3
-%% restriction, including without limitation the rights to use,
fc422f3
-%% copy, modify, merge, publish, distribute, sublicense, and/or sell
fc422f3
-%% copies of the Software, and to permit persons to whom the
fc422f3
-%% Software is furnished to do so, subject to the following
fc422f3
-%% conditions:
fc422f3
-%% 
fc422f3
-%% The above copyright notice and this permission notice shall be
fc422f3
-%% included in all copies or substantial portions of the Software.
fc422f3
-%% 
fc422f3
-%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
fc422f3
-%% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
fc422f3
-%% OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
fc422f3
-%% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
fc422f3
-%% HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
fc422f3
-%% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
fc422f3
-%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
fc422f3
-%% OTHER DEALINGS IN THE SOFTWARE.
fc422f3
-%%
fc422f3
-%% @author Nick Gerakines <nick@gerakines.net> [http://socklabs.com/]
fc422f3
-%% @copyright 2008 Nick Gerakines
fc422f3
-%% @todo Support cookies.
fc422f3
-%% @doc Provide testing functionality for web requests.
fc422f3
--module(etap_web).
fc422f3
-
fc422f3
--export([simple_200/2, simple_404/2, build_request/4]).
fc422f3
-
fc422f3
-%% @doc Fetch a url and verify that it returned a 200 status.
fc422f3
-simple_200(Url, Desc) ->
fc422f3
-    Request = build_request(get, Url, [], []),
fc422f3
-    Request:status_is(200, Desc).
fc422f3
-
fc422f3
-%% @doc Fetch a url and verify that it returned a 404 status.
fc422f3
-simple_404(Url, Desc) ->
fc422f3
-    Request = build_request(get, Url, [], []),
fc422f3
-    Request:status_is(404, Desc).
fc422f3
-
fc422f3
-%% @doc Create and return a request structure.
fc422f3
-build_request(Method, Url, Headers, Body) 
fc422f3
- when Method==options;Method==get;Method==head;Method==delete;Method==trace ->
fc422f3
-     try http:request(Method, {Url, Headers}, [{autoredirect, false}], []) of
fc422f3
-        {ok, {OutStatus, OutHeaders, OutBody}} ->
fc422f3
-            etap_request:new(Method, Url, Headers, Body, OutStatus, OutHeaders, OutBody);
fc422f3
-        _ -> error
fc422f3
-    catch
fc422f3
-        _:_ -> error
fc422f3
-    end;
fc422f3
-
fc422f3
-%% @doc Create and return a request structure.
fc422f3
-build_request(Method, Url, Headers, Body) when Method == post; Method == put ->
fc422f3
-    ContentType = case lists:keysearch("Content-Type", 1, Headers) of
fc422f3
-        {value, {"Content-Type", X}} -> X;
fc422f3
-        _ -> []
fc422f3
-    end,
fc422f3
-    try http:request(Method, {Url, Headers, ContentType, Body}, [{autoredirect, false}], []) of
fc422f3
-        {ok, {OutStatus, OutHeaders, OutBody}} ->
fc422f3
-            etap_request:new(Method, Url, Headers, Body, OutStatus, OutHeaders, OutBody);
fc422f3
-        _ -> error
fc422f3
-    catch
fc422f3
-        _:_ -> error
fc422f3
-    end.
fc422f3
diff --git a/test/etap/test_util.erl.in b/test/etap/test_util.erl.in
fc422f3
index 79b0417..c57d7a8 100644
fc422f3
--- a/test/etap/test_util.erl.in
fc422f3
+++ b/test/etap/test_util.erl.in
fc422f3
@@ -22,7 +22,7 @@ builddir() ->
fc422f3
     "@abs_top_builddir@".
fc422f3
 
fc422f3
 init_code_path() ->
fc422f3
-    Paths = ["etap", "couchdb", "ibrowse", "mochiweb"],
fc422f3
+    Paths = ["couchdb", "ibrowse", "mochiweb"],
fc422f3
     lists:foreach(fun(Name) ->
fc422f3
         code:add_pathz(filename:join([builddir(), "src", Name]))
fc422f3
     end, Paths).
9859a2c
-- 
9859a2c
1.6.6.1
9859a2c