~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/common_test/test/ct_smoke_test_SUITE_data/happy_1/test/happy_11_SUITE.erl

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%
 
2
%% %CopyrightBegin%
 
3
%%
 
4
%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
 
5
%%
 
6
%% The contents of this file are subject to the Erlang Public License,
 
7
%% Version 1.1, (the "License"); you may not use this file except in
 
8
%% compliance with the License. You should have received a copy of the
 
9
%% Erlang Public License along with this software. If not, it can be
 
10
%% retrieved online at http://www.erlang.org/.
 
11
%%
 
12
%% Software distributed under the License is distributed on an "AS IS"
 
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
14
%% the License for the specific language governing rights and limitations
 
15
%% under the License.
 
16
%%
 
17
%% %CopyrightEnd%
 
18
%%
 
19
 
 
20
%%%-------------------------------------------------------------------
 
21
%%% File    : happy_11_SUITE.erl
 
22
%%% Description : Happy test of all common_test callback functions.
 
23
%%%-------------------------------------------------------------------
 
24
-module(happy_11_SUITE).
 
25
 
 
26
%% Note: This directive should only be used in test suites.
 
27
-compile(export_all).
 
28
 
 
29
-include_lib("common_test/include/ct.hrl").
 
30
 
 
31
%%--------------------------------------------------------------------
 
32
%% COMMON TEST CALLBACK FUNCTIONS
 
33
%%--------------------------------------------------------------------
 
34
 
 
35
%%--------------------------------------------------------------------
 
36
%% Function: suite() -> Info
 
37
%%
 
38
%% Info = [tuple()]
 
39
%%   List of key/value pairs.
 
40
%%
 
41
%% Description: Returns list of tuples to set default properties
 
42
%%              for the suite.
 
43
%%
 
44
%% Note: The suite/0 function is only meant to be used to return
 
45
%% default data values, not perform any other operations.
 
46
%%--------------------------------------------------------------------
 
47
suite() ->
 
48
    [
 
49
     {timetrap,{seconds,10}},
 
50
     {require, v1},
 
51
     {userdata, {info,"Happy test of CT callback functions."}}
 
52
    ].
 
53
 
 
54
%%--------------------------------------------------------------------
 
55
%% Function: init_per_suite(Config0) ->
 
56
%%               Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
 
57
%%
 
58
%% Config0 = Config1 = [tuple()]
 
59
%%   A list of key/value pairs, holding the test case configuration.
 
60
%% Reason = term()
 
61
%%   The reason for skipping the suite.
 
62
%%
 
63
%% Description: Initialization before the suite.
 
64
%%
 
65
%% Note: This function is free to add any key/value pairs to the Config
 
66
%% variable, but should NOT alter/remove any existing entries.
 
67
%%--------------------------------------------------------------------
 
68
init_per_suite(Config) ->
 
69
    [{ips,ips_data} | Config].
 
70
 
 
71
%%--------------------------------------------------------------------
 
72
%% Function: end_per_suite(Config0) -> void() | {save_config,Config1}
 
73
%%
 
74
%% Config0 = Config1 = [tuple()]
 
75
%%   A list of key/value pairs, holding the test case configuration.
 
76
%%
 
77
%% Description: Cleanup after the suite.
 
78
%%--------------------------------------------------------------------
 
79
end_per_suite(Config) ->
 
80
    ips_data = ?config(ips, Config).
 
81
 
 
82
%%--------------------------------------------------------------------
 
83
%% Function: init_per_testcase(TestCase, Config0) ->
 
84
%%               Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
 
85
%%
 
86
%% TestCase = atom()
 
87
%%   Name of the test case that is about to run.
 
88
%% Config0 = Config1 = [tuple()]
 
89
%%   A list of key/value pairs, holding the test case configuration.
 
90
%% Reason = term()
 
91
%%   The reason for skipping the test case.
 
92
%%
 
93
%% Description: Initialization before each test case.
 
94
%%
 
95
%% Note: This function is free to add any key/value pairs to the Config
 
96
%% variable, but should NOT alter/remove any existing entries.
 
97
%%--------------------------------------------------------------------
 
98
init_per_testcase(TestCase, Config) ->
 
99
    [{TestCase,{TestCase,data}} | Config].
 
100
 
 
101
%%--------------------------------------------------------------------
 
102
%% Function: end_per_testcase(TestCase, Config0) ->
 
103
%%               void() | {save_config,Config1}
 
104
%%
 
105
%% TestCase = atom()
 
106
%%   Name of the test case that is finished.
 
107
%% Config0 = Config1 = [tuple()]
 
108
%%   A list of key/value pairs, holding the test case configuration.
 
109
%%
 
110
%% Description: Cleanup after each test case.
 
111
%%--------------------------------------------------------------------
 
112
end_per_testcase(TestCase, Config) ->
 
113
    {TestCase,data} = ?config(TestCase, Config).
 
114
 
 
115
%%--------------------------------------------------------------------
 
116
%% Function: sequences() -> Sequences
 
117
%%
 
118
%% Sequences = [{SeqName,TestCases}]
 
119
%% SeqName = atom()
 
120
%%   Name of a sequence.
 
121
%% TestCases = [atom()]
 
122
%%   List of test cases that are part of the sequence
 
123
%%
 
124
%% Description: Specifies test case sequences.
 
125
%%--------------------------------------------------------------------
 
126
sequences() -> 
 
127
    [{seq1,[seq1_tc1, seq1_tc2]},
 
128
     {seq2,[seq2_tc1, seq2_tc2]}].
 
129
 
 
130
%%--------------------------------------------------------------------
 
131
%% Function: all() -> TestCases | {skip,Reason}
 
132
%%
 
133
%% TestCases = [TestCase | {sequence,SeqName}]
 
134
%% TestCase = atom()
 
135
%%   Name of a test case.
 
136
%% SeqName = atom()
 
137
%%   Name of a test case sequence.
 
138
%% Reason = term()
 
139
%%   The reason for skipping all test cases.
 
140
%%
 
141
%% Description: Returns the list of test cases that are to be executed.
 
142
%%--------------------------------------------------------------------
 
143
all() -> 
 
144
    [tc1,
 
145
     tc2,
 
146
     seq1,
 
147
     tc3,
 
148
     seq2,
 
149
     tc4].
 
150
 
 
151
 
 
152
%%--------------------------------------------------------------------
 
153
%% TEST CASES
 
154
%%--------------------------------------------------------------------
 
155
 
 
156
tc1() -> 
 
157
    [{userdata,{info, "This is a testcase"}}].
 
158
 
 
159
tc1(Config) -> 
 
160
    ips_data = ?config(ips, Config),
 
161
    {tc1,data} = ?config(tc1, Config),
 
162
    apple = ct:get_config(v1),
 
163
    ok.
 
164
 
 
165
tc2() ->
 
166
    [{timetrap,5000},
 
167
     {require,v2}].
 
168
 
 
169
tc2(Config) ->
 
170
    ips_data = ?config(ips, Config),
 
171
    undefined = ?config(tc1, Config),
 
172
    {tc2,data} = ?config(tc2, Config),
 
173
    plum = ct:get_config(v2),
 
174
    ok.
 
175
 
 
176
tc3() ->
 
177
    [{timetrap,{minutes,1}}].
 
178
 
 
179
tc3(_Config) ->
 
180
    ok = ct:require(v3),
 
181
    [{v31, cherry},{v32, banana},{v33, coconut}] = ct:get_config(v3),
 
182
    banana = ct:get_config({v3,v32}),
 
183
    ok.
 
184
    
 
185
tc4(Config) ->
 
186
    {skip,"Skipping this one"}.
 
187
    
 
188
seq1_tc1(_) ->
 
189
    ok.
 
190
seq1_tc2(_) ->
 
191
    ok.
 
192
 
 
193
seq2_tc1(_) ->
 
194
    ok.
 
195
seq2_tc2(_) ->
 
196
    ok.