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
30566d13
Commit
30566d13
authored
Nov 12, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add asn1c compile smoke test
parent
227b9445
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
101 additions
and
5 deletions
+101
-5
.gitignore
.gitignore
+8
-0
configure.ac
configure.ac
+1
-0
tests/Makefile.am
tests/Makefile.am
+2
-0
tests/README
tests/README
+5
-5
tests/tests-asn1c-smoke/Makefile.am
tests/tests-asn1c-smoke/Makefile.am
+9
-0
tests/tests-asn1c-smoke/README
tests/tests-asn1c-smoke/README
+2
-0
tests/tests-asn1c-smoke/check-asn1c-smoke.sh
tests/tests-asn1c-smoke/check-asn1c-smoke.sh
+74
-0
No files found.
.gitignore
View file @
30566d13
...
@@ -40,6 +40,14 @@ stamp-h*
...
@@ -40,6 +40,14 @@ stamp-h*
# /skeletons
# /skeletons
/skeletons/check-*
/skeletons/check-*
# /tests/
/tests/tests-asn1c-smoke/Makefile.am.libasncodec
/tests/tests-asn1c-smoke/Makefile.am.sample
/tests/tests-asn1c-smoke/*.[acho]
/tests/tests-asn1c-smoke/*.asn
/tests/tests-asn1c-smoke/*.txt
/tests/tests-asn1c-smoke/converter-example
# /tests/
# /tests/
/tests/tests-c-compiler/test-*
/tests/tests-c-compiler/test-*
...
...
configure.ac
View file @
30566d13
...
@@ -288,6 +288,7 @@ AM_CONDITIONAL([HAVE_PANDOC], [test -n "$PANDOC"])
...
@@ -288,6 +288,7 @@ AM_CONDITIONAL([HAVE_PANDOC], [test -n "$PANDOC"])
AC_CONFIG_FILES([\
AC_CONFIG_FILES([\
tests/tests-c-compiler/check-src/Makefile \
tests/tests-c-compiler/check-src/Makefile \
tests/tests-asn1c-compiler/Makefile \
tests/tests-asn1c-compiler/Makefile \
tests/tests-asn1c-smoke/Makefile \
tests/tests-randomized/Makefile \
tests/tests-randomized/Makefile \
tests/tests-c-compiler/Makefile \
tests/tests-c-compiler/Makefile \
tests/tests-skeletons/Makefile \
tests/tests-skeletons/Makefile \
...
...
tests/Makefile.am
View file @
30566d13
# Tests are ordered in the rough order of the time it takes to go through them.
SUBDIRS
=
\
SUBDIRS
=
\
tests-asn1c-compiler
\
tests-asn1c-compiler
\
tests-skeletons
\
tests-skeletons
\
tests-asn1c-smoke
\
tests-c-compiler
\
tests-c-compiler
\
tests-randomized
tests-randomized
...
...
tests/README
View file @
30566d13
tests-asn1c-compiler - asn1c produces expected textual output
tests-asn1c-
compiler - tests behavior of asn1c compiler, textually
tests-asn1c-
smoke - asn1c compiler produces compilable code for simple types
tests-c-compiler
- attempts to compile C results of asn1c outpu
t
tests-c-compiler
- C code compiles and runs, and produces expected resul
t
tests-skeletons
- verify correctness of "skeletons" code
tests-skeletons
- "skeletons" code primitives are correct
tests-randomized
- thorough testing of DER/OER/PER/XER with fuzzing
tests-randomized
- fuzz-testing of DER/OER/PER/XER codecs
tests/tests-asn1c-smoke/Makefile.am
0 → 100644
View file @
30566d13
dist_check_SCRIPTS
=
check-asn1c-smoke.sh
TESTS_ENVIRONMENT
=
MAKE
=
${MAKE}
\
top_builddir
=
${top_builddir}
\
top_srcdir
=
${top_srcdir}
TESTS
=
$(dist_check_SCRIPTS)
CLEANFILES
=
Makefile.am.
*
test
*
*
.[acho]
EXTRA_DIST
=
README
tests/tests-asn1c-smoke/README
0 → 100644
View file @
30566d13
Test that asn1c compiler produces compilable code for basic ASN.1 types,
while trying to disable different codecs and vary other compiler flags.
tests/tests-asn1c-smoke/check-asn1c-smoke.sh
0 → 100755
View file @
30566d13
#!/usr/bin/env bash
set
-x
set
-e
set
-o
pipefail
top_builddir
=
${
top_builddir
:-
../..
}
top_srcdir
=
${
top_srcdir
:-
../..
}
cleanup
()
{
rm
-rf
*
.[cho] Makefile.am.
*
*
.txt
*
.asn
rm
-f
converter-example
}
print_state
()
{
local
err
=
$?
set
+x
set
+e
trap
""
EXIT ERR
echo
"Error
$err
while processing:"
cat
test.asn
cat
status.txt
echo
"FAILED"
exit
$err
}
verify
()
{
local type
=
"
$1
"
local
flags
=
"
$2
"
cleanup
asncmd
=
"
${
top_builddir
}
/asn1c/asn1c -flink-skeletons -S
${
top_srcdir
}
/skeletons
$flags
test.asn"
{
echo
"
$asncmd
"
echo
"
${
MAKE
:-
make
}
-f Makefile.am.example"
}
>
status.txt
echo
"Module DEFINITIONS::=BEGIN T::=
$type
END"
>
test.asn
$asncmd
CFLAGS
=
-O0
${
MAKE
:-
make
}
-f
Makefile.am.example |
tail
-10
}
verify_type_with_variants
()
{
local type
=
"
$1
"
for
flags
in
"-no-gen-PER"
"-no-gen-OER"
"-no-gen-PER -no-gen-OER"
""
;
do
for
native
in
""
"-fwide-types"
;
do
verify
"
$type
"
"
$flags
$native
"
done
done
}
verify_compile_and_link_variants
()
{
for
type
in
INTEGER
"ENUMERATED{foo}"
NULL BOOLEAN
"BIT STRING"
\
"OBJECT IDENTIFIER"
"RELATIVE-OID"
"SEQUENCE{f INTEGER}"
\
"CHOICE{f INTEGER}"
"OCTET STRING"
IA5String UTF8String
\
REAL
"SET OF INTEGER"
"SEQUENCE OF INTEGER"
;
do
verify_type_with_variants
"
$type
"
done
}
trap
print_state EXIT ERR
if
[
"x
$*
"
=
"x"
]
;
then
verify_compile_and_link_variants
else
for
type
in
"
$@
"
;
do
verify_type_with_variants
"
$type
"
done
fi
trap
''
EXIT ERR
cleanup
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