1
%% ``The contents of this file are subject to the Erlang Public License,
2
%% Version 1.1, (the "License"); you may not use this file except in
3
%% compliance with the License. You should have received a copy of the
4
%% Erlang Public License along with this software. If not, it can be
5
%% retrieved via the world wide web at http://www.erlang.org/.
7
%% Software distributed under the License is distributed on an "AS IS"
8
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
9
%% the License for the specific language governing rights and limitations
12
%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
13
%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
14
%% AB. All Rights Reserved.''
26
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30
%%---------------------------------------------------------------------------
33
%% Runs all benchmark modules in the current directory on all erlang
34
%% installations specified by releases/0
35
%%---------------------------------------------------------------------------
37
%% Delete previous intermediate test result files.
38
lists:foreach(fun(F) -> file:delete(F) end, filelib:wildcard("*.bmres")),
39
lists:foreach(fun run/1, releases()).
41
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42
%%% Internal functions
43
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
45
%%---------------------------------------------------------------------------
47
%% Release = string() - Erlang release
48
%% Help functions to run/0
49
%%---------------------------------------------------------------------------
51
command(Release ++ " -noshell -compile bench -s erlang halt"),
52
command(Release ++ " -noshell -s bench run -s erlang halt").
53
%%---------------------------------------------------------------------------
54
%% command(Command) -> _
55
%% Command = string() - is the name and arguments of the external
56
%% program which will be run
57
%%---------------------------------------------------------------------------
59
io:format("~s\n", [Command]), % Progress info to user
60
Port = open_port({spawn,Command}, [exit_status, in]),
62
%%---------------------------------------------------------------------------
63
%% print_output(Port) -> _
65
%% Print data from the port i.e. output from external program,
67
%%---------------------------------------------------------------------------
70
{Port, {data,Bytes}} ->
73
{Port, {exit_status, ?NORMAL}} ->
76
%%---------------------------------------------------------------------------
78
%% Releases = [Release |_]
79
%% Release = string() - Erlang release
80
%% Defines which erlang releases to run on
81
%% --- Change this function to reflect your own erlang installations ---
82
%%---------------------------------------------------------------------------
84
["/usr/local/otp/releases/otp_beam_sunos5_r7b01_patched/bin/erl",
85
"/usr/local/otp/releases/otp_beam_sunos5_r8b_patched/bin/erl"].