Skip to content
This repository
Browse code

use plain rebar ct to run CT suite

  • Loading branch information...
commit 7b8219374b946c16806d5bcd025ad9404582f2ae 1 parent 802a758
Ulf Wiger authored
20 Makefile
... ... @@ -1,9 +1,4 @@
1   -.PHONY: all compile clean deps eunit test eqc docs doc
2   -
3   -DIRS=src
4   -EQC=${HOME}/lib/eqc-1.0.1
5   -
6   -BRANCH=`git branch | awk '/\*/ {print $2}'`
  1 +.PHONY: all compile clean deps eunit test docs doc
7 2
8 3 all: compile
9 4
@@ -15,21 +10,16 @@ clean:
15 10
16 11 deps:
17 12 ./rebar get-deps
  13 + ./rebar update-deps
18 14
19 15 eunit:
20 16 ./rebar eunit
21 17
22   -test/run_eqc_test.beam: test/run_eqc_test.erl
23   - erlc -W -o test test/run_eqc_test.erl
24   -
25   -test: script test/run_eqc_test.beam
26   - ./run_eqc.escript -m run_eqc_test -n 1000 -rpt error -pa test
  18 +test:
  19 + ./rebar ct
27 20
28 21 docs: doc
29 22 doc:
30 23 ./rebar doc
31   - ./mk_readme.escript doc/README.md README.md
  24 +# ./mk_readme.escript doc/README.md README.md
32 25
33   -script: compile
34   - escript ebin/run_eqc.beam generate run_eqc.escript ${EQC}
35   - chmod u+x run_eqc.escript
12 README
... ... @@ -1,12 +0,0 @@
1   -unsplit - Resolve conflicts in Mnesia tables after network split
2   -
3   -Author: Ulf Wiger, Erlang Solutions Ltd
4   -
5   -
6   -NOTE: This application is currently a fairly crude prototype,
7   - and is not intended for mission-critical tasks (yet).
8   -
9   -Documentation will follow, as soon as the approach has been
10   -verified to work. So far, no Mnesia patches are used, but
11   -for it to work really well, some added functionality in
12   -Mnesia may well be needed.
29 README.md
Source Rendered
... ... @@ -1,13 +1,9 @@
1 1
2 2
3   -<h1>The unsplit application</h1>
  3 +#unsplit - A framework for resolving Mnesia netsplits#
4 4
5   -unsplit - A framework for resolving Mnesia netsplits
6 5
7   -=====================================================
8   -.
9   -
10   -Copyright � 2010 Erlang Solutions Ltd.
  6 +Copyright (c) 2010 Erlang Solutions Ltd.
11 7
12 8 __Version:__ 0.5
13 9
@@ -72,12 +68,11 @@ and the fetched data will be handed to the merge function as:
72 68
73 69 The return value, `ret()` is defined as:
74 70
75   -
76 71 <pre>
77 72 ret() :: stop
78   -| {ok, state()}
79   -| {ok, actions(), state()}
80   -| {ok, actions(), strategy(), state()}
  73 + | {ok, state()}
  74 + | {ok, actions(), state()}
  75 + | {ok, actions(), strategy(), state()}
81 76
82 77 actions() :: [action()]
83 78
@@ -88,7 +83,6 @@ strategy() :: all_keys | {ModS, FunS}
88 83
89 84
90 85
91   -
92 86 If a custom fetch strategy function is given, it will be called as
93 87
94 88
@@ -117,14 +111,13 @@ running, but is not found on the other side. `[{[{mytab,2,a}], [{mytab,2,b}]}]`
117 111 would mean that conflicting versions of the object `{mytab,2}` were found.
118 112
119 113
120   -<h2 class="indextitle">Modules</h2>
121   -
  114 +##Modules##
122 115
123 116
124 117 <table width="100%" border="0" summary="list of modules">
125   -<tr><td><a href="unsplit/blob/master/doc/unsplit.md" class="module">unsplit</a></td></tr>
126   -<tr><td><a href="unsplit/blob/master/doc/unsplit_lib.md" class="module">unsplit_lib</a></td></tr>
127   -<tr><td><a href="unsplit/blob/master/doc/unsplit_reporter.md" class="module">unsplit_reporter</a></td></tr>
128   -<tr><td><a href="unsplit/blob/master/doc/unsplit_server.md" class="module">unsplit_server</a></td></tr>
129   -<tr><td><a href="unsplit/blob/master/doc/unsplit_vclock.md" class="module">unsplit_vclock</a></td></tr></table>
  118 +<tr><td><a href="http://github.com/esl/unsplit/blob/master/doc/unsplit.md" class="module">unsplit</a></td></tr>
  119 +<tr><td><a href="http://github.com/esl/unsplit/blob/master/doc/unsplit_lib.md" class="module">unsplit_lib</a></td></tr>
  120 +<tr><td><a href="http://github.com/esl/unsplit/blob/master/doc/unsplit_reporter.md" class="module">unsplit_reporter</a></td></tr>
  121 +<tr><td><a href="http://github.com/esl/unsplit/blob/master/doc/unsplit_server.md" class="module">unsplit_server</a></td></tr>
  122 +<tr><td><a href="http://github.com/esl/unsplit/blob/master/doc/unsplit_vclock.md" class="module">unsplit_vclock</a></td></tr></table>
130 123
17 doc/README.md
Source Rendered
... ... @@ -1,11 +1,7 @@
1 1
2 2
3   -<h1>The unsplit application</h1>
  3 +#unsplit - A framework for resolving Mnesia netsplits#
4 4
5   -unsplit - A framework for resolving Mnesia netsplits
6   -
7   -=====================================================
8   -.
9 5
10 6 Copyright (c) 2010 Erlang Solutions Ltd.
11 7
@@ -72,12 +68,11 @@ and the fetched data will be handed to the merge function as:
72 68
73 69 The return value, `ret()` is defined as:
74 70
75   -
76 71 <pre>
77 72 ret() :: stop
78   -| {ok, state()}
79   -| {ok, actions(), state()}
80   -| {ok, actions(), strategy(), state()}
  73 + | {ok, state()}
  74 + | {ok, actions(), state()}
  75 + | {ok, actions(), strategy(), state()}
81 76
82 77 actions() :: [action()]
83 78
@@ -88,7 +83,6 @@ strategy() :: all_keys | {ModS, FunS}
88 83
89 84
90 85
91   -
92 86 If a custom fetch strategy function is given, it will be called as
93 87
94 88
@@ -117,8 +111,7 @@ running, but is not found on the other side. `[{[{mytab,2,a}], [{mytab,2,b}]}]`
117 111 would mean that conflicting versions of the object `{mytab,2}` were found.
118 112
119 113
120   -<h2 class="indextitle">Modules</h2>
121   -
  114 +##Modules##
122 115
123 116
124 117 <table width="100%" border="0" summary="list of modules">
55 doc/unsplit.md
Source Rendered
... ... @@ -1,9 +1,6 @@
1   -Module unsplit
2   -==============
3 1
4 2
5   -<h1>Module unsplit</h1>
6   -
  3 +#Module unsplit#
7 4 * [Description](#description)
8 5 * [Function Index](#index)
9 6 * [Function Details](#functions)
@@ -15,40 +12,34 @@ Framework for merging mnesia tables after netsplit.
15 12
16 13 __Behaviours:__ [`application`](application.md), [`supervisor`](supervisor.md).
17 14
18   -__Authors:__ : Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).
19   -
20   -<h2><a name="description">Description</a></h2>
  15 +__Authors:__ : Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).<a name="description"></a>
21 16
  17 +##Description##
22 18
23 19
24 20
25 21
26 22 ...
  23 +<a name="index"></a>
27 24
28   -
29   -<h2><a name="index">Function Index</a></h2>
30   -
  25 +##Function Index##
31 26
32 27
33 28 <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#get_reporter-0">get_reporter/0</a></td><td>Look up the predefined callback module for reporting inconsistencies.</td></tr><tr><td valign="top"><a href="#report_inconsistency-4">report_inconsistency/4</a></td><td>Report an inconcistency to the predefined reporter.</td></tr><tr><td valign="top"><a href="#report_inconsistency-5">report_inconsistency/5</a></td><td>Report an inconsistency to Reporter (an unsplit_reporter behaviour).</td></tr><tr><td valign="top"><a href="#start-2">start/2</a></td><td>Application start callback.</td></tr><tr><td valign="top"><a href="#stop-1">stop/1</a></td><td>Application stop callback.</td></tr></table>
34 29
35 30
  31 +<a name="functions"></a>
36 32
37   -
38   -<h2><a name="functions">Function Details</a></h2>
39   -
  33 +##Function Details##
40 34
41 35 <a name="get_reporter-0"></a>
42 36
43   -<h3>get_reporter/0</h3>
  37 +###get_reporter/0##
44 38
45 39
46 40
47 41
48   -
49   -
50   -<pre>get_reporter() -> <a href="#type-module">module()</a></pre>
51   -
  42 +<pre>get_reporter() -&gt; module()</pre>
52 43 <br></br>
53 44
54 45
@@ -57,15 +48,12 @@ __Authors:__ : Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@er
57 48 Look up the predefined callback module for reporting inconsistencies
58 49 <a name="report_inconsistency-4"></a>
59 50
60   -<h3>report_inconsistency/4</h3>
61   -
62   -
  51 +###report_inconsistency/4##
63 52
64 53
65 54
66 55
67   -<pre>report_inconsistency(Tab::Table, Key, ObjA::ObjectA, ObjB::ObjectB) -> ok</pre>
68   -
  56 +<pre>report_inconsistency(Tab::Table, Key, ObjA::ObjectA, ObjB::ObjectB) -&gt; ok</pre>
69 57 <br></br>
70 58
71 59
@@ -74,15 +62,12 @@ Look up the predefined callback module for reporting inconsistencies
74 62 Report an inconcistency to the predefined reporter
75 63 <a name="report_inconsistency-5"></a>
76 64
77   -<h3>report_inconsistency/5</h3>
78   -
79   -
  65 +###report_inconsistency/5##
80 66
81 67
82 68
83 69
84   -<pre>report_inconsistency(Reporter, Tab::Table, Key, ObjA::ObjectA, ObjB::ObjectB) -> ok</pre>
85   -
  70 +<pre>report_inconsistency(Reporter, Tab::Table, Key, ObjA::ObjectA, ObjB::ObjectB) -&gt; ok</pre>
86 71 <br></br>
87 72
88 73
@@ -91,15 +76,12 @@ Report an inconcistency to the predefined reporter
91 76 Report an inconsistency to Reporter (an unsplit_reporter behaviour)
92 77 <a name="start-2"></a>
93 78
94   -<h3>start/2</h3>
95   -
  79 +###start/2##
96 80
97 81
98 82
99 83
100   -
101   -<pre>start(X1::Type, X2::Arg) -> {ok, pid()}</pre>
102   -
  84 +<pre>start(X1::Type, X2::Arg) -&gt; {ok, pid()}</pre>
103 85 <br></br>
104 86
105 87
@@ -108,15 +90,12 @@ Report an inconsistency to Reporter (an unsplit_reporter behaviour)
108 90 Application start callback
109 91 <a name="stop-1"></a>
110 92
111   -<h3>stop/1</h3>
112   -
113   -
114   -
  93 +###stop/1##
115 94
116 95
117 96
118   -<pre>stop(X1::State) -> ok</pre>
119 97
  98 +<pre>stop(X1::State) -&gt; ok</pre>
120 99 <br></br>
121 100
122 101
45 doc/unsplit_lib.md
Source Rendered
... ... @@ -1,9 +1,6 @@
1   -Module unsplit_lib
2   -==================
3 1
4 2
5   -<h1>Module unsplit_lib</h1>
6   -
  3 +#Module unsplit_lib#
7 4 * [Description](#description)
8 5 * [Function Index](#index)
9 6 * [Function Details](#functions)
@@ -13,41 +10,35 @@ Predefined merge functions.
13 10
14 11
15 12
16   -__Authors:__ : Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).
17   -
18   -<h2><a name="description">Description</a></h2>
  13 +__Authors:__ : Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erlang-solutions.com)).<a name="description"></a>
19 14
  15 +##Description##
20 16
21 17
22 18
23 19
24 20 This module implements a few merge functions that can be used.
25 21
  22 +<a name="index"></a>
26 23
27   -
28   -<h2><a name="index">Function Index</a></h2>
29   -
  24 +##Function Index##
30 25
31 26
32 27 <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#bag-2">bag/2</a></td><td>Default <code>bag</code> merge; removes duplicate objects.</td></tr><tr><td valign="top"><a href="#last_modified-2">last_modified/2</a></td><td>Keeps the last modified object, based on the <code>modified</code> attribute.</td></tr><tr><td valign="top"><a href="#last_version-2">last_version/2</a></td><td>Picks the object with the greatest value of a given attribute.</td></tr><tr><td valign="top"><a href="#no_action-2">no_action/2</a></td><td>Minimal merge action - does nothing.</td></tr><tr><td valign="top"><a href="#vclock-2">vclock/2</a></td><td></td></tr></table>
33 28
34 29
  30 +<a name="functions"></a>
35 31
36   -
37   -<h2><a name="functions">Function Details</a></h2>
38   -
  32 +##Function Details##
39 33
40 34 <a name="bag-2"></a>
41 35
42   -<h3>bag/2</h3>
43   -
44   -
  36 +###bag/2##
45 37
46 38
47 39
48 40
49 41 <pre>bag(Objs::Phase, S0::State) -> <a href="#type-merge_ret">merge_ret()</a></pre>
50   -
51 42 <br></br>
52 43
53 44
@@ -55,15 +46,12 @@ This module implements a few merge functions that can be used.
55 46
56 47 Default `bag` merge; removes duplicate objects<a name="last_modified-2"></a>
57 48
58   -<h3>last_modified/2</h3>
59   -
60   -
  49 +###last_modified/2##
61 50
62 51
63 52
64 53
65 54 <pre>last_modified(Other::Phase, S0::State) -> <a href="#type-merge_ret">merge_ret()</a></pre>
66   -
67 55 <br></br>
68 56
69 57
@@ -76,15 +64,12 @@ Keeps the last modified object, based on the `modified` attribute
76 64 This function assumes that the table to be merged contains objects with
77 65 a `modified` attribute.<a name="last_version-2"></a>
78 66
79   -<h3>last_version/2</h3>
80   -
81   -
  67 +###last_version/2##
82 68
83 69
84 70
85 71
86 72 <pre>last_version(Objs::Phase, S::State) -> <a href="#type-merge_ret">merge_ret()</a></pre>
87   -
88 73 <br></br>
89 74
90 75
@@ -106,15 +91,12 @@ e.g. by adding the following user property to the table:
106 91 The function will choose the object that has the greatest value in the
107 92 position given by `Attr`.<a name="no_action-2"></a>
108 93
109   -<h3>no_action/2</h3>
  94 +###no_action/2##
110 95
111 96
112 97
113 98
114   -
115   -
116   -<pre>no_action(X1::init, X2::State) -> stop</pre>
117   -
  99 +<pre>no_action(X1::init, X2::State) -&gt; stop</pre>
118 100 <br></br>
119 101
120 102
@@ -122,8 +104,7 @@ position given by `Attr`.<a name="no_action-2"></a>
122 104
123 105 Minimal merge action - does nothing<a name="vclock-2"></a>
124 106
125   -<h3>vclock/2</h3>
126   -
  107 +###vclock/2##
127 108
128 109
129 110
39 doc/unsplit_reporter.md
Source Rendered
... ... @@ -1,9 +1,6 @@
1   -Module unsplit_reporter
2   -=======================
3 1
4 2
5   -<h1>Module unsplit_reporter</h1>
6   -
  3 +#Module unsplit_reporter#
7 4 * [Description](#description)
8 5 * [Function Index](#index)
9 6 * [Function Details](#functions)
@@ -11,36 +8,28 @@ Module unsplit_reporter
11 8
12 9 Unsplit Inconsistency Reporter Behaviour.
13 10
  11 +<a name="description"></a>
14 12
15   -
16   -__This module defines the `unsplit_reporter` behaviour.__
17   -<br></br>
18   - Required callback functions: `childspec/0`, `inconsistency/4`.
19   -
20   -<h2><a name="description">Description</a></h2>
21   -
  13 +##Description##
22 14
23 15
24 16 This module implements a basic behaviour for reporting inconsistencies
25 17 encountered during the merge procedure.
  18 +<a name="index"></a>
26 19
27   -
28   -<h2><a name="index">Function Index</a></h2>
29   -
  20 +##Function Index##
30 21
31 22
32 23 <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#behaviour_info-1">behaviour_info/1</a></td><td></td></tr><tr><td valign="top"><a href="#childspec-0">childspec/0</a></td><td>Return a child start specification for the pre-defined reporter.</td></tr><tr><td valign="top"><a href="#inconsistency-4">inconsistency/4</a></td><td>Report an inconsistency encountered during the merge.</td></tr></table>
33 24
34 25
  26 +<a name="functions"></a>
35 27
36   -
37   -<h2><a name="functions">Function Details</a></h2>
38   -
  28 +##Function Details##
39 29
40 30 <a name="behaviour_info-1"></a>
41 31
42   -<h3>behaviour_info/1</h3>
43   -
  32 +###behaviour_info/1##
44 33
45 34
46 35
@@ -49,15 +38,12 @@ encountered during the merge procedure.
49 38
50 39 <a name="childspec-0"></a>
51 40
52   -<h3>childspec/0</h3>
53   -
54   -
  41 +###childspec/0##
55 42
56 43
57 44
58 45
59 46 <pre>childspec() -> ignore | <a href="supervisor.md#type-child_spec">supervisor:child_spec()</a></pre>
60   -
61 47 <br></br>
62 48
63 49
@@ -70,15 +56,12 @@ Return a child start specification for the pre-defined reporter
70 56 See [`supervisor`](supervisor.md).
71 57 Use `ignore` if no process should be started.<a name="inconsistency-4"></a>
72 58
73   -<h3>inconsistency/4</h3>
74   -
75   -
76   -
  59 +###inconsistency/4##
77 60
78 61
79 62
80   -<pre>inconsistency(Table, Key, ObjA::ObjectA, ObjB::ObjectB) -> ok</pre>
81 63
  64 +<pre>inconsistency(Table, Key, ObjA::ObjectA, ObjB::ObjectB) -&gt; ok</pre>
82 65 <br></br>
83 66
84 67
43 doc/unsplit_server.md
Source Rendered
... ... @@ -1,9 +1,6 @@
1   -Module unsplit_server
2   -=====================
3 1
4 2
5   -<h1>Module unsplit_server</h1>
6   -
  3 +#Module unsplit_server#
7 4 * [Function Index](#index)
8 5 * [Function Details](#functions)
9 6
@@ -12,24 +9,21 @@ Module unsplit_server
12 9
13 10
14 11
15   -__Behaviours:__ [`gen_server`](gen_server.md).
16   -
17   -<h2><a name="index">Function Index</a></h2>
  12 +__Behaviours:__ [`gen_server`](gen_server.md).<a name="index"></a>
18 13
  14 +##Function Index##
19 15
20 16
21 17 <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#code_change-3">code_change/3</a></td><td></td></tr><tr><td valign="top"><a href="#handle_call-3">handle_call/3</a></td><td></td></tr><tr><td valign="top"><a href="#handle_cast-2">handle_cast/2</a></td><td></td></tr><tr><td valign="top"><a href="#handle_info-2">handle_info/2</a></td><td></td></tr><tr><td valign="top"><a href="#init-1">init/1</a></td><td></td></tr><tr><td valign="top"><a href="#remote_handle_query-1">remote_handle_query/1</a></td><td></td></tr><tr><td valign="top"><a href="#start_link-0">start_link/0</a></td><td>Starts the Unsplit server.</td></tr><tr><td valign="top"><a href="#terminate-2">terminate/2</a></td><td></td></tr></table>
22 18
23 19
  20 +<a name="functions"></a>
24 21
25   -
26   -<h2><a name="functions">Function Details</a></h2>
27   -
  22 +##Function Details##
28 23
29 24 <a name="code_change-3"></a>
30 25
31   -<h3>code_change/3</h3>
32   -
  26 +###code_change/3##
33 27
34 28
35 29
@@ -38,8 +32,7 @@ __Behaviours:__ [`gen_server`](gen_server.md).
38 32
39 33 <a name="handle_call-3"></a>
40 34
41   -<h3>handle_call/3</h3>
42   -
  35 +###handle_call/3##
43 36
44 37
45 38
@@ -48,8 +41,7 @@ __Behaviours:__ [`gen_server`](gen_server.md).
48 41
49 42 <a name="handle_cast-2"></a>
50 43
51   -<h3>handle_cast/2</h3>
52   -
  44 +###handle_cast/2##
53 45
54 46
55 47
@@ -58,8 +50,7 @@ __Behaviours:__ [`gen_server`](gen_server.md).
58 50
59 51 <a name="handle_info-2"></a>
60 52
61   -<h3>handle_info/2</h3>
62   -
  53 +###handle_info/2##
63 54
64 55
65 56
@@ -68,8 +59,7 @@ __Behaviours:__ [`gen_server`](gen_server.md).
68 59
69 60 <a name="init-1"></a>
70 61
71   -<h3>init/1</h3>
72   -
  62 +###init/1##
73 63
74 64
75 65
@@ -78,8 +68,7 @@ __Behaviours:__ [`gen_server`](gen_server.md).
78 68
79 69 <a name="remote_handle_query-1"></a>
80 70
81   -<h3>remote_handle_query/1</h3>
82   -
  71 +###remote_handle_query/1##
83 72
84 73
85 74
@@ -88,15 +77,12 @@ __Behaviours:__ [`gen_server`](gen_server.md).
88 77
89 78 <a name="start_link-0"></a>
90 79
91   -<h3>start_link/0</h3>
92   -
  80 +###start_link/0##
93 81
94 82
95 83
96 84
97   -
98   -<pre>start_link() -> {ok, pid()}</pre>
99   -
  85 +<pre>start_link() -&gt; {ok, pid()}</pre>
100 86 <br></br>
101 87
102 88
@@ -104,8 +90,7 @@ __Behaviours:__ [`gen_server`](gen_server.md).
104 90
105 91 Starts the Unsplit server<a name="terminate-2"></a>
106 92
107   -<h3>terminate/2</h3>
108   -
  93 +###terminate/2##
109 94
110 95
111 96
98 doc/unsplit_vclock.md
Source Rendered
... ... @@ -1,9 +1,6 @@
1   -Module unsplit_vclock
2   -=====================
3 1
4 2
5   -<h1>Module unsplit_vclock</h1>
6   -
  3 +#Module unsplit_vclock#
7 4 * [Description](#description)
8 5 * [Data Types](#types)
9 6 * [Function Index](#index)
@@ -21,86 +18,75 @@ __Authors:__ Justin Sheehy ([`justin@basho.com`](mailto:justin@basho.com)), Andy
21 18 __References__* Leslie Lamport (1978). "Time, clocks, and the ordering of events in a distributed system". Communications of the ACM 21 (7): 558-565.
22 19 * Friedemann Mattern (1988). "Virtual Time and Global States of Distributed Systems". Workshop on Parallel and Distributed Algorithms: pp. 215-226
23 20
  21 +<a name="types"></a>
24 22
25   -
26   -<h2><a name="types">Data Types</a></h2>
27   -
28   -
29   -
  23 +##Data Types##
30 24
31 25
32   -<h3 class="typedecl"><a name="type-counter">counter()</a></h3>
33 26
34 27
  28 +###<a name="type-counter">counter()</a>##
35 29
36 30
37   -`counter() = integer()`
38 31
  32 +<pre>counter() = integer()</pre>
39 33
40 34
41   -<h3 class="typedecl"><a name="type-node">node()</a></h3>
42 35
  36 +###<a name="type-node">node()</a>##
43 37
44 38
45 39
46   -`node() = term()`
  40 +<pre>node() = term()</pre>
47 41
48 42
49 43 Nodes can have any term() as a name, but they must differ from each other.
50 44
51 45
52   -<h3 class="typedecl"><a name="type-timestamp">timestamp()</a></h3>
  46 +###<a name="type-timestamp">timestamp()</a>##
53 47
54 48
55 49
  50 +<pre>timestamp() = integer()</pre>
56 51
57   -`timestamp() = integer()`
58 52
59 53
  54 +###<a name="type-vc_entry">vc_entry()</a>##
60 55
61   -<h3 class="typedecl"><a name="type-vc_entry">vc_entry()</a></h3>
62 56
63 57
64   -
65   -
66   -`vc_entry() = {[node()](#type-node), {[counter()](#type-counter), [timestamp()](#type-timestamp)}}`
  58 +<pre>vc_entry() = {node(), {<a href="#type-counter">counter()</a>, <a href="#type-timestamp">timestamp()</a>}}</pre>
67 59
68 60
69 61 The timestamp is present but not used, in case a client wishes to inspect it.
70 62
71 63
72   -<h3 class="typedecl"><a name="type-vclock">vclock()</a></h3>
73   -
74   -
75   -
  64 +###<a name="type-vclock">vclock()</a>##
76 65
77   -`vclock() = [vc_entry]`
78 66
79 67
80   -<h2><a name="index">Function Index</a></h2>
  68 +<pre>vclock() = [vc_entry]</pre>
  69 +<a name="index"></a>
81 70
  71 +##Function Index##
82 72
83 73
84 74 <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#all_nodes-1">all_nodes/1</a></td><td>Return the list of all nodes that have ever incremented VClock.</td></tr><tr><td valign="top"><a href="#descends-2">descends/2</a></td><td>Return true if Va is a direct descendant of Vb, else false -- remember, a vclock is its own descendant!</td></tr><tr><td valign="top"><a href="#equal-2">equal/2</a></td><td>Compares two VClocks for equality.</td></tr><tr><td valign="top"><a href="#fresh-0">fresh/0</a></td><td>Create a brand new vclock.</td></tr><tr><td valign="top"><a href="#get_counter-2">get_counter/2</a></td><td>Get the counter value in VClock set from Node.</td></tr><tr><td valign="top"><a href="#get_timestamp-2">get_timestamp/2</a></td><td>Get the timestamp value in a VClock set from Node.</td></tr><tr><td valign="top"><a href="#increment-2">increment/2</a></td><td>Increment VClock at Node.</td></tr><tr><td valign="top"><a href="#merge-1">merge/1</a></td><td>Combine all VClocks in the input list into their least possible
85 75 common descendant.</td></tr><tr><td valign="top"><a href="#prune-3">prune/3</a></td><td>Possibly shrink the size of a vclock, depending on current age and size.</td></tr></table>
86 76
87 77
  78 +<a name="functions"></a>
88 79
89   -
90   -<h2><a name="functions">Function Details</a></h2>
91   -
  80 +##Function Details##
92 81
93 82 <a name="all_nodes-1"></a>
94 83
95   -<h3>all_nodes/1</h3>
96   -
97   -
98   -
  84 +###all_nodes/1##
99 85
100 86
101 87
102   -<pre>all_nodes(VClock::<a href="#type-vclock">vclock()</a>) -> [<a href="#type-node">node()</a>]</pre>
103 88
  89 +<pre>all_nodes(VClock::<a href="#type-vclock">vclock()</a>) -> [node()]</pre>
104 90 <br></br>
105 91
106 92
@@ -108,15 +94,12 @@ common descendant.</td></tr><tr><td valign="top"><a href="#prune-3">prune/3</a><
108 94
109 95 Return the list of all nodes that have ever incremented VClock.<a name="descends-2"></a>
110 96
111   -<h3>descends/2</h3>
112   -
113   -
  97 +###descends/2##
114 98
115 99
116 100
117 101
118 102 <pre>descends(Va::<a href="#type-vclock">vclock()</a>, Vb::<a href="#type-vclock">vclock()</a>) -> bool()</pre>
119   -
120 103 <br></br>
121 104
122 105
@@ -124,15 +107,12 @@ Return the list of all nodes that have ever incremented VClock.<a name="descends
124 107
125 108 Return true if Va is a direct descendant of Vb, else false -- remember, a vclock is its own descendant!<a name="equal-2"></a>
126 109
127   -<h3>equal/2</h3>
128   -
129   -
  110 +###equal/2##
130 111
131 112
132 113
133 114
134 115 <pre>equal(VClockA::<a href="#type-vclock">vclock()</a>, VClockB::<a href="#type-vclock">vclock()</a>) -> true | false</pre>
135   -
136 116 <br></br>
137 117
138 118
@@ -141,15 +121,12 @@ Return true if Va is a direct descendant of Vb, else false -- remember, a vclock
141 121 Compares two VClocks for equality.
142 122 Not very fast.<a name="fresh-0"></a>
143 123
144   -<h3>fresh/0</h3>
145   -
146   -
  124 +###fresh/0##
147 125
148 126
149 127
150 128
151 129 <pre>fresh() -> <a href="#type-vclock">vclock()</a></pre>
152   -
153 130 <br></br>
154 131
155 132
@@ -157,15 +134,12 @@ Not very fast.<a name="fresh-0"></a>
157 134
158 135 Create a brand new vclock.<a name="get_counter-2"></a>
159 136
160   -<h3>get_counter/2</h3>
161   -
  137 +###get_counter/2##
162 138
163 139
164 140
165 141
166   -
167   -<pre>get_counter(Node::<a href="#type-node">node()</a>, VClock::<a href="#type-vclock">vclock()</a>) -> <a href="#type-counter">counter()</a></pre>
168   -
  142 +<pre>get_counter(Node::node(), VClock::<a href="#type-vclock">vclock()</a>) -> <a href="#type-counter">counter()</a></pre>
169 143 <br></br>
170 144
171 145
@@ -173,15 +147,12 @@ Create a brand new vclock.<a name="get_counter-2"></a>
173 147
174 148 Get the counter value in VClock set from Node.<a name="get_timestamp-2"></a>
175 149
176   -<h3>get_timestamp/2</h3>
177   -
178   -
179   -
  150 +###get_timestamp/2##
180 151
181 152
182 153
183   -<pre>get_timestamp(Node::<a href="#type-node">node()</a>, VClock::<a href="#type-vclock">vclock()</a>) -> <a href="#type-timestamp">timestamp()</a></pre>
184 154
  155 +<pre>get_timestamp(Node::node(), VClock::<a href="#type-vclock">vclock()</a>) -> <a href="#type-timestamp">timestamp()</a></pre>
185 156 <br></br>
186 157
187 158
@@ -189,15 +160,12 @@ Get the counter value in VClock set from Node.<a name="get_timestamp-2"></a>
189 160
190 161 Get the timestamp value in a VClock set from Node.<a name="increment-2"></a>
191 162
192   -<h3>increment/2</h3>
  163 +###increment/2##
193 164
194 165
195 166
196 167
197   -
198   -
199   -<pre>increment(Node::<a href="#type-node">node()</a>, VClock::<a href="#type-vclock">vclock()</a>) -> <a href="#type-vclock">vclock()</a></pre>
200   -
  168 +<pre>increment(Node::node(), VClock::<a href="#type-vclock">vclock()</a>) -> <a href="#type-vclock">vclock()</a></pre>
201 169 <br></br>
202 170
203 171
@@ -205,15 +173,12 @@ Get the timestamp value in a VClock set from Node.<a name="increment-2"></a>
205 173
206 174 Increment VClock at Node.<a name="merge-1"></a>
207 175
208   -<h3>merge/1</h3>
209   -
210   -
  176 +###merge/1##
211 177
212 178
213 179
214 180
215 181 <pre>merge(VClocks::[<a href="#type-vclock">vclock()</a>]) -> <a href="#type-vclock">vclock()</a></pre>
216   -
217 182 <br></br>
218 183
219 184
@@ -222,15 +187,12 @@ Increment VClock at Node.<a name="merge-1"></a>
222 187 Combine all VClocks in the input list into their least possible
223 188 common descendant.<a name="prune-3"></a>
224 189
225   -<h3>prune/3</h3>
226   -
227   -
  190 +###prune/3##
228 191
229 192
230 193
231 194
232 195 <pre>prune(V::<a href="#type-vclock">vclock()</a>, Now::integer(), BucketProps::term()) -> <a href="#type-vclock">vclock()</a></pre>
233   -
234 196 <br></br>
235 197
236 198
37 mk_readme.escript
... ... @@ -1,37 +0,0 @@
1   -#!/usr/bin/env escript
2   -%% -*- erlang -*-
3   -
4   -main([Src, Target]) ->
5   - {ok, Cwd} = file:get_cwd(),
6   - App = filename:basename(Cwd),
7   - Branch = get_git_branch(),
8   - case file:read_file(Src) of
9   - {ok, SrcBin} ->
10   - TgtBin =
11   - replace(
12   - replace(SrcBin,
13   - <<"](../test/">>,
14   - list_to_binary(["](", App, "/blob/",
15   - Branch, "/test/"])),
16   - <<"href=\"unsplit">>,
17   - list_to_binary(["href=\"", App, "/blob/",
18   - Branch, "/doc/unsplit"])),
19   - ok = file:write_file(Target, TgtBin)
20   - end.
21   -
22   -replace(SrcBin, SrcStr, NewStr) ->
23   - binary:replace(SrcBin,
24   - SrcStr,
25   - NewStr, [global]
26   - ).
27   -
28   -
29   -get_git_branch() ->
30   - case os:cmd("git branch | awk '/\\*/ {print $2}'") of
31   - [_,_|_] = Res ->
32   - %% trailing newline expected - remove.
33   - lists:reverse(tl(lists:reverse(Res)));
34   - Other ->
35   - io:fwrite("Could not get git branch (~s)~n", [Other]),
36   - halt(1)
37   - end.
3  rebar.config
... ... @@ -1,7 +1,6 @@
1 1 %% -*- erlang -*-
2 2 {erl_opts, [debug_info]}.
3   -{deps, [{edown, ".*", {git, "git://github.com/esl/edown.git", "HEAD"}},
4   - {deqc , ".*", {git, "git://github.com/esl/deqc.git" , "HEAD"}}
  3 +{deps, [{edown, ".*", {git, "git://github.com/esl/edown.git", "HEAD"}}
5 4 ]}.
6 5 {edoc_opts, [{doclet, edown_doclet},
7 6 {top_level_readme,
0  test/config/cover.conf → test/cover.conf
File renamed without changes
6 test/run.sh
... ... @@ -1,6 +0,0 @@
1   -!# /bin/sh
2   -cd ../src; make; cd -;
3   -run_test -pa ../ebin -include ../src/ -config config/split.cfg -dir $PWD -repeat ${1-1} -cover config/cover.conf -logdir $PWD/log;
4   -rm *.beam;
5   -cd ../src; make clean
6   -
0  test/config/split.cfg → test/test.config
File renamed without changes
23 test/unsplit_SUITE.erl
@@ -10,7 +10,8 @@
10 10
11 11 %%% External exports
12 12 -compile(export_all).
13   --define(ERL_FLAGS, "-kernel dist_auto_connect once -pa ../../ -pa ../../../ebin/").
  13 +%% -define(ERL_FLAGS, "-kernel dist_auto_connect once -pa ../../ -pa ../../../ebin/").
  14 +-define(ERL_FLAGS, "-kernel dist_auto_connect once").
14 15 -define(TABLE, test1).
15 16 -define(NODES, ['mn1@localhost', 'mn2@localhost']).
16 17 -define(DISCONNECT_TIME, 4000).
@@ -27,11 +28,15 @@ init_per_suite(Conf) ->
27 28 DisconnectTime = ct:get_config(disconnect_time, ?DISCONNECT_TIME),
28 29 UnsplitTimeout = ct:get_config(unsplit_timeout, ?UNSPLIT_TIMEOUT),
29 30 Host = get_host(),
  31 + ErlFlags = lists:flatten([?ERL_FLAGS,
  32 + get_path_flags(),
  33 + " -pa ", filename:absname(
  34 + filename:dirname(code:which(?MODULE)))]),
  35 + ct:print("ErlFlags = ~p~n", [ErlFlags]),
30 36 StartNode = fun(Node)->
31 37 ct:print("starting node ~p, on host ~p ~n",[Node, Host]),
32 38 {ok, NodeName} = ct_slave:start(Host, Node,
33   - [{erl_flags,
34   - ?ERL_FLAGS}]),
  39 + [{erl_flags, ErlFlags}]),
35 40 NodeName
36 41 end,
37 42
@@ -140,6 +145,12 @@ write(Records)->
140 145 mnesia:transaction(Trans).
141 146
142 147 get_host()->
143   - {ok, HostS} = inet:gethostname(),
144   - list_to_atom(HostS).
145   -
  148 + [_, H] = re:split(atom_to_list(node()),"@",[{return,list}]),
  149 + list_to_atom(H).
  150 + %% {ok, HostS} = inet:gethostname(),
  151 + %% list_to_atom(HostS).
  152 +
  153 +get_path_flags() ->
  154 + [ [[" -",atom_to_list(K)," ",D] || D <- V]
  155 + || {K,V} <- init:get_arguments(),
  156 + K == pa orelse K == pz].

0 comments on commit 7b82193

Please sign in to comment.
Something went wrong with that request. Please try again.