Skip to content

Commit

Permalink
Merge branch 'fh/common_test-includes' into ccase/r13b04_dev
Browse files Browse the repository at this point in the history
* fh/common_test-includes:
  make it possible to include ct.hrl using include_lib
  Include test_servers's include files in the bootstrap

OTP-8379  It is now possible to include the ct.hrl using the -include_lib
          directive. (Thanks to Fred Hebert.)
  • Loading branch information
Erlang/OTP committed Jan 19, 2010
2 parents d30f9a6 + f229496 commit 141b8f2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 17 deletions.
22 changes: 17 additions & 5 deletions Makefile.in
@@ -1,19 +1,19 @@
#
# %CopyrightBegin%
#
# Copyright Ericsson AB 1998-2009. All Rights Reserved.
#
#
# Copyright Ericsson AB 1998-2010. All Rights Reserved.
#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
#
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
#
#
# %CopyrightEnd%

# Toplevel makefile for building the Erlang system
Expand Down Expand Up @@ -441,6 +441,8 @@ fourth_bootstrap_copy:
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/wx ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/wx ; fi
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/ebin ; fi
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/include ; fi
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server ; fi
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server/include ; fi
for x in lib/ic/ebin/*.beam; do \
BN=`basename $$x`; \
TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin/$$BN; \
Expand Down Expand Up @@ -506,6 +508,16 @@ fourth_bootstrap_copy:
cp $$x $$TF; \
true; \
done
for x in lib/test_server/include/*.hrl; do \
BN=`basename $$x`; \
TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/test_server/include/$$BN; \
test -f $$TF && \
test '!' -z "`find $$x -newer $$TF -print`" && \
cp $$x $$TF; \
test '!' -f $$TF && \
cp $$x $$TF; \
true; \
done

# cp lib/syntax_tools/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin

Expand Down
12 changes: 6 additions & 6 deletions lib/common_test/doc/src/example_chapter.xml
Expand Up @@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
<year>2003</year><year>2009</year>
<year>2003</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
Expand All @@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.

Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.

</legalnotice>

<title>Examples and Templates</title>
Expand All @@ -38,7 +38,7 @@
<code>
-module(db_data_type_SUITE).

-include("ct.hrl").
-include_lib("common_test/include/ct.hrl").

%% Test server callbacks
-export([suite/0, all/0,
Expand Down Expand Up @@ -186,7 +186,7 @@ insert_and_lookup(Key, Value, Config) ->
%% Note: This directive should only be used in test suites.
-compile(export_all).

-include("ct.hrl").
-include_lib("common_test/include/ct.hrl").

%%--------------------------------------------------------------------
%% COMMON TEST CALLBACK FUNCTIONS
Expand Down Expand Up @@ -394,7 +394,7 @@ my_test_case(_Config) ->

-compile(export_all).

-include("ct.hrl").
-include_lib("common_test/include/ct.hrl").

%%--------------------------------------------------------------------
%% Function: suite() -> Info
Expand Down
12 changes: 6 additions & 6 deletions lib/common_test/include/ct.hrl
@@ -1,22 +1,22 @@
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 2003-2009. All Rights Reserved.
%%
%%
%% Copyright Ericsson AB 2003-2010. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
%%
%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
%%
%%
%% %CopyrightEnd%
%%

-include("test_server.hrl").
-include_lib("test_server/include/test_server.hrl").
-compile({parse_transform,ct_line}).

0 comments on commit 141b8f2

Please sign in to comment.