File 0324-megaco-example-Add-spec-and-update-doc-for-mstone1-s.patch of Package erlang
From 2ec80b984e3bcd137d73a8a89278d54e67b15af9 Mon Sep 17 00:00:00 2001
From: Micael Karlberg <bmk@erlang.org>
Date: Tue, 25 Feb 2025 18:05:30 +0100
Subject: [PATCH 4/8] [megaco|example] Add spec and update doc for mstone1
start_no_drv/1 and start_no_drv/2
---
.../examples/meas/megaco_codec_mstone1.erl | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/lib/megaco/examples/meas/megaco_codec_mstone1.erl b/lib/megaco/examples/meas/megaco_codec_mstone1.erl
index bf2cb7b63b..7b0dcd278f 100644
--- a/lib/megaco/examples/meas/megaco_codec_mstone1.erl
+++ b/lib/megaco/examples/meas/megaco_codec_mstone1.erl
@@ -221,7 +221,19 @@ start_only_drv(MessagePackage, RunTime, Factor) ->
start_no_drv() ->
start_no_drv(?DEFAULT_FACTOR).
--doc(#{equiv => start_no_drv/2}).
+-doc """
+start_no_drv([MessagePackage, RunTime, Factor])
+
+This function is intended to be called from the _mstone1_ script, which
+uses the '-s' arguments to run the function (argument order; message package,
+run time (in minutes in the example) and factor):
+
+```text
+erl -s megaco_codec_mstone1 start_no_drv time_test 1 1
+```
+
+""".
+
start_no_drv([Factor]) ->
start_no_drv(?DEFAULT_MESSAGE_PACKAGE, ?MSTONE_RUN_TIME, Factor);
start_no_drv([MessagePackage, Factor]) ->
@@ -239,6 +251,11 @@ started as when running the standard test (using the `start/0,1` function). Each
process encodes and decodes their messages. The number of messages processed in
total (for all processes) is the mstone value.
""".
+
+-spec start_no_drv(MessagePackage, Factor) -> ok when
+ MessagePackage :: atom(),
+ Factor :: pos_integer().
+
start_no_drv(MessagePackage, Factor) ->
do_start(MessagePackage, ?MSTONE_RUN_TIME, Factor, no_drv).
--
2.43.0