21
-export([c_1/1, c_2/1, c_3/1, c_4/1, memory/1]).
23
-include("test_server.hrl").
27
all(doc) -> ["Test cases for the 'c' module."];
29
[c_1, c_2, c_3, c_4, memory].
20
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
21
init_per_group/2,end_per_group/2]).
22
-export([c_1/1, c_2/1, c_3/1, c_4/1, nc_1/1, nc_2/1, nc_3/1, nc_4/1,
25
-include_lib("test_server/include/test_server.hrl").
27
-import(c, [c/2, nc/2]).
29
suite() -> [{ct_hooks,[ts_install_cth]}].
32
[c_1, c_2, c_3, c_4, nc_1, nc_2, nc_3, nc_4, memory].
37
init_per_suite(Config) ->
40
end_per_suite(_Config) ->
43
init_per_group(_GroupName, Config) ->
46
end_per_group(_GroupName, Config) ->
31
50
%%% Write output to a directory other than current directory:
34
53
["Checks that c:c works also with option 'outdir' [ticket OTP-1209]."];
37
c_1(Config) when list(Config) ->
56
c_1(Config) when is_list(Config) ->
38
57
?line R = filename:join(?config(data_dir, Config), "m.erl"),
39
58
?line W = ?config(priv_dir, Config),
40
59
?line Result = c(R,[{outdir,W}]),
44
63
["Checks that c:c works also with option 'outdir' [ticket OTP-1209]."];
47
c_2(Config) when list(Config) ->
66
c_2(Config) when is_list(Config) ->
48
67
?line R = filename:join(?config(data_dir, Config), "m"),
49
68
?line W = ?config(priv_dir, Config),
50
69
?line Result = c(R,[{outdir,W}]),
59
78
"directory). [ticket OTP-1209]."];
62
c_3(Config) when list(Config) ->
81
c_3(Config) when is_list(Config) ->
63
82
?line R = filename:join(?config(data_dir, Config), "m.erl"),
64
83
?line W = ?config(priv_dir, Config),
65
84
?line file:set_cwd(W),
71
90
"directory). [ticket OTP-1209]."];
74
c_4(Config) when list(Config) ->
93
c_4(Config) when is_list(Config) ->
75
94
?line R = filename:join(?config(data_dir, Config), "m"),
76
95
?line W = ?config(priv_dir, Config),
77
96
?line file:set_cwd(W),
78
97
?line Result = c(R,[{outdir,W}]),
79
98
?line {ok, m} = Result.
100
%%% Write output to a directory other than current directory:
103
["Checks that c:nc works also with option 'outdir'."];
106
nc_1(Config) when is_list(Config) ->
107
?line R = filename:join(?config(data_dir, Config), "m.erl"),
108
?line W = ?config(priv_dir, Config),
109
?line Result = nc(R,[{outdir,W}]),
110
?line {ok, m} = Result.
113
["Checks that c:nc works also with option 'outdir'."];
116
nc_2(Config) when is_list(Config) ->
117
?line R = filename:join(?config(data_dir, Config), "m"),
118
?line W = ?config(priv_dir, Config),
119
?line Result = nc(R,[{outdir,W}]),
120
?line {ok, m} = Result.
123
%%% Put results in current directory (or rather, change current dir
124
%%% to the output dir):
127
["Checks that c:nc works also with option 'outdir' (same as current"
131
nc_3(Config) when is_list(Config) ->
132
?line R = filename:join(?config(data_dir, Config), "m.erl"),
133
?line W = ?config(priv_dir, Config),
134
?line file:set_cwd(W),
135
?line Result = nc(R,[{outdir,W}]),
136
?line {ok, m} = Result.
139
["Checks that c:nc works also with option 'outdir' (same as current"
143
nc_4(Config) when is_list(Config) ->
144
?line R = filename:join(?config(data_dir, Config), "m"),
145
?line W = ?config(priv_dir, Config),
146
?line file:set_cwd(W),
147
?line Result = nc(R,[{outdir,W}]),
148
?line {ok, m} = Result.
82
151
["Checks that c:memory/[0,1] returns consistent results."];
85
memory(Config) when list(Config) ->
154
memory(Config) when is_list(Config) ->
87
156
?line ML = c:memory(),
88
157
?line T = mget(total, ML),