Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
8cec5235
Commit
8cec5235
authored
Oct 03, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean before testing
parent
b450ce9b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
tests/tests-randomized/check-bundles.sh
tests/tests-randomized/check-bundles.sh
+22
-1
No files found.
tests/tests-randomized/check-bundles.sh
View file @
8cec5235
...
@@ -13,6 +13,10 @@ usage() {
...
@@ -13,6 +13,10 @@ usage() {
echo
"
$0
-h"
echo
"
$0
-h"
echo
"
$0
-t
\"
<ASN.1 definition for type T, in string form>
\"
"
echo
"
$0
-t
\"
<ASN.1 definition for type T, in string form>
\"
"
echo
"
$0
bundles/<bundle-name.txt> [<line>]"
echo
"
$0
bundles/<bundle-name.txt> [<line>]"
echo
"Where options are:"
echo
" -h Show this help screen"
echo
" --dirty Reuse compile results from the previous run(s)"
echo
" -t <ASN.1> Run this particular typel"
echo
"Examples:"
echo
"Examples:"
echo
"
$0
-t UTF8String"
echo
"
$0
-t UTF8String"
echo
"
$0
-t
\"
T ::= INTEGER (0..1)
\"
"
echo
"
$0
-t
\"
T ::= INTEGER (0..1)
\"
"
...
@@ -29,12 +33,25 @@ abs_top_builddir="${abs_top_builddir:-$(pwd)/../../}"
...
@@ -29,12 +33,25 @@ abs_top_builddir="${abs_top_builddir:-$(pwd)/../../}"
tests_succeeded
=
0
tests_succeeded
=
0
tests_failed
=
0
tests_failed
=
0
stop_after_failed
=
1
# We stop after 3 failures.
stop_after_failed
=
1
# We stop after 3 failures.
need_clean_before_bundle
=
1
# Clean before testing a bundle file
need_clean_before_test
=
1
# Before each line in a bundle file
make_clean_before_bundle
()
{
test
"
${
need_clean_before_bundle
}
"
=
"1"
&&
make clean
}
make_clean_before_test
()
{
test
"
${
need_clean_before_test
}
"
=
"1"
&&
make clean
}
# Get all the type-bearding lines in file and process them individually
# Get all the type-bearding lines in file and process them individually
verify_asn_types_in_file
()
{
verify_asn_types_in_file
()
{
local
filename
=
"
$1
"
local
filename
=
"
$1
"
local
need_line
=
"
$2
"
local
need_line
=
"
$2
"
test
"x
$filename
"
!=
"x"
||
usage
test
"x
$filename
"
!=
"x"
||
usage
make_clean_before_bundle
echo
"Open [
$filename
]"
echo
"Open [
$filename
]"
local
line
=
0
local
line
=
0
while
read
asn
;
do
while
read
asn
;
do
...
@@ -60,6 +77,9 @@ verify_asn_type() {
...
@@ -60,6 +77,9 @@ verify_asn_type() {
shift
shift
local
where
=
"
$*
"
local
where
=
"
$*
"
test
"x
$asn
"
!=
"x"
||
usage
test
"x
$asn
"
!=
"x"
||
usage
make_clean_before_test
if
echo
"
$asn
"
|
grep
-qv
"::="
;
then
if
echo
"
$asn
"
|
grep
-qv
"::="
;
then
asn
=
"T ::=
$asn
"
asn
=
"T ::=
$asn
"
fi
fi
...
@@ -174,9 +194,10 @@ asn_compile() {
...
@@ -174,9 +194,10 @@ asn_compile() {
# Command line parsing
# Command line parsing
case
"
$1
"
in
case
"
$1
"
in
-h
)
usage
;;
-h
)
usage
;;
--dirty
)
need_clean_before_bundle
=
0
;
need_clean_before_test
=
0
;;
-t
)
verify_asn_type
"
$2
"
||
exit
1
;;
-t
)
verify_asn_type
"
$2
"
||
exit
1
;;
""
)
""
)
for
bundle
in
bundles/
*
txt
;
do
for
bundle
in
$(
echo
bundles/
*
txt |
sort
-nr
)
;
do
verify_asn_types_in_file
"
$bundle
"
verify_asn_types_in_file
"
$bundle
"
done
done
;;
;;
...
...
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