blob: ef510c70ae7fa0718709ee0e2c5171afac172490 [file] [log] [blame]
Sivas SRR44709572017-04-28 07:16:46 -05001#!/bin/bash
2
3# This program will generate test documenation from the robot test cases.
4
5# Description of argument(s):
6# test_dir_path Test directory where robot test cases are available.
7# test_case_doc_file_path The test case document file path to be stored.
8
9
Sivas SRR44709572017-04-28 07:16:46 -050010function get_parms {
11
12 # Get program parms.
13
14 test_dir_path="${1}" ; shift
15 test_case_doc_file_path="${1}" ; shift
16
17 return 0
18
19}
Sivas SRR44709572017-04-28 07:16:46 -050020
21
Sivas SRR44709572017-04-28 07:16:46 -050022function validate_parms {
23
24 # Validate program parameters.
25
26 num_parms="${1}" ; shift
27
28 (( ${num_parms} == 0 )) && return 0
29
30 if [ -z "${test_dir_path}" ] ; then
31 echo "**ERROR** You must provide test directory as the first positional" \
32 "parameter." >&2
33 return 1
34 fi
35
36 if [ -z "${test_case_doc_file_path}" ] ; then
37 echo "**ERROR** You must provide file path as the second positional" \
38 "parameter." >&2
39 return 1
40 fi
41
42 return 0
43
44}
Sivas SRR44709572017-04-28 07:16:46 -050045
46
Sivas SRR44709572017-04-28 07:16:46 -050047function generate_all_test_document {
48
49 # Generate all test case documents
50
51 local ret_code=0
52 python -m robot.testdoc tests testsdirectoryTCdocs.html || ret_code=1
53 python -m robot.testdoc extended extendeddirectoryTCdocs.html || ret_code=1
54 python -m robot.testdoc gui guidirectoryTCdocs.html || ret_code=1
55 python -m robot.testdoc systest systestdirectoryTCdocs.html || ret_code=1
Sivas SRR9bd2f832017-05-29 10:57:57 -050056 python -m robot.testdoc xcat xcatdirectoryTCdocs.html || ret_code=1
57 python -m robot.testdoc mnfg mnfgdirectoryTCdocs.html || ret_code=1
Sivas SRRb35dd6a2017-06-06 02:56:51 -050058 python -m robot.testdoc tools toolsdirectoryTCdocs.html || ret_code=1
Sivas SRR44709572017-04-28 07:16:46 -050059
60 return ${ret_code}
61}
Sivas SRR44709572017-04-28 07:16:46 -050062
63
Sivas SRR44709572017-04-28 07:16:46 -050064function main_function {
65
66 get_parms "$@" || return 1
67
68 validate_parms $# || return 1
69
70 if (( ${num_parms} == 0 )) ; then
71 generate_all_test_document || return 1
72 return 0
73 fi
74
75 echo ${test_dir_path} ${test_case_doc_file_path}
76 python -m robot.testdoc ${test_dir_path} ${test_case_doc_file_path}\
77 || return 1
78
79 return 0
80
81}
Sivas SRR44709572017-04-28 07:16:46 -050082
83
Sivas SRR44709572017-04-28 07:16:46 -050084# Main
85
86 main_function "${@}"
87 rc="${?}"
88 exit "${rc}"
89