Skip to content

Commit e1402d5

Browse files
committed
Only include proper extensions if proper is available
1 parent 9b3c922 commit e1402d5

File tree

5 files changed

+102
-19
lines changed

5 files changed

+102
-19
lines changed

lib/common_test/Makefile

+1-9
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,7 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk
2525
# Macros
2626
#
2727

28-
ifeq ($(findstring linux,$(TARGET)),linux)
29-
SUB_DIRECTORIES = doc/src src priv
30-
else
31-
ifeq ($(findstring solaris,$(TARGET)),solaris)
32-
SUB_DIRECTORIES = doc/src src priv
33-
else
34-
SUB_DIRECTORIES = doc/src src priv
35-
endif
36-
endif
28+
SUB_DIRECTORIES = doc/src src priv proper_ext
3729

3830
include vsn.mk
3931
VSN = $(COMMON_TEST_VSN)

lib/common_test/proper_ext/Makefile

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#
2+
# %CopyrightBegin%
3+
#
4+
# Copyright Ericsson AB 2023. 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+
include $(ERL_TOP)/make/target.mk
22+
23+
# ----------------------------------------------------
24+
# Configuration info.
25+
# ----------------------------------------------------
26+
include $(ERL_TOP)/make/$(TARGET)/otp.mk
27+
28+
# ----------------------------------------------------
29+
# Release directory specification
30+
# ----------------------------------------------------
31+
PROPEREXTDIR = $(RELEASE_PATH)/lib/common_test-$(VSN)/proper_ext
32+
33+
# ----------------------------------------------------
34+
# Target Specs
35+
# ----------------------------------------------------
36+
37+
EBIN=.
38+
39+
MODULES= \
40+
proper_ext
41+
42+
TARGET_MODULES= $(MODULES:%=$(EBIN)/%)
43+
TARGET_MODULES= $(MODULES:%=$(EBIN)/%)
44+
45+
ERL_FILES = $(MODULES:=.erl)
46+
HRL_FILES =
47+
48+
TARGET_FILES = $(MODULES:%=$(EBIN)/%.$(EMULATOR))
49+
50+
TARGETS = $(MODULES:%=$(EBIN)/%.$(EMULATOR))
51+
52+
# ----------------------------------------------------
53+
# FLAGS
54+
# ----------------------------------------------------
55+
ERL_COMPILE_FLAGS += -I../include -Werror
56+
57+
# ----------------------------------------------------
58+
# Targets
59+
# ----------------------------------------------------
60+
61+
tests $(TYPES): $(TARGETS)
62+
63+
clean:
64+
rm -f $(TARGET_FILES)
65+
rm -f core
66+
67+
docs:
68+
69+
# ----------------------------------------------------
70+
# Special Build Targets
71+
# ----------------------------------------------------
72+
73+
# ----------------------------------------------------
74+
# Release Target
75+
# ----------------------------------------------------
76+
include $(ERL_TOP)/make/otp_release_targets.mk
77+
78+
release_spec: opt
79+
$(INSTALL_DIR) "$(PROPEREXTDIR)"
80+
$(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) \
81+
$(TARGET_FILES) \
82+
"$(PROPEREXTDIR)"
83+
84+
release_docs_spec:

lib/common_test/src/ct_property_test_proper_ext.erl renamed to lib/common_test/proper_ext/proper_ext.erl

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
%%
22
%% %CopyrightBegin%
3-
%%
4-
%% Copyright Ericsson AB 2003-2023. All Rights Reserved.
5-
%%
3+
%%
4+
%% Copyright Ericsson AB 2023. All Rights Reserved.
5+
%%
66
%% Licensed under the Apache License, Version 2.0 (the "License");
77
%% you may not use this file except in compliance with the License.
88
%% You may obtain a copy of the License at
@@ -14,11 +14,11 @@
1414
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1515
%% See the License for the specific language governing permissions and
1616
%% limitations under the License.
17-
%%
17+
%%
1818
%% %CopyrightEnd%
1919
%%
2020

21-
-module(ct_property_test_proper_ext).
21+
-module(proper_ext).
2222

2323
-export([existing_atom/0]).
2424
-export([safe_any/0]).

lib/common_test/src/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ MODULES= \
7979
cth_conn_log \
8080
ct_groups \
8181
ct_property_test \
82-
ct_property_test_proper_ext \
8382
ct_release_test \
8483
ct_default_gl \
8584
erl2html2 \

lib/common_test/src/ct_property_test.erl

+12-4
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,28 @@ init_tool(Config) ->
6969
{ok,ToolModule} ->
7070
case code:where_is_file(lists:concat([ToolModule,".beam"])) of
7171
non_existing ->
72-
ct:log("Found ~p, but ~tp~n is not found",
72+
ct:log("Found ~p, but ~ts was not found",
7373
[ToolModule, lists:concat([ToolModule,".beam"])]),
7474
{skip, "Strange Property testing tool installation"};
7575
ToolPath ->
76-
ct:pal("Found property tester ~p~n"
77-
"at ~tp",
76+
ct:pal("Found property tester ~p at ~ts",
7877
[ToolModule, ToolPath]),
78+
init_tool_extensions(ToolModule),
7979
[{property_test_tool, ToolModule} | Config]
8080
end;
8181
not_found ->
8282
ct:pal("No property tester found",[]),
8383
{skip, "No property testing tool found"}
8484
end.
85-
85+
86+
init_tool_extensions(proper) ->
87+
ProperExtDir = code:lib_dir(common_test, proper_ext),
88+
true = code:add_patha(ProperExtDir),
89+
ct:pal("Added ~ts to code path~n", [ProperExtDir]),
90+
ok;
91+
init_tool_extensions(_) ->
92+
ok.
93+
8694
%%%----------------------------------------------------------------
8795
%%%
8896
%%% Call the found property tester (if any)

0 commit comments

Comments
 (0)