Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "Fixing bug in etap_can documentation. Adding framewerk files …

…and components."

This reverts commit aa961b2.
  • Loading branch information...
commit 46e21935b848be35661ed219fc768d5b84c183fe 1 parent f192c63
@ngerakines ngerakines authored
Showing with 242 additions and 196 deletions.
  1. +0 −3  AUTHORS
  2. +32 −0 Makefile
  3. +0 −1  Makefile.am.local
  4. +0 −17 bootstrap
  5. +0 −2  configure.ac.local
  6. +0 −1  fw-pkgin/Makefile.am.local
  7. +0 −55 fw-pkgin/config
  8. +0 −9 fw-pkgin/post-install
  9. +0 −9 fw-pkgin/post-remove
  10. +0 −9 fw-pkgin/pre-install
  11. +0 −9 fw-pkgin/pre-remove
  12. +0 −10 fw-pkgin/start
  13. +0 −10 fw-pkgin/stop
  14. +18 −0 scripts/collect.erl
  15. +16 −0 src/Makefile
  16. +0 −14 src/Makefile.am.local
  17. +10 −1 src/etap_can.erl
  18. +75 −0 src/overview.edoc
  19. +38 −0 support/include.mk
  20. +12 −0 t/Makefile
  21. +29 −0 t/etap_t_001.erl
  22. +1 −1  {tests → t}/etap_t_001.t
  23. 0  {tests → t}/etap_t_002.erl
  24. +1 −1  {tests → t}/etap_t_002.t
  25. 0  {tests → t}/etap_t_003.erl
  26. +1 −1  {tests → t}/etap_t_003.t
  27. 0  {tests → t}/etap_t_004.erl
  28. +1 −1  {tests → t}/etap_t_004.t
  29. 0  {tests → t}/etap_t_005.erl
  30. +1 −1  {tests → t}/etap_t_005.t
  31. 0  {tests → t}/etap_t_006.erl
  32. +1 −1  {tests → t}/etap_t_006.t
  33. 0  {tests → t}/etap_t_008.erl
  34. +1 −1  {tests → t}/etap_t_008.t
  35. 0  {tests → t}/etap_t_009.erl
  36. +1 −1  {tests → t}/etap_t_009.t
  37. 0  {tests → t}/etap_t_010.erl
  38. +1 −1  {tests → t}/etap_t_010.t
  39. 0  {tests → t}/etap_t_011.erl
  40. +1 −1  {tests → t}/etap_t_011.t
  41. 0  {tests → t}/etap_t_012.erl
  42. +1 −1  {tests → t}/etap_t_012.t
  43. 0  {tests → t}/etap_t_013.erl
  44. +1 −1  {tests → t}/etap_t_013.t
  45. +0 −2  tests/Makefile.am.local
  46. +0 −29 tests/etap_t_001.erl
  47. +0 −3  tests/runtests.sh
View
3  AUTHORS
@@ -1,3 +0,0 @@
-Nick Gerakines
-Jeremy Wall
-Jacob Vorreuter
View
32 Makefile
@@ -0,0 +1,32 @@
+LIBDIR=`erl -eval 'io:format("~s~n", [code:lib_dir()])' -s init stop -noshell`
+.PHONY: doc
+VERSION=0.3.4
+
+all:
+ mkdir -p ebin
+ (cd src;$(MAKE))
+
+doc:
+ (cd src; $(MAKE) doc)
+
+test: all
+ (cd t;$(MAKE))
+ (cd t;$(MAKE) test)
+
+prove: all
+ (cd t;$(MAKE))
+ prove t/*.t
+
+clean:
+ (cd src;$(MAKE) clean)
+ (cd t;$(MAKE) clean)
+ rm -rf cover/
+
+package: clean
+ @mkdir etap-$(VERSION)/ && cp -rf ChangeLog Makefile README.markdown scripts src support t etap-$(VERSION)
+ @COPYFILE_DISABLE=true tar zcf etap-$(VERSION).tgz etap-$(VERSION)
+ @rm -rf etap-$(VERSION)/
+
+install:
+ mkdir -p $(prefix)/$(LIBDIR)/etap-$(VERSION)/ebin
+ for i in ebin/*.beam; do install $$i $(prefix)/$(LIBDIR)/etap-$(VERSION)/$$i ; done
View
1  Makefile.am.local
@@ -1 +0,0 @@
-# put whatever (auto)make commands here, they will be included from Makefile.am
View
17 bootstrap
@@ -1,17 +0,0 @@
-#! /bin/sh
-
-if test -d fw/bin
- then
- PATH="`pwd`/fw/bin:$PATH"
- export PATH
- fi
-
-fwb=`which fw-bootstrap`
-
-if test -z "$fwb"
- then
- echo "bootstrap: fatal: fw-bootstrap not installed or not in PATH" 1>&2
- exit 1
- fi
-
-"$fwb" --fw_version "0.1.31" --name etap --revision none --template erlang "$@"
View
2  configure.ac.local
@@ -1,2 +0,0 @@
-dnl -- include additional autoconf commands here
-dnl -- do not include AC_OUTPUT, this is called for you
View
1  fw-pkgin/Makefile.am.local
@@ -1 +0,0 @@
-# put whatever (auto)make commands here, they will be included from Makefile.am
View
55 fw-pkgin/config
@@ -1,55 +0,0 @@
-# The FW_PACKAGE_MAINTAINER field is populated with the
-# environment variable FW_PACKAGE_DEFAULT_MAINTAINER if non-empty
-
-FW_PACKAGE_NAME="etap"
-FW_PACKAGE_VERSION="0.3.4"
-FW_PACKAGE_MAINTAINER="Nick Gerakines <nick@gerakines.net>"
-FW_PACKAGE_SHORT_DESCRIPTION="A TAP testing module for Erlang components and applications."
-FW_PACKAGE_DESCRIPTION=`cat README.markdown`
-FW_PACKAGE_ARCHITECTURE_DEPENDENT="0"
-
-# Dependency information. The native syntax corresponds to Debian,
-# http://www.debian.org/doc/debian-policy/ch-relationships.html
-# Section 7.1 "Syntax of Relationship Fields"
-#
-# For other packaging systems, the syntax is translated for you.
-
-FW_PACKAGE_DEPENDS=""
-FW_PACKAGE_CONFLICTS=""
-FW_PACKAGE_PROVIDES=""
-FW_PACKAGE_REPLACES=""
-FW_PACKAGE_SUGGESTS=""
-
-FW_PACKAGE_BUILD_DEPENDS=""
-FW_PACKAGE_BUILD_CONFLICTS=""
-# uncomment and set manually for native hipe compilation
-# ERLCFLAGS="-smp +native +\"{hipe,[o2,verbose]}\""
-
-# uncomment and set manually if autodetection of modules is incorrect
-# FW_ERL_APP_MODULES=""
-
-# uncomment and set manually if autodetection of registered processes is incorrect
-# FW_ERL_APP_REGISTERED=""
-
-# uncomment and set manually if autodetection of start module is incorrect
-# FW_ERL_APP_START_MODULE=""
-
-# uncomment to define start args to the start module. should be an erlang
-# expression which evaluates to a list.
-# FW_ERL_APP_START_ARGS="[]"
-
-# uncomment if the module line being generated is incorrect and you want
-# to override it.
-# FW_ERL_APP_MOD_LINE="{ mod, { $FW_ERL_APP_START_MODULE, $FW_ERL_APP_START_ARGS } },"
-
-# uncomment to define the application environment variables. should be an
-# erlang expression which evaluates to a list.
-# FW_ERL_APP_ENVIRONMENT="[]"
-
-# uncomment to indicate additional OTP applications (besides kernel and stdlib)
-# that this application depends upon, comma-separated
-# FW_ERL_PREREQ_APPLICATIONS_EXTRA=""
-
-# uncomment to add arbitrary extra content to the app file, e.g., an
-# included application directive.
-# FW_ERL_APP_EXTRA=""
View
9 fw-pkgin/post-install
@@ -1,9 +0,0 @@
-#! /bin/sh
-
-#---------------------------------------------------------------------
-# post-install
-#
-# Executed after the package is installed.
-#---------------------------------------------------------------------
-
-exit 0
View
9 fw-pkgin/post-remove
@@ -1,9 +0,0 @@
-#! /bin/sh
-
-#---------------------------------------------------------------------
-# post-remove
-#
-# Executed after the package is removed.
-#---------------------------------------------------------------------
-
-exit 0
View
9 fw-pkgin/pre-install
@@ -1,9 +0,0 @@
-#! /bin/sh
-
-#---------------------------------------------------------------------
-# pre-install
-#
-# Executed before the package is installed.
-#---------------------------------------------------------------------
-
-exit 0
View
9 fw-pkgin/pre-remove
@@ -1,9 +0,0 @@
-#! /bin/sh
-
-#---------------------------------------------------------------------
-# pre-remove
-#
-# Executed before the package is removed.
-#---------------------------------------------------------------------
-
-exit 0
View
10 fw-pkgin/start
@@ -1,10 +0,0 @@
-#! /bin/sh
-
-#---------------------------------------------------------------------
-# start
-#
-# Executed when the package (service) is started up.
-# Not supported by all package formats.
-#---------------------------------------------------------------------
-
-exit 0
View
10 fw-pkgin/stop
@@ -1,10 +0,0 @@
-#! /bin/sh
-
-#---------------------------------------------------------------------
-# start
-#
-# Executed when the package (service) is shut down.
-# Not supported by all package formats.
-#---------------------------------------------------------------------
-
-exit 0
View
18 scripts/collect.erl
@@ -0,0 +1,18 @@
+#!/usr/bin/env escript
+%% -*- erlang -*-
+%%! -noshell
+
+%% @doc Takes the coverdata files generated by the cover module and creates
+%% reports out of them. Each module analysed by the system generates an
+%% X_coverage.txt file.
+main(_) ->
+ [cover:import(File) || File <- filelib:wildcard("*.coverdata")],
+ lists:foreach(
+ fun(Module) ->
+ cover:analyse_to_file(
+ Module, atom_to_list(Mod) ++ "_coverage.txt", []
+ )
+ end,
+ cover:imported_modules()
+ ).
+
View
16 src/Makefile
@@ -0,0 +1,16 @@
+include ../support/include.mk
+
+all: $(EBIN_FILES)
+
+doc:
+ mkdir -p $(DOC_DIR)
+ $(ERL) -noshell -run edoc files $(ERL_SOURCES) -run init stop
+ mv *.html *.png *.css $(DOC_DIR)
+
+debug:
+ $(MAKE) DEBUG=-DDEBUG
+
+clean:
+ rm -rf $(EBIN_FILES)
+ rm -rf edoc-info
+ rm -rf $(DOC_DIR)
View
14 src/Makefile.am.local
@@ -1,14 +0,0 @@
-# put whatever (auto)make commands here, they will be included from Makefile.am
-
-dist_erlappsrc_DATA = \
- $(wildcard *.erl)
-
-dist_erlappinclude_DATA = \
- $(wildcard *.hrl)
-
-erlappebin_SCRIPTS = \
- @FW_PACKAGE_NAME@.app \
- $(patsubst %.erl, %.beam, $(dist_erlappsrc_DATA))
-
-# check_DATA = \
-# .dialyzer_ok
View
11 src/etap_can.erl
@@ -59,12 +59,21 @@ has_attrib(M, A) when is_atom(M), is_atom(A) ->
lists:concat([M, " has attribute ", A])
).
-is_attrib(M, A, V) when is_atom(M), is_atom(A) ->
+%% @spec has_attrib(M, A. V) -> true | false
+%% M = atom()
+%% A = atom()
+%% V = any()
+%% @doc Asserts that a module has a given attribute with a given value.
+is_attrib(M, A, V) when is_atom(M) andalso is_atom(A) ->
etap:is(
proplists:get_value(A, M:module_info(attributes)),
[V],
lists:concat([M, "'s ", A, " is ", V])
).
+%% @spec is_behavior(M, B) -> true | false
+%% M = atom()
+%% B = atom()
+%% @doc Asserts that a given module has a specific behavior.
is_behaviour(M, B) when is_atom(M) andalso is_atom(B) ->
is_attrib(M, behaviour, B).
View
75 src/overview.edoc
@@ -0,0 +1,75 @@
+
+@title A TAP testing client.
+@author Nick Gerakines <nick@gerakines.net>
+@author Jeremy Wall <jeremy@marzhillstudios.com>
+@version 0.3.4
+@doc A TAP testing client.
+
+<p>etap is a collection of Erlang modules that provide a TAP testing client library. These modules allow developers to create extensive and comprehensive tests covering many aspects of application and module development. This includes simple assertions, exceptions, the application behavior and event web requests. This library was originally written by Jeremy wall.</p>
+<p>As per the TAP wiki:</p>
+<blockquote>TAP, the Test Anything Protocol, is a simple text-based interface between testing modules in a test harness. TAP started life as part of the test harness for Perl but now has implementations in C/C++, Python, PHP, Perl and probably others by the time you read this.</blockquote>
+<p>These modules are not meant to compete with eunit, but to offer a more general testing facility that isn't provides by eunit.</p>
+<pre><code>http://en.wikipedia.org/wiki/Test_Anything_Protocol
+http://testanything.org/wiki/index.php/Main_Page
+</code></pre>
+
+<h1>CREATING TESTS</h1>
+
+<p>A test is any number of etap:* or etap_*:* tests that are part of a test plan. When a plan is created using etap:plan/1, a process is started that tracks the status of the tests executed and handles diagnostic output.</p>
+<p>Consider the following example test plan:</p>
+<pre><code>etap:plan(3),
+etap:ok(true, "the 'true' atom is recognized"),
+etap:is(1 + 1, 2, "simple math"),
+etap:isnt(2 + 2, 5, "some would argue"),
+etap:end_tests().
+</code></pre>
+<p>At this time, etap does not support pattern matching. To work around this there are a number of utility tests that can be used. The etap:any/3, etap:none/3 and etap:fun_is/3 use functions to return either <code>true</code> or <code>false</code>.</p>
+<pre><code>Numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9],
+FunWithNumbers = fun(X) case X of [1, 2, 3 | _] -&gt; true; _ -&gt; false end end,
+etap:fun_is(FunWithNumbers, Numbers, "Match the first three numbers").
+</code></pre>
+
+<p>There are many examples in t/*.erl.</p>
+
+<h1>BUILD &amp; INSTALL</h1>
+
+<p>To build this library, from the root directory execute the <code>make</code> command. You should also execute the <code>make test</code> command to verify that the library functions correctly on your system. If you have the Perl module TAP::Harness you can use it to collect and display test results using the <code>make prove</code> target.</p>
+
+<pre><code>$ make
+$ make test
+$ make prove
+</code></pre>
+
+<p>If you choose to run the <code>make test</code> command then please be sure to <code>make clean</code> after to remove any of the temporary beam files created by the tests in the <code>t/</code> directory.</p>
+
+<p>The included tests cover the basic functionality of the etap modules. They can also be used as a reference when writing your own tests. </p>
+
+<p>To install etap you need to create the <code>etap/ebin/</code> directory in your current Erlang library and copy all of the .beam files created by the <code>make</code> file.</p>
+
+<pre><code>$ sudo mkdir -p /usr/lib/erlang/lib/etap-0.3.4/ebin
+$ make clean &amp;&amp; make
+$ sudo cp ebin/*.beam /usr/lib/erlang/lib/etap-0.3.4/ebin/
+</code></pre>
+
+<p>The <code>make dist-src</code> target can be used to create source distributions for further packaging and deployment.</p>
+
+<h1>SUPPORTED FUNCTIONALITY</h1>
+
+<p>There are a number of proposals listed on the TAP wiki that are not supported by this library. Please be aware of this when creating your tests.</p>
+
+<ul>
+<li>LIMITED SUPPORTED: TAP diagnostic syntax</li>
+<li>LIMITED SUPPORTED: TAP meta information</li>
+<li>LIMITED SUPPORTED: TAP logging syntax</li>
+<li>NOT SUPPORTED: Test groups</li>
+<li>NOT SUPPORTED: Test blocks</li>
+<li>LIMITED SUPPORTED: SKIP</li>
+<li>NOT SUPPORTED: TODO</li>
+<li>LIMITED SUPPORTED: TAP datetime</li>
+</ul>
+
+<h1>CREDITS</h1>
+
+<p>2008 Nick Gerakines<br />
+2007-2008 Jeremy Wall<br />
+2008 Jacob Vorreuter</p>
View
38 support/include.mk
@@ -0,0 +1,38 @@
+## -*- makefile -*-
+
+ERL := erl
+ERLC := $(ERL)c
+
+INCLUDE_DIRS := ../include
+DOC_DIR := ../doc
+EBIN_DIRS :=
+ERLC_FLAGS := -W $(INCLUDE_DIRS:../%=-I ../%) $(EBIN_DIRS:%=-pa %)
+
+ifndef no_debug_info
+ ERLC_FLAGS += +debug_info
+endif
+
+ifdef debug
+ ERLC_FLAGS += -Ddebug
+endif
+
+EBIN_DIR := ../ebin
+EMULATOR := beam
+
+ERL_SOURCES := $(wildcard *.erl)
+ERL_DOCS := $(wildcard *.erl) $(wildcard *.edoc)
+ERL_HEADERS := $(wildcard *.hrl) $(wildcard ../include/*.hrl)
+ERL_OBJECTS := $(ERL_SOURCES:%.erl=$(EBIN_DIR)/%.$(EMULATOR))
+ERL_OBJECTS_LOCAL := $(ERL_SOURCES:%.erl=./%.$(EMULATOR))
+APP_FILES := $(wildcard *.app)
+EBIN_FILES = $(ERL_OBJECTS) $(APP_FILES:%.app=../ebin/%.app)
+MODULES = $(ERL_SOURCES:%.erl=%)
+
+../ebin/%.app: %.app
+ cp $< $@
+
+$(EBIN_DIR)/%.$(EMULATOR): %.erl
+ $(ERLC) $(ERLC_FLAGS) -o $(EBIN_DIR) $<
+
+./%.$(EMULATOR): %.erl
+ $(ERLC) $(ERLC_FLAGS) -o . $<
View
12 t/Makefile
@@ -0,0 +1,12 @@
+include ../support/include.mk
+
+all: $(EBIN_FILES)
+
+clean:
+ rm -rf $(EBIN_FILES) erl_crash.dump
+
+test: $(MODULES)
+
+./$(MODULES):
+ @echo "Running tests for $@"
+ erl -pa ../ebin -run $@ start -run init stop -noshell
View
29 t/etap_t_001.erl
@@ -0,0 +1,29 @@
+-module(etap_t_001).
+-export([start/0]).
+
+-record(tester, {xx, yy, zz}).
+
+start() ->
+ etap:plan(16),
+ etap:diag("Test the core etap module and it's functions."),
+ etap:ok(true, "Proving etap:ok/2 needs true"),
+ etap:not_ok(false, "Proving etap:not_ok/2 needs false"),
+ etap:is(1, 1, "Proving etap:is/3 must have 2 equal values"),
+ etap:isnt(1, 2, "Proving etap:isnt/3 can not have 2 equal values"),
+ etap:is_greater(3, 1, "Proving 3 is greater than 1."),
+ etap:is([foo, bar, baz], [foo, bar, baz], "Proving etap:is/3 can use complex structures"),
+ etap:isnt([foo, bar, baz], [bar, foo, baz], "Proving etap:isnt/3 can use complex structures"),
+
+ Foo = #tester{ xx = 1, yy = 2, zz = 3},
+ Bar = #tester{ xx = 4, yy = 5, zz = 6},
+
+ etap:is(Foo, Foo, "Proving etap:is/3 can use records"),
+ etap:isnt(Foo, Bar, "Proving etap:isnt/3 can use records"),
+ etap:any(fun(foo) -> true; (_)-> false end, [foo, bar, baz], "Proving etap:any/3 works with atoms"),
+ etap:any(fun({_, this}) -> true; (_)-> false end, [{1, none}, {2, all}, {3, this}], "Proving etap:any/3 works with lists of tuples"),
+ etap:any(fun([{record, value} | _]) -> true; (_)-> false end, [[{something, nothing}, {somewhere, nowhere}], [{name, nick}, {has_family, true}], [{record, value}, {term, atom}]], "Proving etap:none/3 works with simple structures"),
+ etap:none(fun(the_bitch) -> true; (_)-> false end, lists:seq(1, 99), "Proving etap:none/3 works with simple structures"),
+ etap:none(fun([{color, red} | _]) -> true; (_)-> false end, [[{something, nothing}, {somewhere, nowhere}], [{name, nick}, {has_family, true}], [{record, value}, {term, atom}]], "Proving etap:none/3 works with simple structures"),
+ etap:fun_is(fun(Expected) -> case Expected of "abc" ++ _ -> true; _ -> false end end, "abcdefg", "fun_is/3 works with simple lists"),
+ etap:fun_is(fun(Expected) -> case Expected of {foo, _} -> true; _ -> false end end, {foo, bar}, "fun_is/3 works with simple lists"),
+ etap:end_tests().
View
2  tests/etap_t_001.t → t/etap_t_001.t
@@ -1,6 +1,6 @@
#!/usr/bin/env escript
%% -*- erlang -*-
-%%! -pa ../src -sasl errlog_type error -boot start_sasl
+%%! -pa ./ebin -sasl errlog_type error -boot start_sasl -noshell
main(_) ->
etap_t_001:start().
View
0  tests/etap_t_002.erl → t/etap_t_002.erl
File renamed without changes
View
2  tests/etap_t_002.t → t/etap_t_002.t
@@ -1,6 +1,6 @@
#!/usr/bin/env escript
%% -*- erlang -*-
-%%! -pa ../src -sasl errlog_type error -boot start_sasl
+%%! -pa ./ebin -sasl errlog_type error -boot start_sasl -noshell
main(_) ->
etap_t_002:start().
View
0  tests/etap_t_003.erl → t/etap_t_003.erl
File renamed without changes
View
2  tests/etap_t_003.t → t/etap_t_003.t
@@ -1,6 +1,6 @@
#!/usr/bin/env escript
%% -*- erlang -*-
-%%! -pa ../src -sasl errlog_type error -boot start_sasl
+%%! -pa ./ebin -sasl errlog_type error -boot start_sasl -noshell
main(_) ->
etap_t_003:start().
View
0  tests/etap_t_004.erl → t/etap_t_004.erl
File renamed without changes
View
2  tests/etap_t_004.t → t/etap_t_004.t
@@ -1,6 +1,6 @@
#!/usr/bin/env escript
%% -*- erlang -*-
-%%! -pa ../src -sasl errlog_type error -boot start_sasl
+%%! -pa ./ebin -sasl errlog_type error -boot start_sasl -noshell
main(_) ->
etap_t_004:start().
View
0  tests/etap_t_005.erl → t/etap_t_005.erl
File renamed without changes
View
2  tests/etap_t_005.t → t/etap_t_005.t
@@ -1,6 +1,6 @@
#!/usr/bin/env escript
%% -*- erlang -*-
-%%! -pa ../src -sasl errlog_type error -boot start_sasl
+%%! -pa ./ebin -sasl errlog_type error -boot start_sasl -noshell
main(_) ->
etap_t_005:start().
View
0  tests/etap_t_006.erl → t/etap_t_006.erl
File renamed without changes
View
2  tests/etap_t_006.t → t/etap_t_006.t
@@ -1,6 +1,6 @@
#!/usr/bin/env escript
%% -*- erlang -*-
-%%! -pa ../src -sasl errlog_type error -boot start_sasl
+%%! -pa ./ebin -sasl errlog_type error -boot start_sasl -noshell
main(_) ->
etap_t_006:start().
View
0  tests/etap_t_008.erl → t/etap_t_008.erl
File renamed without changes
View
2  tests/etap_t_008.t → t/etap_t_008.t
@@ -1,6 +1,6 @@
#!/usr/bin/env escript
%% -*- erlang -*-
-%%! -pa ../src -sasl errlog_type error -boot start_sasl
+%%! -pa ./ebin -sasl errlog_type error -boot start_sasl -noshell
main(_) ->
etap_t_008:start().
View
0  tests/etap_t_009.erl → t/etap_t_009.erl
File renamed without changes
View
2  tests/etap_t_009.t → t/etap_t_009.t
@@ -1,6 +1,6 @@
#!/usr/bin/env escript
%% -*- erlang -*-
-%%! -pa ../src -sasl errlog_type error -boot start_sasl
+%%! -pa ./ebin -sasl errlog_type error -boot start_sasl -noshell
main(_) ->
etap_t_009:start().
View
0  tests/etap_t_010.erl → t/etap_t_010.erl
File renamed without changes
View
2  tests/etap_t_010.t → t/etap_t_010.t
@@ -1,6 +1,6 @@
#!/usr/bin/env escript
%% -*- erlang -*-
-%%! -pa ../src -sasl errlog_type error -boot start_sasl
+%%! -pa ./ebin -sasl errlog_type error -boot start_sasl -noshell
main(_) ->
etap_t_010:start().
View
0  tests/etap_t_011.erl → t/etap_t_011.erl
File renamed without changes
View
2  tests/etap_t_011.t → t/etap_t_011.t
@@ -1,6 +1,6 @@
#!/usr/bin/env escript
%% -*- erlang -*-
-%%! -pa ../src -sasl errlog_type error -boot start_sasl
+%%! -pa ./ebin -sasl errlog_type error -boot start_sasl -noshell
main(_) ->
etap_t_011:start().
View
0  tests/etap_t_012.erl → t/etap_t_012.erl
File renamed without changes
View
2  tests/etap_t_012.t → t/etap_t_012.t
@@ -1,6 +1,6 @@
#!/usr/bin/env escript
%% -*- erlang -*-
-%%! -pa ../src -sasl errlog_type error -boot start_sasl
+%%! -pa ./ebin -sasl errlog_type error -boot start_sasl -noshell
main(_) ->
etap_t_012:start().
View
0  tests/etap_t_013.erl → t/etap_t_013.erl
File renamed without changes
View
2  tests/etap_t_013.t → t/etap_t_013.t
@@ -1,6 +1,6 @@
#!/usr/bin/env escript
%% -*- erlang -*-
-%%! -pa ../src -sasl errlog_type error -boot start_sasl
+%%! -pa ./ebin -sasl errlog_type error -boot start_sasl -noshell
main(_) ->
etap_t_013:start().
View
2  tests/Makefile.am.local
@@ -1,2 +0,0 @@
-TESTS = \
- runtests.sh
View
29 tests/etap_t_001.erl
@@ -1,29 +0,0 @@
--module(etap_t_001).
--export([start/0]).
-
--record(tester, {xx, yy, zz}).
-
-start() ->
- etap:plan(16),
- etap:diag("Test the core etap module and it's functions."),
- etap:ok(true, "Proving etap:ok/2 needs true"),
- etap:not_ok(false, "Proving etap:not_ok/2 needs false"),
- etap:is(1, 1, "Proving etap:is/3 must have 2 equal values"),
- etap:isnt(1, 2, "Proving etap:isnt/3 can not have 2 equal values"),
- etap:is_greater(3, 1, "Proving 3 is greater than 1."),
- etap:is([foo, bar, baz], [foo, bar, baz], "Proving etap:is/3 can use complex structures"),
- etap:isnt([foo, bar, baz], [bar, foo, baz], "Proving etap:isnt/3 can use complex structures"),
-
- Foo = #tester{ xx = 1, yy = 2, zz = 3},
- Bar = #tester{ xx = 4, yy = 5, zz = 6},
-
- etap:is(Foo, Foo, "Proving etap:is/3 can use records"),
- etap:isnt(Foo, Bar, "Proving etap:isnt/3 can use records"),
- etap:any(fun (foo) -> true; (_)-> false end, [foo, bar, baz], "Proving etap:any/3 works with atoms"),
- etap:any(fun ({_, this}) -> true; (_)-> false end, [{1, none}, {2, all}, {3, this}], "Proving etap:any/3 works with lists of tuples"),
- etap:any(fun ([{record, value} | _]) -> true; (_)-> false end, [[{something, nothing}, {somewhere, nowhere}], [{name, nick}, {has_family, true}], [{record, value}, {term, atom}]], "Proving etap:none/3 works with simple structures"),
- etap:none(fun (the_bitch) -> true; (_)-> false end, lists:seq(1, 99), "Proving etap:none/3 works with simple structures"),
- etap:none(fun ([{color, red} | _]) -> true; (_)-> false end, [[{something, nothing}, {somewhere, nowhere}], [{name, nick}, {has_family, true}], [{record, value}, {term, atom}]], "Proving etap:none/3 works with simple structures"),
- etap:fun_is(fun (Expected) -> case Expected of "abc" ++ _ -> true; _ -> false end end, "abcdefg", "fun_is/3 works with simple lists"),
- etap:fun_is(fun (Expected) -> case Expected of {foo, _} -> true; _ -> false end end, {foo, bar}, "fun_is/3 works with simple lists"),
- etap:end_tests().
View
3  tests/runtests.sh
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-prove *.t
Please sign in to comment.
Something went wrong with that request. Please try again.