-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
94 lines (65 loc) · 3.77 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
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 <[email protected]>
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.