File 0325-megaco-example-Add-spec-and-update-doc-for-mstone1-s.patch of Package erlang
From c98d14d7e0bf9d50d4322923f8d8c417cc51fa76 Mon Sep 17 00:00:00 2001
From: Micael Karlberg <bmk@erlang.org>
Date: Tue, 25 Feb 2025 18:17:03 +0100
Subject: [PATCH 5/8] [megaco|example] Add spec and update doc for mstone1
start_only_drv/1 and start_only_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 7b0dcd278f..a0bb5613b1 100644
--- a/lib/megaco/examples/meas/megaco_codec_mstone1.erl
+++ b/lib/megaco/examples/meas/megaco_codec_mstone1.erl
@@ -192,7 +192,19 @@ start_flex(MessagePackage, RunTime, Factor) ->
start_only_drv() ->
start_only_drv(?DEFAULT_FACTOR).
--doc(#{equiv => start_only_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_only_drv([Factor]) ->
start_only_drv(?DEFAULT_MESSAGE_PACKAGE, ?MSTONE_RUN_TIME, Factor);
start_only_drv([MessagePackage, Factor]) ->
@@ -210,6 +222,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_only_drv(MessagePackage, Factor) -> ok when
+ MessagePackage :: atom(),
+ Factor :: pos_integer().
+
start_only_drv(MessagePackage, Factor) ->
do_start(MessagePackage, ?MSTONE_RUN_TIME, Factor, only_drv).
--
2.43.0