Skip to content

Commit 96f4b0b

Browse files
committed
Suppress warnings about obsolete boolean operators in test suites
1 parent 5f685da commit 96f4b0b

16 files changed

+56
-5
lines changed

lib/ssh/test/ssh_options_SUITE.erl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
%%% This test suite tests different options for the ssh functions
2828

29+
-compile(nowarn_obsolete_bool_op).
2930

3031
-include_lib("common_test/include/ct.hrl").
3132
-include_lib("kernel/include/file.hrl").

lib/ssh/test/ssh_pubkey_SUITE.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
%%
2323
-module(ssh_pubkey_SUITE).
2424

25+
-compile(nowarn_obsolete_bool_op).
26+
2527
%% Note: This directive should only be used in test suites.
2628
-export([
2729
suite/0,

lib/stdlib/test/beam_lib_SUITE.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
%%-define(debug, true).
2525

26+
-compile(nowarn_obsolete_bool_op).
27+
2628
-ifdef(debug).
2729
-define(format(S, A), io:format(S, A)).
2830
-define(line, put(line, ?LINE), ).

lib/stdlib/test/binary_module_SUITE.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
%%
2222
-module(binary_module_SUITE).
2323

24+
-compile(nowarn_obsolete_bool_op).
25+
2426
-export([all/0, suite/0,
2527
interesting/1,scope_return/1,random_ref_comp/1,random_ref_sr_comp/1,
2628
random_ref_fla_comp/1,parts/1, bin_to_list/1, list_to_bin/1,

lib/stdlib/test/binref.erl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
%% %CopyrightBegin%
2+
%%
3+
%% SPDX-License-Identifier: Apache-2.0
4+
%%
5+
%% Copyright Ericsson AB 2025. All Rights Reserved.
6+
%%
7+
%% Licensed under the Apache License, Version 2.0 (the "License");
8+
%% you may not use this file except in compliance with the License.
9+
%% You may obtain a copy of the License at
10+
%%
11+
%% http://www.apache.org/licenses/LICENSE-2.0
12+
%%
13+
%% Unless required by applicable law or agreed to in writing, software
14+
%% distributed under the License is distributed on an "AS IS" BASIS,
15+
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
%% See the License for the specific language governing permissions and
17+
%% limitations under the License.
18+
%%
19+
%% %CopyrightEnd%
20+
121
-module(binref).
222

323
-export([compile_pattern/1,match/2,match/3,matches/2,matches/3,
@@ -7,6 +27,7 @@
727
longest_common_prefix/1,longest_common_suffix/1,bin_to_list/1,
828
bin_to_list/2,bin_to_list/3,list_to_bin/1]).
929

30+
-compile(nowarn_obsolete_bool_op).
1031

1132
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1233
%% compile_pattern, a dummy

lib/stdlib/test/erl_eval_SUITE.erl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
%% %CopyrightEnd%
2121

2222
-module(erl_eval_SUITE).
23+
24+
-compile(nowarn_obsolete_bool_op).
25+
2326
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
2427
init_per_testcase/2, end_per_testcase/2,
2528
init_per_group/2,end_per_group/2]).

lib/stdlib/test/erl_lint_SUITE.erl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
%%
2222
-module(erl_lint_SUITE).
2323

24+
-compile(nowarn_obsolete_bool_op).
25+
2426
%%-define(debug, true).
2527

2628
-ifdef(debug).
@@ -623,7 +625,7 @@ unused_vars_warn_fun(Config) when is_list(Config) ->
623625
(C == <<A:A>>) and (<<17:B>> == D)
624626
end.
625627
">>,
626-
[warn_unused_vars],
628+
[warn_unused_vars,nowarn_obsolete_bool_op],
627629
{warnings,[{{1,24},erl_lint,{unused_var,'A'}},
628630
{{2,23},erl_lint,{unused_var,'A'}},
629631
{{2,23},erl_lint,{shadowed_var,'A','fun'}},
@@ -1903,7 +1905,7 @@ guard(Config) when is_list(Config) ->
19031905
t3(A) when is_tuple(A) or is_tuple(A) ->
19041906
is_tuple.
19051907
">>,
1906-
[nowarn_obsolete_guard],
1908+
[nowarn_obsolete_guard,nowarn_obsolete_bool_op],
19071909
[]}],
19081910
[] = run(Config, Ts),
19091911
Ts1 = [{guard5,
@@ -1956,7 +1958,7 @@ guard(Config) when is_list(Config) ->
19561958
[X || X <- [1,#apa{},3], (3+is_record(X, apa)) or
19571959
(is_record(X, apa)*2)].
19581960
">>,
1959-
[],
1961+
[nowarn_obsolete_bool_op],
19601962
[]},
19611963
{guard8,
19621964
<<"t(A) when erlang:is_foobar(A) -> ok;
@@ -3030,7 +3032,7 @@ otp_5878(Config) when is_list(Config) ->
30303032
{{5,30},erl_lint,illegal_guard_expr},
30313033
{{7,30},erl_lint,illegal_guard_expr}],
30323034
[]} =
3033-
run_test2(Config, Ill2, [warn_unused_record]),
3035+
run_test2(Config, Ill2, [warn_unused_record,nowarn_obsolete_bool_op]),
30343036

30353037
Ill3 = <<"t() -> ok.">>,
30363038
{errors,[{{1,1},erl_lint,undefined_module}],[]} =

lib/stdlib/test/erl_pp_SUITE.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
%%%-----------------------------------------------------------------
2525
-module(erl_pp_SUITE).
2626

27+
-compile(nowarn_obsolete_bool_op).
28+
2729
%%-define(debug, true).
2830

2931
-ifdef(debug).

lib/stdlib/test/ets_SUITE.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
%%
2222
-module(ets_SUITE).
2323

24+
-compile(nowarn_obsolete_bool_op).
25+
2426
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
2527
init_per_group/2,end_per_group/2]).
2628
-export([default/1,setbag/1,badnew/1,verybadnew/1,named/1,keypos2/1,

lib/stdlib/test/id_transform_SUITE.erl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
-author('[email protected]').
2424

2525
-include_lib("kernel/include/file.hrl").
26-
26+
27+
-compile(nowarn_obsolete_bool_op).
28+
2729
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
2830
init_per_group/2,end_per_group/2,
2931
id_transform/1]).

0 commit comments

Comments
 (0)