[LTP] [PATCH v3 5/5] doc: Update shell API examples

Petr Vorel pvorel@suse.cz
Wed Apr 27 14:50:03 CEST 2022


Reviewed-by: Martin Doucha <mdoucha@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
changes v2->v3:
* remove last sentence from docs

 doc/library-api-writing-guidelines.txt | 4 ++--
 doc/shell-test-api.txt                 | 8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/doc/library-api-writing-guidelines.txt b/doc/library-api-writing-guidelines.txt
index 08468f2fc..3b8c1d97d 100644
--- a/doc/library-api-writing-guidelines.txt
+++ b/doc/library-api-writing-guidelines.txt
@@ -78,7 +78,7 @@ shell library.
 -------------------------------------------------------------------------------
 # ipsec_lib.sh
 # SPDX-License-Identifier: GPL-2.0-or-later
-TST_SETUP=${TST_SETUP:-ipsec_lib_setup}
-. tst_test.sh
+TST_SETUP="${TST_SETUP:-ipsec_lib_setup}"
 ...
+. tst_test.sh
 -------------------------------------------------------------------------------
diff --git a/doc/shell-test-api.txt b/doc/shell-test-api.txt
index 4c16f3625..df5ebbdf0 100644
--- a/doc/shell-test-api.txt
+++ b/doc/shell-test-api.txt
@@ -40,6 +40,7 @@ do_test()
 	fi
 }
 
+. tst_test.sh
 tst_run
 -------------------------------------------------------------------------------
 
@@ -90,6 +91,7 @@ test2()
 	tst_res TPASS "Test $1 passed"
 }
 
+. tst_test.sh
 tst_run
 # output:
 # foo 1 TPASS: Test 1 passed
@@ -118,6 +120,7 @@ do_test()
 	esac
 }
 
+. tst_test.sh
 tst_run
 # output:
 # foo 1 TPASS: Test 1 passed
@@ -145,6 +148,7 @@ do_test()
 	tst_res TPASS "Test $1 passed with data '$2'"
 }
 
+. tst_test.sh
 tst_run
 # output:
 # foo 1 TPASS: Test 1 passed with data 'foo'
@@ -174,6 +178,7 @@ do_test()
 	esac
 }
 
+. tst_test.sh
 tst_run
 # output:
 # foo 1 TPASS: Test 1 passed with data 'foo'
@@ -278,6 +283,7 @@ do_test()
 	...
 }
 
+. tst_test.sh
 tst_run
 -------------------------------------------------------------------------------
 
@@ -337,6 +343,7 @@ do_test()
 	...
 }
 
+. tst_test.sh
 tst_run
 -------------------------------------------------------------------------------
 
@@ -379,6 +386,7 @@ do_test()
 	...
 }
 
+. tst_test.sh
 tst_run
 -------------------------------------------------------------------------------
 
-- 
2.35.3



More information about the ltp mailing list