From a61f66e1157b0e77839b76ef416f436f28304579 Mon Sep 17 00:00:00 2001 From: Tobias Schlager Date: Tue, 18 Feb 2014 12:29:01 +0100 Subject: Fix library application appup files As discussed in issue #240 *all* OTP library applications use the '.*' wildcard as up and down version. This makes library applications always up- and downgradeable. Using the wildcard version obsoletes all maintenance tasks regarding library applications' appup files. Additionally, it prevents upgrade problems caused by automatically included application dependencies when using reltool to create releases. Missing copyright headers are now consistently present. --- lib/typer/src/typer.appup.src | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'lib/typer') diff --git a/lib/typer/src/typer.appup.src b/lib/typer/src/typer.appup.src index 54a63833e6..bebe7a159c 100644 --- a/lib/typer/src/typer.appup.src +++ b/lib/typer/src/typer.appup.src @@ -1 +1,21 @@ -{"%VSN%",[],[]}. +%% -*- erlang -*- +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 2014. 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% +{"%VSN%", + [{<<".*">>,[{restart_application, typer}]}], + [{<<".*">>,[{restart_application, typer}]}] +}. -- cgit v1.2.3 From 841addf5d64a3b4775cd1d0a5aa4bf04ec4ef95e Mon Sep 17 00:00:00 2001 From: Tobias Schlager Date: Tue, 18 Feb 2014 12:33:31 +0100 Subject: Add test suites performing app and appup file checks Add the mentioned test suites for *all* library and touched non-library applications. --- lib/typer/test/Makefile | 65 ++++++++++++++++++++++++++++++++++++++++++ lib/typer/test/typer.spec | 1 + lib/typer/test/typer_SUITE.erl | 50 ++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 lib/typer/test/Makefile create mode 100644 lib/typer/test/typer.spec create mode 100644 lib/typer/test/typer_SUITE.erl (limited to 'lib/typer') diff --git a/lib/typer/test/Makefile b/lib/typer/test/Makefile new file mode 100644 index 0000000000..d6dd22b6cf --- /dev/null +++ b/lib/typer/test/Makefile @@ -0,0 +1,65 @@ +include $(ERL_TOP)/make/target.mk +include $(ERL_TOP)/make/$(TARGET)/otp.mk + +# ---------------------------------------------------- +# Target Specs +# ---------------------------------------------------- + +MODULES= \ + typer_SUITE + +ERL_FILES= $(MODULES:%=%.erl) + +TARGET_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR)) +INSTALL_PROGS= $(TARGET_FILES) + +EMAKEFILE=Emakefile + +# ---------------------------------------------------- +# Release directory specification +# ---------------------------------------------------- +RELSYSDIR = $(RELEASE_PATH)/typer_test + +# ---------------------------------------------------- +# FLAGS +# ---------------------------------------------------- + +ERL_MAKE_FLAGS += +ERL_COMPILE_FLAGS += -I$(ERL_TOP)/lib/test_server/include + +EBIN = . + +# ---------------------------------------------------- +# Targets +# ---------------------------------------------------- + +make_emakefile: + $(ERL_TOP)/make/make_emakefile $(ERL_COMPILE_FLAGS) -o$(EBIN) $(MODULES) \ + > $(EMAKEFILE) + $(ERL_TOP)/make/make_emakefile $(ERL_COMPILE_FLAGS) -o$(EBIN) '*_SUITE_make' \ + >> $(EMAKEFILE) + +tests debug opt: make_emakefile + erl $(ERL_MAKE_FLAGS) -make + +clean: + rm -f $(EMAKEFILE) + rm -f $(TARGET_FILES) $(GEN_FILES) + rm -f core + +docs: + +# ---------------------------------------------------- +# Release Target +# ---------------------------------------------------- +include $(ERL_TOP)/make/otp_release_targets.mk + +release_spec: opt + +release_tests_spec: make_emakefile + $(INSTALL_DIR) "$(RELSYSDIR)" + $(INSTALL_DATA) $(EMAKEFILE) $(ERL_FILES) "$(RELSYSDIR)" + $(INSTALL_DATA) typer.spec "$(RELSYSDIR)" + chmod -R u+w "$(RELSYSDIR)" + +release_docs_spec: diff --git a/lib/typer/test/typer.spec b/lib/typer/test/typer.spec new file mode 100644 index 0000000000..79f51b6781 --- /dev/null +++ b/lib/typer/test/typer.spec @@ -0,0 +1 @@ +{suites,"../typer_test",all}. diff --git a/lib/typer/test/typer_SUITE.erl b/lib/typer/test/typer_SUITE.erl new file mode 100644 index 0000000000..b6f7b2119b --- /dev/null +++ b/lib/typer/test/typer_SUITE.erl @@ -0,0 +1,50 @@ +%% ``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 via the world wide web 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. +%% +%% The Initial Developer of the Original Code is Ericsson Utvecklings AB. +%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings +%% AB. All Rights Reserved.'' +%% +-module(typer_SUITE). + +-compile([export_all]). +-include_lib("common_test/include/ct.hrl"). + +suite() -> + [{ct_hooks, [ts_install_cth]}]. + +all() -> + [app, appup]. + +groups() -> + []. + +init_per_suite(Config) -> + Config. + +end_per_suite(_Config) -> + ok. + +init_per_group(_GroupName, Config) -> + Config. + +end_per_group(_GroupName, Config) -> + Config. + +app() -> + [{doc, "Test that the typer app file is ok"}]. +app(Config) when is_list(Config) -> + ok = ?t:app_test(typer). + +appup() -> + [{doc, "Test that the typer appup file is ok"}]. +appup(Config) when is_list(Config) -> + ok = ?t:appup_test(typer). -- cgit v1.2.3 From beae7ae0dab99a34ac6a6471feb8a7b9b2a3ed32 Mon Sep 17 00:00:00 2001 From: Tobias Schlager Date: Fri, 21 Feb 2014 12:12:59 +0100 Subject: Dynamically configure typer_SUITE according to environment Disables the typer app_test when dependent applications are missing. --- lib/typer/test/typer_SUITE.erl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/typer') diff --git a/lib/typer/test/typer_SUITE.erl b/lib/typer/test/typer_SUITE.erl index b6f7b2119b..99c4facbad 100644 --- a/lib/typer/test/typer_SUITE.erl +++ b/lib/typer/test/typer_SUITE.erl @@ -22,7 +22,13 @@ suite() -> [{ct_hooks, [ts_install_cth]}]. all() -> - [app, appup]. + case application:ensure_all_started(typer) of + {ok, Apps} -> + [application:stop(App) || App <- lists:reverse(Apps)], + [app, appup]; + _ -> + [appup] + end. groups() -> []. -- cgit v1.2.3