Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shweta Shrivastava
openairinterface5G
Commits
aa00a473
Commit
aa00a473
authored
Jul 30, 2018
by
Wang Tsu-Han
Browse files
reset for remerging
parent
0b405e3d
Changes
516
Expand all
Hide whitespace changes
Inline
Side-by-side
ci-scripts/Jenkinsfile-gitlab
View file @
aa00a473
...
...
@@ -8,49 +8,208 @@ pipeline {
disableConcurrentBuilds()
timestamps()
gitLabConnection('OAI GitLab')
//
gitlabBuilds(builds: ["Build
", "Test
"])
gitlabBuilds(builds: ["Build
eNb-USRP", "Build basic-sim", "Build phy-sim", "Build eNb-ethernet", "Build UE-ethernet", "Analysis with cppcheck", "Test phy-sim
"])
}
stages {
stage ("Verify
Parameter
s") {
stage ("Verify
Guideline
s") {
steps {
echo 'Verify Parameters'
echo "Git URL is ${GIT_URL}"
echo "GitLab Act is ${env.gitlabActionType}"
script {
if ("MERGE".equals(env.gitlabActionType)) {
// GitLab-Jenkins pugin integration is lacking to perform the merge by itself
// GitLab-Jenkins p
l
ugin integration is lacking to perform the merge by itself
// Doing it manually --> it may have merge conflicts
sh "./ci-scripts/doGitLabMerge.sh ${env.gitlabSourceBranch} ${env.gitlabMergeRequestLastCommit} ${env.gitlabTargetBranch} ${GIT_COMMIT}"
sh "./ci-scripts/checkCodingFormattingRules.sh ${env.gitlabSourceBranch} ${env.gitlabTargetBranch}"
sh "./ci-scripts/doGitLabMerge.sh --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
sh "zip -r -qq localZip.zip ."
// Running astyle options on the list of modified files by the merge request
// For the moment, there is no fail criteria. Just a notification of number of files that do not follow
sh "./ci-scripts/checkCodingFormattingRules.sh --src-branch ${env.gitlabSourceBranch} --target-branch ${env.gitlabTargetBranch}"
def res=readFile('./oai_rules_result.txt').trim();
if ("0".equals(res)) {
addGitLabMRComment comment: "All Changed files in Merge Request follow OAI Formatting Rules"
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): All Changed files in Merge Request follow OAI Formatting Rules"
addGitLabMRComment comment: message
} else {
addGitLabMRComment comment: "Some Changed files in Merge Request DO NOT follow OAI Formatting Rules"
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Some Changed files in Merge Request DO NOT follow OAI Formatting Rules"
addGitLabMRComment comment: message
}
} else {
echo "Git Branch is ${GIT_BRANCH}"
echo "Git Commit is ${GIT_COMMIT}"
sh "zip -r -qq localZip.zip ."
// Running astyle options on all C/H files in the repository
// For the moment, there is no fail criteria. Just a notification of number of files that do not follow
sh "./ci-scripts/checkCodingFormattingRules.sh"
}
}
}
post {
failure {
script {
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Merge Conflicts -- Cannot perform CI"
addGitLabMRComment comment: message
}
}
}
}
stage ("Start VM -- cppcheck") {
steps {
sh "./ci-scripts/createVM.sh --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
stage ("Start VM -- enb-usrp") {
steps {
sh "./ci-scripts/createVM.sh --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
stage ("Start VM -- basic-sim") {
steps {
sh "./ci-scripts/createVM.sh --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
stage ("Start VM -- phy-sim") {
steps {
sh "./ci-scripts/createVM.sh --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
stage ("Start VM -- enb-ethernet") {
steps {
sh "./ci-scripts/createVM.sh --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
stage ("Start VM -- ue-ethernet") {
steps {
sh "./ci-scripts/createVM.sh --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
stage ("Variant Builds") {
parallel {
stage ("Analysis with cppcheck") {
steps {
gitlabCommitStatus(name: "Analysis with cppcheck") {
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
}
}
}
stage ("Build eNb-USRP") {
steps {
gitlabCommitStatus(name: "Build eNb-USRP") {
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
}
}
}
stage ("Build basic simulator") {
steps {
gitlabCommitStatus(name: "Build basic-sim") {
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
}
}
}
stage ("Build physical simulators") {
steps {
gitlabCommitStatus(name: "Build phy-sim") {
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
}
}
}
stage ("Build eNb-ethernet") {
steps {
gitlabCommitStatus(name: "Build eNb-ethernet") {
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
}
}
}
stage ("Build UE-ethernet") {
steps {
gitlabCommitStatus(name: "Build UE-ethernet") {
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
}
}
}
}
post {
always {
script {
dir ('archives') {
sh "zip -r -qq vm_build_logs.zip basic_sim enb_usrp phy_sim cppcheck enb_eth ue_eth"
}
if(fileExists('archives/vm_build_logs.zip')) {
archiveArtifacts artifacts: 'archives/vm_build_logs.zip'
}
if ("MERGE".equals(env.gitlabActionType)) {
sh "./ci-scripts/reportBuildLocally.sh --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger merge-request --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
} else {
sh "./ci-scripts/reportBuildLocally.sh --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger push --branch ${GIT_BRANCH} --commit ${GIT_COMMIT}"
}
if(fileExists('build_results.html')) {
archiveArtifacts artifacts: 'build_results.html'
}
}
}
}
}
stage ("Variant Tests") {
parallel {
stage ("Test physical simulators") {
steps {
gitlabCommitStatus(name: "Test phy-sim") {
sh "./ci-scripts/runTestOnVM.sh --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
}
}
}
stage ("Test basic simulator") {
steps {
//gitlabCommitStatus(name: "Test basic-sim") {
sh "./ci-scripts/runTestOnVM.sh --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
//}
}
}
}
post {
always {
script {
dir ('archives') {
sh "if [ -d */test ]; then zip -r -qq vm_tests_logs.zip */test ; fi"
}
if(fileExists('archives/vm_tests_logs.zip')) {
archiveArtifacts artifacts: 'archives/vm_tests_logs.zip'
archiveArtifacts artifacts: 'archives/*/test/results_autotests*.xml'
archiveArtifacts artifacts: 'archives/*/test/*.xsl'
}
}
}
}
}
stage ("Destroy all Virtual Machines") {
steps {
sh "./ci-scripts/destroyAllRunningVM.sh --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
}
post {
always {
script {
echo "End of script"
// Stage destroy may not be run if error in previous stage
sh "./ci-scripts/destroyAllRunningVM.sh --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
}
}
success {
script {
def message = "OAI build
#
" + BUILD_ID + " passed (" + BUILD_URL + ")"
def message = "OAI
" + JOB_NAME + "
build
(
" + BUILD_ID + "
):
passed (" + BUILD_URL + ")"
if ("MERGE".equals(env.gitlabActionType)) {
echo "This is a MERGE event"
addGitLabMRComment comment: message
def message2 = "OAI build
#
" + BUILD_ID + " passed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")"
def message2 = "OAI
" + JOB_NAME + "
build
(
" + BUILD_ID + "
):
passed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")"
slackSend channel: 'ci-enb', color: 'good', message: message2
} else {
slackSend channel: 'ci-enb', color: 'good', message: message
...
...
@@ -59,11 +218,11 @@ pipeline {
}
failure {
script {
def message = "OAI build
#
" + BUILD_ID + " failed (" + BUILD_URL + ")"
def message = "OAI
" + JOB_NAME + "
build
(
" + BUILD_ID + "
):
failed (" + BUILD_URL + ")"
if ("MERGE".equals(env.gitlabActionType)) {
echo "This is a MERGE event"
addGitLabMRComment comment: message
def message2 = "OAI build
#
" + BUILD_ID + " failed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")"
def message2 = "OAI
" + JOB_NAME + "
build
(
" + BUILD_ID + "
):
failed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")"
slackSend channel: 'ci-enb', color: 'danger', message: message2
} else {
slackSend channel: 'ci-enb', color: 'danger', message: message
...
...
ci-scripts/checkCodingFormattingRules.sh
View file @
aa00a473
#!/bin/bash
function
usage
{
echo
"OAI Coding / Formatting Guideline Check script"
echo
" Original Author: Raphael Defosseux"
echo
""
echo
" Requirement: astyle shall be installed"
echo
""
echo
" By default (no options) the complete repository will be checked"
echo
" In case of merge request, provided source and target branch,"
echo
" the script will check only the modified files"
echo
""
echo
"Usage:"
echo
"------"
echo
" checkCodingFormattingRules.sh [OPTIONS]"
echo
""
echo
"Options:"
echo
"--------"
echo
" --src-branch #### OR -sb ####"
echo
" Specify the source branch of the merge request."
echo
""
echo
" --target-branch #### OR -tb ####"
echo
" Specify the target branch of the merge request (usually develop)."
echo
""
echo
" --help OR -h"
echo
" Print this help message."
echo
""
}
if
[
$#
-ne
4
]
&&
[
$#
-ne
1
]
&&
[
$#
-ne
0
]
then
echo
"Syntax Error: not the correct number of arguments"
echo
""
usage
exit
1
fi
if
[
$#
-eq
0
]
then
echo
" ---- Checking the whole repository ----"
echo
""
NB_FILES_TO_FORMAT
=
`
astyle
--dry-run
--options
=
ci-scripts/astyle-options.txt
--recursive
*
.c
*
.h |
grep
-c
Formatted
`
echo
"Nb Files that do NOT follow OAI rules:
$NB_FILES_TO_FORMAT
"
echo
$NB_FILES_TO_FORMAT
>
./oai_rules_result.txt
exit
0
fi
if
[
$#
-eq
2
]
then
# Merge request scenario
SOURCE_BRANCH
=
$1
echo
"Source Branch is :
$SOURCE_BRANCH
"
TARGET_BRANCH
=
$2
echo
"Target Branch is :
$TARGET_BRANCH
"
MERGE_COMMMIT
=
`
git log
-n1
|
grep
commit |
sed
-e
"s@commit @@"
`
echo
"Merged Commit is :
$MERGE_COMMMIT
"
TARGET_INIT_COMMIT
=
`
cat
.git/refs/remotes/origin/
$TARGET_BRANCH
`
echo
"Target Init is :
$TARGET_INIT_COMMIT
"
# Retrieve the list of modified files since the latest develop commit
MODIFIED_FILES
=
`
git log
$TARGET_INIT_COMMIT
..
$MERGE_COMMMIT
--oneline
--name-status
| egrep
"^M|^A"
|
sed
-e
"s@^M
\t
*@@"
-e
"s@^A
\t
*@@"
|
sort
|
uniq
`
NB_TO_FORMAT
=
0
for
FULLFILE
in
$MODIFIED_FILES
do
echo
$FULLFILE
filename
=
$(
basename
--
"
$FULLFILE
"
)
EXT
=
"
${
filename
##*.
}
"
if
[
$EXT
=
"c"
]
||
[
$EXT
=
"h"
]
||
[
$EXT
=
"cpp"
]
||
[
$EXT
=
"hpp"
]
then
TO_FORMAT
=
`
astyle
--dry-run
--options
=
ci-scripts/astyle-options.txt
$FULLFILE
|
grep
-c
Formatted
`
NB_TO_FORMAT
=
$((
NB_TO_FORMAT
+
TO_FORMAT
))
fi
done
echo
"Nb Files that do NOT follow OAI rules:
$NB_TO_FORMAT
"
echo
$NB_TO_FORMAT
>
./oai_rules_result.txt
checker
=
0
while
[[
$#
-gt
0
]]
do
key
=
"
$1
"
case
$key
in
-h
|
--help
)
shift
usage
exit
0
fi
;;
-sb
|
--src-branch
)
SOURCE_BRANCH
=
"
$2
"
let
"checker|=0x1"
shift
shift
;;
-tb
|
--target-branch
)
TARGET_BRANCH
=
"
$2
"
let
"checker|=0x2"
shift
shift
;;
*
)
echo
"Syntax Error: unknown option:
$key
"
echo
""
usage
exit
1
esac
if
[
$#
-ne
0
]
||
[
$#
-ne
2
]
done
if
[
$checker
-ne
3
]
then
echo
"Syntax error:
$0
without any option will check all files in repository"
echo
" or:
$0
source-branch target-branch"
echo
" will only check files that are pushed for a merge-request"
echo
"Source Branch is :
$SOURCE_BRANCH
"
echo
"Target Branch is :
$TARGET_BRANCH
"
echo
""
echo
"Syntax Error: missing option"
echo
""
usage
exit
1
fi
# Merge request scenario
MERGE_COMMMIT
=
`
git log
-n1
|
grep
commit |
sed
-e
"s@commit @@"
`
TARGET_INIT_COMMIT
=
`
cat
.git/refs/remotes/origin/
$TARGET_BRANCH
`
echo
" ---- Checking the modified files by the merge request ----"
echo
""
echo
"Source Branch is :
$SOURCE_BRANCH
"
echo
"Target Branch is :
$TARGET_BRANCH
"
echo
"Merged Commit is :
$MERGE_COMMMIT
"
echo
"Target Init is :
$TARGET_INIT_COMMIT
"
# Retrieve the list of modified files since the latest develop commit
MODIFIED_FILES
=
`
git log
$TARGET_INIT_COMMIT
..
$MERGE_COMMMIT
--oneline
--name-status
| egrep
"^M|^A"
|
sed
-e
"s@^M
\t
*@@"
-e
"s@^A
\t
*@@"
|
sort
|
uniq
`
NB_TO_FORMAT
=
0
for
FULLFILE
in
$MODIFIED_FILES
do
echo
$FULLFILE
filename
=
$(
basename
--
"
$FULLFILE
"
)
EXT
=
"
${
filename
##*.
}
"
if
[
$EXT
=
"c"
]
||
[
$EXT
=
"h"
]
||
[
$EXT
=
"cpp"
]
||
[
$EXT
=
"hpp"
]
then
TO_FORMAT
=
`
astyle
--dry-run
--options
=
ci-scripts/astyle-options.txt
$FULLFILE
|
grep
-c
Formatted
`
NB_TO_FORMAT
=
$((
NB_TO_FORMAT
+
TO_FORMAT
))
fi
done
echo
"Nb Files that do NOT follow OAI rules:
$NB_TO_FORMAT
"
echo
$NB_TO_FORMAT
>
./oai_rules_result.txt
exit
0
ci-scripts/doGitLabMerge.sh
View file @
aa00a473
#!/bin/bash
if
[
$#
-ne
4
]
function
usage
{
echo
"OAI GitLab merge request applying script"
echo
" Original Author: Raphael Defosseux"
echo
""
echo
"Usage:"
echo
"------"
echo
""
echo
" doGitLabMerge.sh [OPTIONS] [MANDATORY_OPTIONS]"
echo
""
echo
"Mandatory Options:"
echo
"------------------"
echo
""
echo
" --src-branch #### OR -sb ####"
echo
" Specify the source branch of the merge request."
echo
""
echo
" --src-commit #### OR -sc ####"
echo
" Specify the source commit ID (SHA-1) of the merge request."
echo
""
echo
" --target-branch #### OR -tb ####"
echo
" Specify the target branch of the merge request (usually develop)."
echo
""
echo
" --target-commit #### OR -tc ####"
echo
" Specify the target commit ID (SHA-1) of the merge request."
echo
""
echo
"Options:"
echo
"--------"
echo
" --help OR -h"
echo
" Print this help message."
echo
""
}
if
[
$#
-ne
8
]
&&
[
$#
-ne
1
]
then
echo
"Syntax Error:
$0
src-branch src-commit-id dest-branch dest-commit-id"
echo
"Syntax Error: not the correct number of arguments"
echo
""
usage
exit
1
fi
SOURCE_BRANCH
=
$1
echo
"Source Branch is :
$SOURCE_BRANCH
"
checker
=
0
while
[[
$#
-gt
0
]]
do
key
=
"
$1
"
SOURCE_COMMIT_ID
=
$2
echo
"Source Commit ID is :
$SOURCE_COMMIT_ID
"
case
$key
in
-h
|
--help
)
shift
usage
exit
0
;;
-sb
|
--src-branch
)
SOURCE_BRANCH
=
"
$2
"
let
"checker|=0x1"
shift
shift
;;
-sc
|
--src-commit
)
SOURCE_COMMIT_ID
=
"
$2
"
let
"checker|=0x2"
shift
shift
;;
-tb
|
--target-branch
)
TARGET_BRANCH
=
"
$2
"
let
"checker|=0x4"
shift
shift
;;
-tc
|
--target-commit
)
TARGET_COMMIT_ID
=
"
$2
"
let
"checker|=0x8"
shift
shift
;;
*
)
echo
"Syntax Error: unknown option:
$key
"
echo
""
usage
exit
1
esac
TARGET_BRANCH
=
$3
echo
"Target Branch is :
$TARGET_BRANCH
"
done
TARGET_COMMIT_ID
=
$4
echo
"Source Branch is :
$SOURCE_BRANCH
"
echo
"Source Commit ID is :
$SOURCE_COMMIT_ID
"
echo
"Target Branch is :
$TARGET_BRANCH
"
echo
"Target Commit ID is :
$TARGET_COMMIT_ID
"
if
[
$checker
-ne
15
]
then
echo
""
echo
"Syntax Error: missing option"
echo
""
usage
exit
1
fi
git config user.email
"jenkins@openairinterface.org"
git config user.name
"OAI Jenkins"
...
...
@@ -25,3 +104,10 @@ git checkout -f $SOURCE_COMMIT_ID
git merge
--ff
$TARGET_COMMIT_ID
-m
"Temporary merge for CI"
STATUS
=
`
git status | egrep
-c
"You have unmerged paths.|fix conflicts"
`
if
[
$STATUS
-ne
0
]
then
echo
"There are merge conflicts.. Cannot perform further build tasks"
STATUS
=
-1
fi
exit
$STATUS
cmake_targets/CMakeLists.txt
View file @
aa00a473
This diff is collapsed.
Click to expand it.
cmake_targets/autotests/run_exec_autotests.bash
View file @
aa00a473
...
...
@@ -175,10 +175,10 @@ function test_compile() {
fi
if
[
"
$result
"
==
"1"
]
;
then
echo_success
"
$test_case_name
.
${
tags
}
PASSED"
xUnit_success
"compilation"
"
$test_case_name
.
$tags
"
"PASS"
"
$result_string
"
"
$xmlfile_testcase
"
xUnit_success
"compilation"
"
$test_case_name
.
$tags
"
"PASS"
"
$result_string
"
"
$xmlfile_testcase
"
""
else
echo_error
"
$test_case_name
.
${
tags
}
FAILED"
xUnit_fail
"compilation"
"
$test_case_name
.
$tags
"
"FAIL"
"
$result_string
"
"
$xmlfile_testcase
"
xUnit_fail
"compilation"
"
$test_case_name
.
$tags
"
"FAIL"
"
$result_string
"
"
$xmlfile_testcase
"
""
fi
}
...
...
@@ -200,6 +200,8 @@ function test_compile() {
#\param $14 -> tags to help identify the test case for readability in output xml file
#\param $15 => password for the user to run certain commands as sudo
#\param $16 => test config file params to be modified
#\param $17 => bypass flag if main_exec if available
#\param $18 -> desc to help identify the test case for readability in output xml file
function
test_compile_and_run
()
{
xUnit_start
...
...
@@ -221,6 +223,8 @@ function test_compile_and_run() {
tags
=
${
14
}
mypassword
=
${
15
}
test_config_file
=
${
16
}
bypass_compile
=
${
17
}
desc
=
${
18
}
build_dir
=
$tdir
/
$1
/build
#exec_file=$build_dir/$6
...
...
@@ -231,8 +235,6 @@ function test_compile_and_run() {
rm
-fr
$log_dir
mkdir
-p
$log_dir
rm
-fr
$OPENAIR_DIR
/cmake_targets/log
echo
""
>
$temp_exec_log
echo
""
>
$log_file
#echo "log_dir = $log_dir"
...
...
@@ -243,6 +245,7 @@ function test_compile_and_run() {
#echo "pre_exec_file = $pre_exec_file"
#echo "nruns = $nruns"
echo
"class =
$class
"
#echo "desc = $desc"
#compile_prog_array=()
#read -a compile_prog_array <<<"$compile_prog"
...
...
@@ -253,11 +256,19 @@ function test_compile_and_run() {
tags_array
=()
read
-a
tags_array
<<<
"
$tags
"
desc_array
=()
readarray
-t
desc_array
<<<
"
$desc
"
main_exec_args_array
=()
readarray
-t
main_exec_args_array
<<<
"
$exec_args
"
REAL_MAIN_EXEC
=
`
eval
"echo
$main_exec
"
`
if
[
"
$bypass_compile
"
==
"1"
]
&&
[
-f
$REAL_MAIN_EXEC
]
then
echo
"Bypassing compilation for
$main_exec
"
else
rm
-fr
$OPENAIR_DIR
/cmake_targets/log
#for search_expr in "${compile_prog_array[@]}"
#do
echo
"Compiling test case
$test_case_name
Log file =
$log_file
"
...
...
@@ -283,6 +294,7 @@ function test_compile_and_run() {
}>>
$log_file
2>&1
echo
"</COMPILATION LOG>"
>>
$log_file
2>&1
#done
fi
#process the test case if it is that of execution
if
[
"
$class
"
==
"execution"
]
;
then
...
...
@@ -291,6 +303,7 @@ function test_compile_and_run() {
do
global_result
=
1
result_string
=
""
PROPER_DESC
=
`
echo
${
desc_array
[
$tags_array_index
]
}
|
sed
-e
"s@^.*lsim.*est case.*(Test@Test@"
-e
"s@^ *(@@"
-e
"s/),
$/
/"
`
for
((
run_index
=
1
;
run_index <
=
$nruns
;
run_index++
))
do
...
...
@@ -359,16 +372,16 @@ function test_compile_and_run() {
if
[
"
$result_string
"
==
""
]
;
then
echo_error
"execution
$test_case_name
.
$compile_prog
.
${
tags_array
[
$tags_array_index
]
}
Run_Result =
\"
$result_string
\"
Result = FAIL"
xUnit_fail
"execution"
"
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
"
"FAIL"
"
$result_string
"
"
$xmlfile_testcase
"
xUnit_fail
"execution"
"
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
"
"FAIL"
"
$result_string
"
"
$xmlfile_testcase
"
"
$PROPER_DESC
"
else
if
[
"
$global_result
"
==
"0"
]
;
then
echo_error
"execution
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
Run_Result =
\"
$result_string
\"
Result = FAIL"
xUnit_fail
"execution"
"
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
"
"FAIL"
"
$result_string
"
"
$xmlfile_testcase
"
xUnit_fail
"execution"
"
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
"
"FAIL"
"
$result_string
"
"
$xmlfile_testcase
"
"
$PROPER_DESC
"
fi
if
[
"
$global_result
"
==
"1"
]
;
then
echo_success
"execution
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
Run_Result =
\"
$result_string
\"
Result = PASS "
xUnit_success
"execution"
"
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
"
"PASS"
"
$result_string
"
"
$xmlfile_testcase
"
xUnit_success
"execution"
"
$test_case_name
.
${
tags_array
[
$tags_array_index
]
}
"
"PASS"
"
$result_string
"
"
$xmlfile_testcase
"
"
$PROPER_DESC
"
fi
fi
...
...
@@ -393,10 +406,18 @@ Options
Run test cases in a group. For example, ./run_exec_autotests "0101* 010102"
-p
Use password for logging
-np | --no-password
No need for a password
-q | --quiet
Quiet mode; eliminate informational messages and comment prompts.