diff options
| author | Emile Joubert <emile@rabbitmq.com> | 2011-06-28 14:00:29 +0100 |
|---|---|---|
| committer | Emile Joubert <emile@rabbitmq.com> | 2011-06-28 14:00:29 +0100 |
| commit | e8a538f31abf2eaba95df6d5c9811e7869d8b38b (patch) | |
| tree | 57f5ca9d4f9b54ca5a88adffa508a7df0c01fcfd /quickcheck | |
| parent | 45fcc2b8769e6bbc34dfcc33b1b8408f1961b0b6 (diff) | |
| download | rabbitmq-server-git-e8a538f31abf2eaba95df6d5c9811e7869d8b38b.tar.gz | |
Add conditional compilation and makefile infrastructure
Diffstat (limited to 'quickcheck')
| -rwxr-xr-x | quickcheck | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/quickcheck b/quickcheck new file mode 100755 index 0000000000..24edae7031 --- /dev/null +++ b/quickcheck @@ -0,0 +1,32 @@ +#!/usr/bin/env escript +%% -*- erlang -*- +%%! -sname quickcheck +-mode(compile). + +%% A helper to test quickcheck properties on a running broker +%% NodeStr is a local broker node name +%% ModStr is the module containing quickcheck properties +%% The number of trials is optional +main([NodeStr, ModStr | TrialsStr]) -> + Node = list_to_atom(NodeStr ++ "@" ++ net_adm:localhost()), + Mod = list_to_atom(ModStr), + Trials = lists:map(fun erlang:list_to_integer/1, TrialsStr), + case rpc:call(Node, code, ensure_loaded, [proper]) of + {module, proper} -> + case rpc:call(Node, proper, module, [Mod] ++ Trials) of + [] -> ok; + _ -> quit(1) + end; + _ -> + io:format("PropEr module not present on node ~p.~n", [Node]), + quit(2) + end; +main([]) -> + io:format("This script requires a node name and a module.~n"). + +quit(Status) -> + case os:type() of + {unix, _} -> halt(Status); + {win32, _} -> init:stop(Status) + end. + |
