Simple unit testing for Erlang sources
Erlang
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
CHANGES
ISSUES
MANUAL
README
ROADMAP
SAMPLES
erlunit.erl
erlunit.hrl
quick
quick.erl
sample
sample.erl
template.erl
test
test.erl
testcodes
testtest.erl

README

Erlunit 0.2.8.2/alpha - README

------------------------------------------------------------------------o--
---ooo-ooo--o--o--o-o--o-o-ooo------------------------------------------o--
---Oo--OoO--O--O--O-Oo-O-O--O-------------------------------------------o--
---Ooo-O--O-Ooo-oo--O-oO-O--O-------------------------------------------o--
------------------------------------------------------------------------o--

 Files       : erlunit.erl, sample.erl, test.erl
 Description : Simple test functions for Erlang code
 Version     : 0.2.8.2/alpha
 Status      : alpha
 Copyright   : (c) 2010 Eonblast Corporation http://www.eonblast.com
 License     : MIT - see below 
 Author      : H. Diedrich <hd2010@eonblast.com>
 Created     : 18 Apr 2010
 Changed     : 10 May 2010 - see CHANGES
 Tested on   : Erlang R13B01

---------------------------------------------------------------------------

Download from github: http://github.com/Eonblast/Erlunit/tarball/master

For samples, see the file sample.erl. It's written to be read top down.
View it here: http://github.com/Eonblast/Erlunit/blob/master/sample.erl

For a quick check, run erl, 1> c(erlunit), c(sample), sample:sample1(). 

---------------------------------------------------------------------------


Simple Test Suite tool for Erlang
---------------------------------

"I do use a form of micro testing that is built into Erlang." - Joe Armstrong

Joe Armstrong describes how you don't really need a test frame work in many 
situations, because the pattern matching in Erlang can be used for testing:

http://armstrongonsoftware.blogspot.com/2009/01/micro-lightweight-unit-testing.html

But if you'd still like to use something a tad more baroque, yet simple, this 
package here may be a start. Best, start reading the beginning of sample.erl.
View it at: http://github.com/Eonblast/Erlunit/blob/master/sample.erl

In sample.erl you also find links to EUnit and etap, you may want to look at.

Note that this is not the 'Erlunit' that some web pages mentioned prior to 2010.


Samples
-------

	erlunit:start(),                              % initializes & prints heads
	erlunit:true(1 == 1,"1 and 1 are equal"),     % stages tests
	% more checks ...
	erlunit:execute().                            % executes & prints results

That's it. Read more in sample.erl.


Using Suites:

	erlunit:start(),                              % initializes & prints heads
	erlunit:suite("Suite 1"),                     % initialize a suite
	erlunit:true(1 == 1,"1 and 1 are equal"),     % mounts tests 
	% more checks and suites ...
	erlunit:execute().                            % executes & prints results

Suites are used for organizing tests that belong together. More in sample.erl.


License
-------

Copyright (c) 2010 Eonblast Corporation http://www.eonblast.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice, including link, and this permission notice shall 
be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.