Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
Zipr Toolchain
Commits
9e600c1c
Commit
9e600c1c
authored
6 years ago
by
Anh Nguyen-Tuong
Browse files
Options
Downloads
Patches
Plain Diff
Verbose output on failure
Former-commit-id: 4614bc785211792bcf01d86e1170d978b66f81a8
parent
c81002fe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/manual_test_lib.sh
+20
-0
20 additions, 0 deletions
tests/manual_test_lib.sh
tests/test_cmds.sh
+32
-19
32 additions, 19 deletions
tests/test_cmds.sh
with
52 additions
and
19 deletions
tests/manual_test_lib.sh
+
20
−
0
View file @
9e600c1c
...
...
@@ -343,6 +343,12 @@ compare_exit_status()
fi
}
show_log
()
{
echo
"=== Show content of
$1
==="
cat
$1
}
#assumes that orig_status, test_status, orig_error, test_error, orig_out, and test_out
#all exists, and does a comparison of each.
compare_std_results
()
...
...
@@ -356,6 +362,12 @@ compare_std_results()
if
[
!
"
$?
"
-eq
0
]
;
then
echo
"Exit Status Failure"
if
[
!
-z
"
$TEST_VERBOSE
"
]
;
then
show_log orig_out
show_log test_out
show_log orig_error
show_log test_error
fi
report_failure
fi
...
...
@@ -365,6 +377,10 @@ compare_std_results()
diff orig_error test_error
if
[
!
$?
-eq
0
]
;
then
echo
"Stderr Failure"
if
[
!
-z
"
$TEST_VERBOSE
"
]
;
then
show_log orig_error
show_log test_error
fi
report_failure
fi
...
...
@@ -375,6 +391,10 @@ compare_std_results()
if
[
!
$?
-eq
0
]
;
then
echo
"run_test Stdout Failure"
report_failure
if
[
!
-z
"
$TEST_VERBOSE
"
]
;
then
show_log orig_out
show_log test_out
fi
fi
}
...
...
This diff is collapsed.
Click to expand it.
tests/test_cmds.sh
+
32
−
19
View file @
9e600c1c
#!/bin/bash
apps
=
""
positional
=
""
show_logs_on_failure
=
0
had_fails
=
0
apps
=
""
default_apps
=
"bzip2 grep du ncal ls objdump readelf sort tar touch tcpdump"
configs
=
""
default_configs
=
"rida"
do_tests
()
{
...
...
@@ -183,7 +184,7 @@ do_tests()
fi
echo
"TEST (
$config
)
${
prog
}
: Running tests..."
timeout
300 ../
$prog
/test_script.sh
$progpath
./
$protected
>
test_
${
prog
}
.log 2>&1
TEST_VERBOSE
=
1
timeout
300 ../
$prog
/test_script.sh
$progpath
./
$protected
>
test_
${
prog
}
.log 2>&1
if
[
$?
-eq
0
]
;
then
echo
"TEST (
$config
)
${
prog
}
: PASS"
progs_pass
=
"
$progs_pass
$prog
.
$config
"
...
...
@@ -214,22 +215,23 @@ do_tests()
usage
()
{
echo
"test_cmds.sh [options]
[configs...]
"
echo
"test_cmds.sh [options]"
echo
echo
"options:"
echo
" -h, --help print help info"
echo
" -l print logs on failure"
echo
" -a, --app <appname> app to test (may be repeated)"
echo
" appname: bzip2 grep du ncal ls objdump readelf sort tar touch tcpdump"
echo
" -c, --config <config>"
echo
echo
"config
s
:"
echo
"config:"
echo
" rida (default configuration)"
echo
" p1 P1 transform"
echo
" mgx move globals"
echo
" mgx_p1 move globals, followed by P1"
echo
" kill_deads xform with bogus random values for dead registers"
echo
echo
" ...too many configs to list, consult script"
echo
" ...too many
other
configs to list, consult script"
}
parse_args
()
...
...
@@ -248,9 +250,12 @@ parse_args()
shift
;;
-a
|
--app
)
shift
apps
=
"
$apps
$1
"
shift
apps
=
"
$apps
$2
"
shift
2
;;
-c
|
--config
)
configs
=
"
$configs
$2
"
shift
2
;;
-
*
|
--
*
=
)
# unsupported flags
echo
"Error: Unsupported flag
$1
"
>
&2
...
...
@@ -264,26 +269,34 @@ parse_args()
done
eval set
--
"
$PARAMS
"
positional
=(
$PARAMS
)
}
main
()
{
parse_args
$*
# backward compatibility where all configs passed as positional parameters
# should really use -c option only
local
configs
=
"
$positional
"
positional
=(
$PARAMS
)
if
[[
$positional
!=
""
]]
;
then
configs
=
"
$configs
$positional
"
fi
if
[[
$configs
==
""
]]
;
then
configs
=
"
rida
"
configs
=
"
$default_configs
"
fi
if
[[
$apps
==
""
]]
;
then
apps
=
"
bzip2 grep du ncal ls objdump readelf sort tar touch tcpdump
"
apps
=
"
$default_apps
"
fi
}
main
()
{
parse_args
"
$@
"
echo
echo
"test configuration"
echo
" apps:
$apps
"
echo
" configs:
$configs
"
echo
" configs:
$configs
"
if
[
$show_logs_on_failure
-eq
1
]
;
then
echo
"test log: show-on-failure"
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment