1%%
2%% %CopyrightBegin%
3%%
4%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
5%%
6%% Licensed under the Apache License, Version 2.0 (the "License");
7%% you may not use this file except in compliance with the License.
8%% You may obtain a copy of the License at
9%%
10%%     http://www.apache.org/licenses/LICENSE-2.0
11%%
12%% Unless required by applicable law or agreed to in writing, software
13%% distributed under the License is distributed on an "AS IS" BASIS,
14%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15%% See the License for the specific language governing permissions and
16%% limitations under the License.
17%%
18%% %CopyrightEnd%
19%%
20%%
21%%%----------------------------------------------------------------------
22%%% Purpose : Test suite for the backends of the IDL compiler
23%%%----------------------------------------------------------------------
24
25-module(ic_be_SUITE).
26-include_lib("common_test/include/ct.hrl").
27
28
29-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
30	 init_per_group/2,end_per_group/2,plain/1]).
31
32
33-define(OUT(X), filename:join([proplists:get_value(priv_dir, Config), gen, to_list(X)])).
34
35
36%% Top of cases
37
38suite() -> [{ct_hooks,[ts_install_cth]}].
39
40all() ->
41    [plain].
42
43groups() ->
44    [].
45
46init_per_suite(Config) ->
47    Config.
48
49end_per_suite(_Config) ->
50    ok.
51
52init_per_group(_GroupName, Config) ->
53    Config.
54
55end_per_group(_GroupName, Config) ->
56    Config.
57
58
59%% Checking code for the plain backend.
60plain(Config) when is_list(Config) ->
61    DataDir = proplists:get_value(data_dir, Config),
62    OutDir = ?OUT(slask),
63    File = filename:join(DataDir, plain),
64    ok = ic:gen(File,stdopts(OutDir)++[{be,erl_plain}]),
65    ok.
66
67%%--------------------------------------------------------------------
68%%
69%% Utilities
70stdopts(OutDir) ->
71    [{outdir, OutDir}, {maxerrs, infinity}].
72
73to_list(X) when is_atom(X) -> atom_to_list(X);
74to_list(X) -> X.
75
76