Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
3bcc6e9e
Unverified
Commit
3bcc6e9e
authored
Jan 26, 2018
by
Christoph Blecker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add brackets and quotes where needed
parent
670505e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
sh2ju.sh
third_party/forked/shell2junit/sh2ju.sh
+10
-10
No files found.
third_party/forked/shell2junit/sh2ju.sh
View file @
3bcc6e9e
...
@@ -46,7 +46,7 @@ errfile=/tmp/evErr.$$.log
...
@@ -46,7 +46,7 @@ errfile=/tmp/evErr.$$.log
function
eVal
()
{
function
eVal
()
{
(
eval
"
$1
"
)
(
eval
"
$1
"
)
# stdout and stderr may currently be inverted (see below) so echo may write to stderr
# stdout and stderr may currently be inverted (see below) so echo may write to stderr
echo
$?
2>&1 |
tr
-d
"
\n
"
>
${
errfile
}
echo
"
$?
"
2>&1 |
tr
-d
"
\n
"
>
"
${
errfile
}
"
}
}
# Method to clean old tests
# Method to clean old tests
...
@@ -64,7 +64,7 @@ function juLog() {
...
@@ -64,7 +64,7 @@ function juLog() {
# parse arguments
# parse arguments
ya
=
""
;
icase
=
""
ya
=
""
;
icase
=
""
while
[
-z
"
$ya
"
]
;
do
while
[
[
-z
"
$ya
"
]
]
;
do
case
"
$1
"
in
case
"
$1
"
in
-name
=
*
)
name
=
`
echo
"
$1
"
|
${
SED
}
-e
's/-name=//'
`
;
shift
;;
-name
=
*
)
name
=
`
echo
"
$1
"
|
${
SED
}
-e
's/-name=//'
`
;
shift
;;
-class
=
*
)
class
=
`
echo
"
$1
"
|
${
SED
}
-e
's/-class=//'
`
;
shift
;;
-class
=
*
)
class
=
`
echo
"
$1
"
|
${
SED
}
-e
's/-class=//'
`
;
shift
;;
...
@@ -78,7 +78,7 @@ function juLog() {
...
@@ -78,7 +78,7 @@ function juLog() {
# create output directory
# create output directory
mkdir
-p
"
${
juDIR
}
"
||
exit
mkdir
-p
"
${
juDIR
}
"
||
exit
# use first arg as name if it was not given
# use first arg as name if it was not given
if
[
-z
"
${
name
}
"
]
;
then
if
[
[
-z
"
${
name
}
"
]
]
;
then
name
=
"
${
asserts
}
-
$1
"
name
=
"
${
asserts
}
-
$1
"
shift
shift
fi
fi
...
@@ -90,9 +90,9 @@ function juLog() {
...
@@ -90,9 +90,9 @@ function juLog() {
suite
=
${
class
}
suite
=
${
class
}
# calculate command to eval
# calculate command to eval
[
-z
"
$1
"
]
&&
return
[
[
-z
"
$1
"
]
]
&&
return
cmd
=
"
$1
"
;
shift
cmd
=
"
$1
"
;
shift
while
[
-n
"
${
1
:-}
"
]
while
[
[
-n
"
${
1
:-}
"
]
]
do
do
cmd
=
"
${
cmd
}
\"
$1
\"
"
cmd
=
"
${
cmd
}
\"
$1
\"
"
shift
shift
...
@@ -116,13 +116,13 @@ function juLog() {
...
@@ -116,13 +116,13 @@ function juLog() {
echo
"+++ exit code:
${
evErr
}
"
|
tee
-a
${
outf
}
echo
"+++ exit code:
${
evErr
}
"
|
tee
-a
${
outf
}
# set the appropriate error, based in the exit code and the regex
# set the appropriate error, based in the exit code and the regex
[
${
evErr
}
!=
0
]
&&
err
=
1
||
err
=
0
[
[
${
evErr
}
!=
0
]
]
&&
err
=
1
||
err
=
0
out
=
`
cat
$outf
|
${
SED
}
-e
's/^\([^+]\)/| \1/g'
`
out
=
`
cat
$outf
|
${
SED
}
-e
's/^\([^+]\)/| \1/g'
`
if
[
${
err
}
=
0
-a
-n
"
${
ereg
:-}
"
]
;
then
if
[
${
err
}
=
0
-a
-n
"
${
ereg
:-}
"
]
;
then
H
=
`
echo
"
${
out
}
"
| egrep
${
icase
}
"
${
ereg
}
"
`
H
=
`
echo
"
${
out
}
"
| egrep
${
icase
}
"
${
ereg
}
"
`
[
-n
"
${
H
}
"
]
&&
err
=
1
[
[
-n
"
${
H
}
"
]
]
&&
err
=
1
fi
fi
[
${
err
}
!=
0
]
&&
echo
"+++ error:
${
err
}
"
|
tee
-a
${
outf
}
[
[
${
err
}
!=
0
]
]
&&
echo
"+++ error:
${
err
}
"
|
tee
-a
${
outf
}
rm
-f
${
outf
}
rm
-f
${
outf
}
errMsg
=
`
cat
${
errf
}
`
errMsg
=
`
cat
${
errf
}
`
...
@@ -135,7 +135,7 @@ function juLog() {
...
@@ -135,7 +135,7 @@ function juLog() {
# write the junit xml report
# write the junit xml report
## failure tag
## failure tag
[
${
err
}
=
0
]
&&
failure
=
""
||
failure
=
"
[
[
${
err
}
=
0
]
]
&&
failure
=
""
||
failure
=
"
<failure type=
\"
ScriptError
\"
message=
\"
Script Error
\"
>
<failure type=
\"
ScriptError
\"
message=
\"
Script Error
\"
>
<![CDATA[
<![CDATA[
${
errMsg
}
${
errMsg
}
...
@@ -183,5 +183,5 @@ EOF
...
@@ -183,5 +183,5 @@ EOF
EOF
EOF
fi
fi
return
$
err
return
$
{
err
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment