Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
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
Nurlan
eepm
Commits
31073c9b
Commit
31073c9b
authored
Feb 12, 2014
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests
parent
03fe0ad0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
0 deletions
+85
-0
run_command1.sh
tests/run_command1.sh
+20
-0
run_command2.sh
tests/run_command2.sh
+20
-0
run_command3.sh
tests/run_command3.sh
+31
-0
subst_option.sh
tests/subst_option.sh
+14
-0
No files found.
tests/run_command1.sh
0 → 100644
View file @
31073c9b
#!/bin/sh
run_command
()
{
# use make_temp_file from etersoft-build-utils
RC_STDOUT
=
$(
mktemp
)
RC_STDERR
=
$(
mktemp
)
$1
>
$RC_STDOUT
2>
$RC_STDERR
}
func
()
{
echo
STDERR
>
&2
echo
STDOUT
}
run_command func
cat
$RC_STDOUT
cat
$RC_STDERR
rm
-f
$RC_STDOUT
$RC_STDERR
tests/run_command2.sh
0 → 100644
View file @
31073c9b
#!/bin/sh
run_command
()
{
# use make_temp_file from etersoft-build-utils
RC_STDOUT
=
$(
mktemp
)
#RC_STDERR=$(mktemp)
$1
2>&1 |
tee
$RC_STDOUT
}
func
()
{
echo
STDERR
>
&2
echo
STDOUT
}
run_command func
cat
$RC_STDOUT
#cat $RC_STDERR
rm
-f
$RC_STDOUT
$RC_STDERR
tests/run_command3.sh
0 → 100755
View file @
31073c9b
#!/bin/sh
store_output
()
{
# use make_temp_file from etersoft-build-utils
RC_STDOUT
=
$(
mktemp
)
local
CMDSTATUS
=
$RC_STDOUT
.pipestatus
echo
1
>
$CMDSTATUS
#RC_STDERR=$(mktemp)
(
"
$@
"
2>&1
;
echo
$?
>
$CMDSTATUS
)
|
tee
$RC_STDOUT
return
$(
cat
$CMDSTATUS
)
# bashism
# http://tldp.org/LDP/abs/html/bashver3.html#PIPEFAILREF
#return $PIPESTATUS
}
clean_store_output
()
{
rm
-f
$RC_STDOUT
$RC_STDOUT
.pipestatus
}
store_output epmq mc
echo
$?
cat
$RC_STDOUT
ls
-l
$RC_STDOUT
store_output epmq mc1
echo
$?
cat
$RC_STDOUT
ls
-l
$RC_STDOUT
tests/subst_option.sh
0 → 100644
View file @
31073c9b
# param true false
subst_option
()
{
eval
"[ -n
\"\$
$1
\"
]"
&&
echo
"
$2
"
||
echo
"
$3
"
}
test1
=
1
test0
=
echo
$(
subst_option test1 TRUE
)
echo
$(
subst_option test1 TRUE FALSE
)
echo
$(
subst_option test1
""
FALSE
)
echo
$(
subst_option test0
""
FALSE
)
echo
$(
subst_option test0 TRUE
)
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