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
40b8a7ae
Commit
40b8a7ae
authored
7 years ago
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simpler makefile generation
parent
45bae08c
vlm_master
velichkov_s1ap_plus_option_group
No related merge requests found
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
281 additions
and
429 deletions
+281
-429
examples/sample.makefile.regen
examples/sample.makefile.regen
+61
-68
examples/sample.source.1609.2/Makefile
examples/sample.source.1609.2/Makefile
+32
-60
examples/sample.source.J2735/Makefile
examples/sample.source.J2735/Makefile
+32
-60
examples/sample.source.LDAP3/Makefile
examples/sample.source.LDAP3/Makefile
+37
-64
examples/sample.source.LTE-RRC/Makefile
examples/sample.source.LTE-RRC/Makefile
+4
-4
examples/sample.source.MEGACO/Makefile
examples/sample.source.MEGACO/Makefile
+4
-4
examples/sample.source.MHEG5/Makefile
examples/sample.source.MHEG5/Makefile
+4
-4
examples/sample.source.PKIX1/Makefile
examples/sample.source.PKIX1/Makefile
+32
-59
examples/sample.source.RRC/Makefile
examples/sample.source.RRC/Makefile
+4
-4
examples/sample.source.TAP3/Makefile
examples/sample.source.TAP3/Makefile
+4
-4
examples/sample.source.ULP/Makefile
examples/sample.source.ULP/Makefile
+4
-4
libasn1compiler/asn1c_save.c
libasn1compiler/asn1c_save.c
+7
-7
tests/tests-c-compiler/Makefile.am
tests/tests-c-compiler/Makefile.am
+1
-3
tests/tests-c-compiler/check-assembly.sh
tests/tests-c-compiler/check-assembly.sh
+21
-73
tests/tests-randomized/Makefile.am
tests/tests-randomized/Makefile.am
+10
-4
tests/tests-randomized/check-bundles.sh
tests/tests-randomized/check-bundles.sh
+24
-7
No files found.
examples/sample.makefile.regen
View file @
40b8a7ae
#!/bin/sh
#
# This script attempts to compile the given ASN.1 specification and then
# transforms the resulting Makefile.am.example tailored to that specification
# into a customized Makefile.
# This script attempts to compile the given ASN.1 specification by first
# building the specialized Makefile.
#
# The information which is necessary for this script is passed from the
# Makefile which is going to be replaced with an updated Makefile.
#
if
test
-z
"
$ASN
1
PDU
"
\
-o
-z
"
$ASN
1
MODULES
"
\
-o
-z
"
$
PROGNAME
"
\
if
test
-z
"
$ASN
_
PDU
"
\
-o
-z
"
$ASN
_
MODULES
"
\
-o
-z
"
$
ASN_PROGRAM
"
\
;
then
echo
"ASN1CMDOPTS=
\"
$ASN1CMDOPTS
\"
"
echo
"ASN1MODULES=
\"
$ASN1MODULES
\"
"
echo
"ASN1PDU=
\"
$ASN1PDU
\"
"
echo
"PROGNAME=
\"
$PROGNAME
\"
"
echo
"ASN1PDU, ASN1MODULES, and PROGNAME are mandatory"
exit
cat
<<-
NOTE
ASN_CMDOPTS="
$ASN_CMDOPTS
"
ASN_MODULES="
$ASN_MODULES
"
ASN_PDU="
$ASN_PDU
"
ASN_PROGRAM="
$ASN_PROGRAM
"
ASN_PDU, ASN_MODULES, and ASN_PROGRAM are mandatory.
NOTE
exit
1
fi
CMDOPTS
=
"-pdu=
${
ASN1PDU
}
${
ASN1CMDOPTS
}
${
ASN1
MODULES
}
"
EFFECTIVE_CMDOPTS
=
"-pdu=
${
ASN_PDU
}
${
ASN_CMDOPTS
}
${
ASN_
MODULES
}
"
if
test
-x
../../asn1c/asn1c
;
then
echo
"Compiling
${
ASN
1
MODULES
}
using local compiler"
../../asn1c/asn1c
-S
../../skeletons
${
CMDOPTS
}
||
exit
$?
echo
"Compiling
${
ASN
_
MODULES
}
using local compiler"
../../asn1c/asn1c
-S
../../skeletons
${
EFFECTIVE_
CMDOPTS
}
||
exit
$?
else
echo
"Compiling
${
ASN
1
MODULES
}
using system compiler"
asn1c
${
CMDOPTS
}
||
exit
$?
echo
"Compiling
${
ASN
_
MODULES
}
using system compiler"
asn1c
${
EFFECTIVE_
CMDOPTS
}
||
exit
$?
fi
if
test
!
-f
Makefile.am.example
;
then
...
...
@@ -39,107 +40,104 @@ EXTRA_CFLAGS="-DJUNKTEST -D_DEFAULT_SOURCE"
test
-f
config.h
&&
EXTRA_CFLAGS
=
"-DHAVE_CONFIG_H
${
EXTRA_CFLAGS
}
"
test
-n
"
$TITLE
"
&&
EXTRA_CFLAGS
=
"-DASN_CONVERTER_TITLE=
\"
$TITLE
\"
${
EXTRA_CFLAGS
}
"
set
-x
cat
Makefile.am.example
\
|
sed
-e
"s/^include /-include /"
\
|
sed
-e
"s/^TARGET = converter-example/TARGET =
${
PROGNAME
}
/"
\
|
sed
-e
"s/^CFLAGS += /CFLAGS +=
${
EXTRA_CFLAGS
}
/"
\
|
sed
-e
"s/^all: /all: maybe-wip-pause
${
ASN1PDU
}
.c /"
\
>
Makefile.
$$
set
+x
(
echo
echo
"
${
ASN1PDU
}
.c:
$0
${
ASN1MODULES
}
"
{
echo
"ASN_PROGRAM =
${
ASN_PROGRAM
}
"
echo
"CFLAGS +=
${
EXTRA_CFLAGS
}
"
echo
"begin:
${
ASN_PDU
}
.c maybe-wip-pause all"
echo
echo
"-include Makefile.am.example"
echo
echo
"
${
ASN_PDU
}
.c:
$0
${
ASN_MODULES
}
"
echo
" make regen-makefile"
echo
" @touch
${
ASN
1
PDU
}
.c"
echo
" @touch
${
ASN
_
PDU
}
.c"
echo
" make"
echo
echo
"regen-makefile:"
test
-n
"
$TITLE
"
&&
echo
" TITLE=
\"
$TITLE
\"
\\
"
echo
" ASN
1CMDOPTS=
\"
${
ASN1
CMDOPTS
}
\"
\\
"
echo
" ASN
1MODULES=
\"
${
ASN1
MODULES
}
\"
\\
"
echo
" ASN
1PDU=
${
ASN1
PDU
}
\\
"
echo
"
PROGNAME=
${
PROGNAME
}
\\
"
echo
" ASN
_CMDOPTS=
\"
${
ASN_
CMDOPTS
}
\"
\\
"
echo
" ASN
_MODULES=
\"
${
ASN_
MODULES
}
\"
\\
"
echo
" ASN
_PDU=
${
ASN_
PDU
}
\\
"
echo
"
ASN_PROGRAM=
${
ASN_PROGRAM
}
\\
"
echo
"
$0
"
echo
echo
'check: ${
TARGET
} check-ber check-xer check-oer check-per'
echo
'check: ${
ASN_PROGRAM
} check-ber check-xer check-oer check-per'
echo
' @echo ================'
echo
' @echo All tests passed'
echo
' @echo ================'
echo
echo
'check-ber:'
echo
" @if test -f sample-
${
ASN
1
PDU
}
-1.[db]er ; then
\\
"
echo
" @if test -f sample-
${
ASN
_
PDU
}
-1.[db]er ; then
\\
"
echo
" for f in sample-*-*.[db]er; do
\\
"
echo
' pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\\1/"`; \'
echo
' for b in 1 17 33 980 8192; do \'
echo
' echo "Recoding $$f ($$pdu) into XER and back ($$b)..."; \'
echo
' ./${
TARGET
} -p $$pdu -b $$b -iber -oxer $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${
TARGET
} -p $$pdu -b $$b -ixer -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \'
echo
' ./${
ASN_PROGRAM
} -p $$pdu -b $$b -iber -oxer $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${
ASN_PROGRAM
} -p $$pdu -b $$b -ixer -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \'
echo
' diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 4; \'
echo
' rm -f ./.tmp.[12].$$$$; \'
echo
' echo "Test junking $$f (please wait)..."; \'
echo
' ./${
TARGET
} -J0.0001 -n 1000 -p $$pdu -b $$b -iber -onull $$f || exit 5; \'
echo
' ./${
TARGET
} -J0.001 -n 1000 -p $$pdu -b $$b -iber -onull $$f || exit 6; \'
echo
' ./${
ASN_PROGRAM
} -J0.0001 -n 1000 -p $$pdu -b $$b -iber -onull $$f || exit 5; \'
echo
' ./${
ASN_PROGRAM
} -J0.001 -n 1000 -p $$pdu -b $$b -iber -onull $$f || exit 6; \'
echo
' done; done; fi'
echo
echo
'check-xer:'
echo
" @if test -f sample-
${
ASN
1
PDU
}
-1.xer ; then
\\
"
echo
" @if test -f sample-
${
ASN
_
PDU
}
-1.xer ; then
\\
"
echo
" for f in sample-*-*.xer; do
\\
"
echo
' pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\\1/"`; \'
echo
' for b in 1 17 33 980 8192; do \'
echo
' echo "Recoding $$f ($$pdu) into DER and back ($$b)..."; \'
echo
' ./${
TARGET
} -p $$pdu -b $$b -ixer -oder $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${
TARGET
} -p $$pdu -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \'
echo
' ./${
ASN_PROGRAM
} -p $$pdu -b $$b -ixer -oder $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${
ASN_PROGRAM
} -p $$pdu -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \'
echo
' diff $$f ./.tmp.2.$$$$ || exit 4; \'
echo
' rm -f ./.tmp.[12].$$$$; \'
echo
' echo "Test junking $$f (please wait)..."; \'
echo
' ./${
TARGET
} -J0.0001 -n 1000 -p $$pdu -b $$b -ixer -onull $$f || exit 5; \'
echo
' ./${
TARGET
} -J0.001 -n 1000 -p $$pdu -b $$b -ixer -onull $$f || exit 6; \'
echo
' ./${
ASN_PROGRAM
} -J0.0001 -n 1000 -p $$pdu -b $$b -ixer -onull $$f || exit 5; \'
echo
' ./${
ASN_PROGRAM
} -J0.001 -n 1000 -p $$pdu -b $$b -ixer -onull $$f || exit 6; \'
echo
' done; done; fi'
echo
echo
'check-oer:'
echo
" @if test -f sample-
${
ASN
1
PDU
}
-1.*oer ; then
\\
"
echo
" @if test -f sample-
${
ASN
_
PDU
}
-1.*oer ; then
\\
"
echo
" for f in sample-*-*.*oer; do
\\
"
echo
' pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\\1/"`; \'
echo
' for b in 1 17 33 980 8192; do \'
echo
' echo "Recoding $$f ($$pdu) into XER and back ($$b)..."; \'
echo
' ./${
TARGET
} -p $$pdu -b $$b -ioer -oxer $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${
TARGET
} -p $$pdu -b $$b -ixer -ooer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \'
echo
' ./${
ASN_PROGRAM
} -p $$pdu -b $$b -ioer -oxer $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${
ASN_PROGRAM
} -p $$pdu -b $$b -ixer -ooer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \'
echo
' diff $$f ./.tmp.2.$$$$ || exit 4; \'
echo
' rm -f ./.tmp.[12].$$$$; \'
echo
' echo "Test junking $$f (please wait) ($$b) ..."; \'
echo
' ./${
TARGET
} -J0.0001 -n 1000 -p $$pdu -b $$b -ioer -onull $$f || exit 5; \'
echo
' ./${
TARGET
} -J0.001 -n 1000 -p $$pdu -b $$b -ioer -onull $$f || exit 6; \'
echo
' ./${
ASN_PROGRAM
} -J0.0001 -n 1000 -p $$pdu -b $$b -ioer -onull $$f || exit 5; \'
echo
' ./${
ASN_PROGRAM
} -J0.001 -n 1000 -p $$pdu -b $$b -ioer -onull $$f || exit 6; \'
echo
' done; done; fi'
echo
echo
'check-per:'
echo
" @if test -f sample-
${
ASN
1
PDU
}
-1-nopad.per ; then
\\
"
echo
" @if test -f sample-
${
ASN
_
PDU
}
-1-nopad.per ; then
\\
"
echo
" for f in sample-*-[1-9]-nopad.per; do
\\
"
echo
' pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\\1/"`; \'
echo
' for b in 1 17 33 980 8192; do \'
echo
' echo "Recoding non-padded $$f ($$pdu) into DER into XER and back ($$b)..."; \'
echo
' ./${
TARGET
} -p $$pdu -b $$b -per-nopad -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${
TARGET
} -p $$pdu -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \'
echo
' ./${
TARGET
} -p $$pdu -b $$b -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 4; \'
echo
' ./${
ASN_PROGRAM
} -p $$pdu -b $$b -per-nopad -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \'
echo
' ./${
ASN_PROGRAM
} -p $$pdu -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \'
echo
' ./${
ASN_PROGRAM
} -p $$pdu -b $$b -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 4; \'
echo
' diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 5; \'
echo
' rm -f ./.tmp.[123].$$$$; \'
echo
' echo "Test junking $$f (please wait)..."; \'
echo
' ./${
TARGET
} -J0.0001 -n 1000 -p $$pdu -b $$b -per-nopad -iper -onull $$f || exit 6; \'
echo
' ./${
TARGET
} -J0.001 -n 1000 -p $$pdu -b $$b -per-nopad -iper -onull $$f || exit 7; \'
echo
' ./${
ASN_PROGRAM
} -J0.0001 -n 1000 -p $$pdu -b $$b -per-nopad -iper -onull $$f || exit 6; \'
echo
' ./${
ASN_PROGRAM
} -J0.001 -n 1000 -p $$pdu -b $$b -per-nopad -iper -onull $$f || exit 7; \'
echo
' done; done; fi'
echo
" @if test -f sample-
${
ASN
1
PDU
}
-1.per ; then
\\
"
echo
" @if test -f sample-
${
ASN
_
PDU
}
-1.per ; then
\\
"
echo
" for f in sample-*-[1-9].per; do
\\
"
echo
' pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\\1/"`; \'
echo
' for b in 1 17 33 980 8192; do \'
echo
' echo "Recoding $$f ($$pdu) into DER into XER and back ($$b)..."; \'
echo
' ./${
TARGET
} -p $$pdu -b $$b -iper -oder $$f > ./.tmp.1.$$$$ || exit 3; \'
echo
' ./${
TARGET
} -p $$pdu -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 4; \'
echo
' ./${
TARGET
} -p $$pdu -b $$b -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 5; \'
echo
' ./${
ASN_PROGRAM
} -p $$pdu -b $$b -iper -oder $$f > ./.tmp.1.$$$$ || exit 3; \'
echo
' ./${
ASN_PROGRAM
} -p $$pdu -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 4; \'
echo
' ./${
ASN_PROGRAM
} -p $$pdu -b $$b -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 5; \'
echo
' diff $$f ./.tmp.1.$$$$ || exit 6; \'
echo
' rm -f ./.tmp.[12].$$$$; \'
echo
' echo "Test junking $$f (please wait)..."; \'
echo
' ./${
TARGET
} -J0.0001 -n 1000 -p $$pdu -b $$b -iper -onull $$f || exit 7; \'
echo
' ./${
TARGET
} -J0.001 -n 1000 -p $$pdu -b $$b -iper -onull $$f || exit 8; \'
echo
' ./${
ASN_PROGRAM
} -J0.0001 -n 1000 -p $$pdu -b $$b -iper -onull $$f || exit 7; \'
echo
' ./${
ASN_PROGRAM
} -J0.001 -n 1000 -p $$pdu -b $$b -iper -onull $$f || exit 8; \'
echo
' done; done; fi'
echo
echo
"maybe-wip-pause:"
...
...
@@ -148,14 +146,9 @@ set +x
echo
"distclean: clean"
echo
' rm -f $(ASN_MODULE_SOURCES)'
echo
' rm -f $(ASN_MODULE_HEADERS)'
echo
' rm -f $(ASN_
CONVERTER_SOURCES) $(ASN_CONVERTER
_HEADERS)'
echo
' rm -f $(ASN_
PROGRAM_SOURCES) $(ASN_PROGRAM
_HEADERS)'
echo
" rm -f Makefile.am.example"
)
>>
Makefile.
$$
set
-x
mv
Makefile.
$$
Makefile
||
exit
$?
rm
Makefile.am.example
||
exit
$?
set
+x
}
>
Makefile
echo
echo
"Makefile generation finished"
This diff is collapsed.
Click to expand it.
examples/sample.source.1609.2/Makefile
View file @
40b8a7ae
-include
Makefile.am.libasncodec
TARGET
=
1609-2-dump
ASN_LIBRARY
=
libasncodec.a
LIBS
+=
-lm
CFLAGS
+=
-DASN_CONVERTER_TITLE
=
"IEEE 1609.2-2016 decoder"
-DHAVE_CONFIG_H
-DJUNKTEST
-D_DEFAULT_SOURCE
$(ASN_MODULE_CFLAGS)
-DPDU
=
Certificate
-DASN_PDU_COLLECTION
-I
.
ASN_CONVERTER_SOURCES
=
\
converter-example.c
\
pdu_collection.c
all
:
maybe-wip-pause Certificate.c $(TARGET)
$(TARGET)
:
$(ASN_LIBRARY) $(ASN_CONVERTER_SOURCES:.c=.o)
$(CC)
$(CFLAGS)
$(CPPFLAGS)
-o
$(TARGET)
$(ASN_CONVERTER_SOURCES:.c=.o)
$(LDFLAGS)
$(ASN_LIBRARY)
$(LIBS)
$(ASN_LIBRARY)
:
$(ASN_MODULE_SOURCES:.c=.o)
$(AR)
rcs
$@
$^
.SUFFIXES
:
.SUFFIXES
:
.c .o
.c.o
:
$(CC)
$(CFLAGS)
-o
$@
-c
$<
clean
:
rm
-f
$(TARGET)
$(ASN_LIBRARY)
rm
-f
$(ASN_MODULE_SOURCES:.c=.o)
$(ASN_CONVERTER_SOURCES:.c=.o)
regen
:
regenerate-from-asn1-source
regenerate-from-asn1-source
:
../../asn1c/asn1c
-S
../../skeletons
-pdu
=
Certificate
-pdu
=
auto
-pdu
=
Ieee1609Dot2Data
-fcompound-names
-gen-OER
../IEEE-1609.2-2016.asn1
ASN_PROGRAM
=
1609-2-dump
CFLAGS
+=
-DASN_CONVERTER_TITLE
=
"IEEE 1609.2-2016 decoder"
-DHAVE_CONFIG_H
-DJUNKTEST
-D_DEFAULT_SOURCE
begin
:
Certificate.c maybe-wip-pause all
-include
Makefile.am.example
Certificate.c
:
../sample.makefile.regen ../IEEE-1609.2-2016.asn1
make regen-makefile
...
...
@@ -39,13 +11,13 @@ Certificate.c: ../sample.makefile.regen ../IEEE-1609.2-2016.asn1
regen-makefile
:
TITLE
=
"IEEE 1609.2-2016 decoder"
\
ASN
1
CMDOPTS
=
"-pdu=auto -pdu=Ieee1609Dot2Data -fcompound-names -gen-OER"
\
ASN
1
MODULES
=
"../IEEE-1609.2-2016.asn1"
\
ASN
1
PDU
=
Certificate
\
PROGNAME
=
1609-2-dump
\
ASN
_
CMDOPTS
=
"-pdu=auto -pdu=Ieee1609Dot2Data -fcompound-names -gen-OER"
\
ASN
_
MODULES
=
"../IEEE-1609.2-2016.asn1"
\
ASN
_
PDU
=
Certificate
\
ASN_PROGRAM
=
1609-2-dump
\
../sample.makefile.regen
check
:
${
TARGET
} check-ber check-xer check-oer check-per
check
:
${
ASN_PROGRAM
} check-ber check-xer check-oer check-per
@
echo
================
@
echo
All tests passed
@
echo
================
...
...
@@ -56,13 +28,13 @@ check-ber:
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding
$$
f (
$$
pdu) into XER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
diff ./.tmp.1.
$$$$
./.tmp.2.
$$$$
||
exit
4
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
echo
"Test junking
$$
f (please wait)..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-iber
-onull
$$
f
||
exit
5
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-iber
-onull
$$
f
||
exit
6
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-iber
-onull
$$
f
||
exit
5
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-iber
-onull
$$
f
||
exit
6
;
\
done
;
done
;
fi
check-xer
:
...
...
@@ -71,13 +43,13 @@ check-xer:
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding
$$
f (
$$
pdu) into DER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
diff
$$
f ./.tmp.2.
$$$$
||
exit
4
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
echo
"Test junking
$$
f (please wait)..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-ixer
-onull
$$
f
||
exit
5
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-ixer
-onull
$$
f
||
exit
6
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-ixer
-onull
$$
f
||
exit
5
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-ixer
-onull
$$
f
||
exit
6
;
\
done
;
done
;
fi
check-oer
:
...
...
@@ -86,13 +58,13 @@ check-oer:
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding
$$
f (
$$
pdu) into XER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ioer
-oxer
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-ooer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ioer
-oxer
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-ooer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
diff
$$
f ./.tmp.2.
$$$$
||
exit
4
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
echo
"Test junking
$$
f (please wait) (
$$
b) ..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-ioer
-onull
$$
f
||
exit
5
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-ioer
-onull
$$
f
||
exit
6
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-ioer
-onull
$$
f
||
exit
5
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-ioer
-onull
$$
f
||
exit
6
;
\
done
;
done
;
fi
check-per
:
...
...
@@ -101,28 +73,28 @@ check-per:
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding non-padded
$$
f (
$$
pdu) into DER into XER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-oder
./.tmp.2.
$$$$
>
./.tmp.3.
$$$$
||
exit
4
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-oder
./.tmp.2.
$$$$
>
./.tmp.3.
$$$$
||
exit
4
;
\
diff ./.tmp.1.
$$$$
./.tmp.3.
$$$$
||
exit
5
;
\
rm
-f
./.tmp.[123].
$$$$
;
\
echo
"Test junking
$$
f (please wait)..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-onull
$$
f
||
exit
6
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-onull
$$
f
||
exit
7
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-onull
$$
f
||
exit
6
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-onull
$$
f
||
exit
7
;
\
done
;
done
;
fi
@
if
test
-f
sample-Certificate-1.per
;
then
\
for
f
in
sample-
*
-[1-9].per
;
do
\
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding
$$
f (
$$
pdu) into DER into XER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
3
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
4
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-oper
./.tmp.2.
$$$$
>
./.tmp.1.
$$$$
||
exit
5
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
4
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-oper
./.tmp.2.
$$$$
>
./.tmp.1.
$$$$
||
exit
5
;
\
diff
$$
f ./.tmp.1.
$$$$
||
exit
6
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
echo
"Test junking
$$
f (please wait)..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-iper
-onull
$$
f
||
exit
7
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-iper
-onull
$$
f
||
exit
8
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-iper
-onull
$$
f
||
exit
7
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-iper
-onull
$$
f
||
exit
8
;
\
done
;
done
;
fi
maybe-wip-pause
:
...
...
@@ -131,5 +103,5 @@ maybe-wip-pause:
distclean
:
clean
rm
-f
$(ASN_MODULE_SOURCES)
rm
-f
$(ASN_MODULE_HEADERS)
rm
-f
$(ASN_
CONVERTER_SOURCES)
$(ASN_CONVERTER
_HEADERS)
rm
-f
$(ASN_
PROGRAM_SOURCES)
$(ASN_PROGRAM
_HEADERS)
rm
-f
Makefile.am.example
This diff is collapsed.
Click to expand it.
examples/sample.source.J2735/Makefile
View file @
40b8a7ae
-include
Makefile.am.libasncodec
TARGET
=
j2735-dump
ASN_LIBRARY
=
libasncodec.a
LIBS
+=
-lm
CFLAGS
+=
-DASN_CONVERTER_TITLE
=
"J2735 DSRC decoder"
-DHAVE_CONFIG_H
-DJUNKTEST
-D_DEFAULT_SOURCE
$(ASN_MODULE_CFLAGS)
-DPDU
=
MessageFrame
-DASN_PDU_COLLECTION
-I
.
ASN_CONVERTER_SOURCES
:=
\
converter-example.c
\
pdu_collection.c
all
:
maybe-wip-pause MessageFrame.c $(TARGET)
$(TARGET)
:
$(ASN_LIBRARY) $(ASN_CONVERTER_SOURCES:.c=.o)
$(CC)
$(CFLAGS)
$(CPPFLAGS)
-o
$(TARGET)
$(ASN_CONVERTER_SOURCES:.c=.o)
$(LDFLAGS)
$(ASN_LIBRARY)
$(LIBS)
$(ASN_LIBRARY)
:
$(ASN_MODULE_SOURCES:.c=.o)
$(AR)
rcs
$@
$^
.SUFFIXES
:
.SUFFIXES
:
.c .o
.c.o
:
$(CC)
$(CFLAGS)
-o
$@
-c
$<
clean
:
rm
-f
$(TARGET)
$(ASN_LIBRARY)
rm
-f
$(ASN_MODULE_SOURCES:.c=.o)
$(ASN_CONVERTER_SOURCES:.c=.o)
regen
:
regenerate-from-asn1-source
regenerate-from-asn1-source
:
../../asn1c/asn1c
-S
../../skeletons
-pdu
=
MessageFrame
-fcompound-names
-gen-PER
-pdu
=
all ../J2735_201603.asn1
ASN_PROGRAM
=
j2735-dump
CFLAGS
+=
-DASN_CONVERTER_TITLE
=
"J2735 DSRC decoder"
-DHAVE_CONFIG_H
-DJUNKTEST
-D_DEFAULT_SOURCE
begin
:
MessageFrame.c maybe-wip-pause all
-include
Makefile.am.example
MessageFrame.c
:
../sample.makefile.regen ../J2735_201603.asn1
make regen-makefile
...
...
@@ -39,13 +11,13 @@ MessageFrame.c: ../sample.makefile.regen ../J2735_201603.asn1
regen-makefile
:
TITLE
=
"J2735 DSRC decoder"
\
ASN
1
CMDOPTS
=
"-fcompound-names -gen-PER -pdu=all"
\
ASN
1
MODULES
=
"../J2735_201603.asn1"
\
ASN
1
PDU
=
MessageFrame
\
PROGNAME
=
j2735-dump
\
ASN
_
CMDOPTS
=
"-fcompound-names -gen-PER -pdu=all"
\
ASN
_
MODULES
=
"../J2735_201603.asn1"
\
ASN
_
PDU
=
MessageFrame
\
ASN_PROGRAM
=
j2735-dump
\
../sample.makefile.regen
check
:
${
TARGET
} check-ber check-xer check-oer check-per
check
:
${
ASN_PROGRAM
} check-ber check-xer check-oer check-per
@
echo
================
@
echo
All tests passed
@
echo
================
...
...
@@ -56,13 +28,13 @@ check-ber:
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding
$$
f (
$$
pdu) into XER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
diff ./.tmp.1.
$$$$
./.tmp.2.
$$$$
||
exit
4
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
echo
"Test junking
$$
f (please wait)..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-iber
-onull
$$
f
||
exit
5
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-iber
-onull
$$
f
||
exit
6
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-iber
-onull
$$
f
||
exit
5
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-iber
-onull
$$
f
||
exit
6
;
\
done
;
done
;
fi
check-xer
:
...
...
@@ -71,13 +43,13 @@ check-xer:
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding
$$
f (
$$
pdu) into DER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
diff
$$
f ./.tmp.2.
$$$$
||
exit
4
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
echo
"Test junking
$$
f (please wait)..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-ixer
-onull
$$
f
||
exit
5
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-ixer
-onull
$$
f
||
exit
6
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-ixer
-onull
$$
f
||
exit
5
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-ixer
-onull
$$
f
||
exit
6
;
\
done
;
done
;
fi
check-oer
:
...
...
@@ -86,13 +58,13 @@ check-oer:
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding
$$
f (
$$
pdu) into XER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ioer
-oxer
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-ooer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ioer
-oxer
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-ooer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
diff
$$
f ./.tmp.2.
$$$$
||
exit
4
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
echo
"Test junking
$$
f (please wait) (
$$
b) ..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-ioer
-onull
$$
f
||
exit
5
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-ioer
-onull
$$
f
||
exit
6
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-ioer
-onull
$$
f
||
exit
5
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-ioer
-onull
$$
f
||
exit
6
;
\
done
;
done
;
fi
check-per
:
...
...
@@ -101,28 +73,28 @@ check-per:
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding non-padded
$$
f (
$$
pdu) into DER into XER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-oder
./.tmp.2.
$$$$
>
./.tmp.3.
$$$$
||
exit
4
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-oder
./.tmp.2.
$$$$
>
./.tmp.3.
$$$$
||
exit
4
;
\
diff ./.tmp.1.
$$$$
./.tmp.3.
$$$$
||
exit
5
;
\
rm
-f
./.tmp.[123].
$$$$
;
\
echo
"Test junking
$$
f (please wait)..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-onull
$$
f
||
exit
6
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-onull
$$
f
||
exit
7
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-onull
$$
f
||
exit
6
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-onull
$$
f
||
exit
7
;
\
done
;
done
;
fi
@
if
test
-f
sample-MessageFrame-1.per
;
then
\
for
f
in
sample-
*
-[1-9].per
;
do
\
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding
$$
f (
$$
pdu) into DER into XER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
3
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
4
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-oper
./.tmp.2.
$$$$
>
./.tmp.1.
$$$$
||
exit
5
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
4
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-oper
./.tmp.2.
$$$$
>
./.tmp.1.
$$$$
||
exit
5
;
\
diff
$$
f ./.tmp.1.
$$$$
||
exit
6
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
echo
"Test junking
$$
f (please wait)..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-iper
-onull
$$
f
||
exit
7
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-iper
-onull
$$
f
||
exit
8
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-iper
-onull
$$
f
||
exit
7
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-iper
-onull
$$
f
||
exit
8
;
\
done
;
done
;
fi
maybe-wip-pause
:
...
...
@@ -131,5 +103,5 @@ maybe-wip-pause:
distclean
:
clean
rm
-f
$(ASN_MODULE_SOURCES)
rm
-f
$(ASN_MODULE_HEADERS)
rm
-f
$(ASN_
CONVERTER_SOURCES)
$(ASN_CONVERTER
_HEADERS)
rm
-f
$(ASN_
PROGRAM_SOURCES)
$(ASN_PROGRAM
_HEADERS)
rm
-f
Makefile.am.example
This diff is collapsed.
Click to expand it.
examples/sample.source.LDAP3/Makefile
View file @
40b8a7ae
-include
Makefile.am.libasncodec
TARGET
=
ldap3dump
ASN_LIBRARY
=
libasncodec.a
LIBS
+=
-lm
CFLAGS
+=
-DASN_CONVERTER_TITLE
=
"Lightweight Directory Access Protocol V3 decoder"
-DHAVE_CONFIG_H
-DJUNKTEST
-D_DEFAULT_SOURCE
$(ASN_MODULE_CFLAGS)
-DPDU
=
LDAPMessage
-I
.
ASN_CONVERTER_SOURCES
=
\
converter-example.c
all
:
maybe-wip-pause LDAPMessage.c $(TARGET)
$(TARGET)
:
$(ASN_LIBRARY) $(ASN_CONVERTER_SOURCES:.c=.o)
$(CC)
$(CFLAGS)
$(CPPFLAGS)
-o
$(TARGET)
$(ASN_CONVERTER_SOURCES:.c=.o)
$(LDFLAGS)
$(ASN_LIBRARY)
$(LIBS)
$(ASN_LIBRARY)
:
$(ASN_MODULE_SOURCES:.c=.o)
$(AR)
rcs
$@
$(ASN_MODULE_SOURCES:.c=.o)
.SUFFIXES
:
.SUFFIXES
:
.c .o
.c.o
:
$(CC)
$(CFLAGS)
-o
$@
-c
$<
clean
:
rm
-f
$(TARGET)
$(ASN_LIBRARY)
rm
-f
$(ASN_MODULE_SOURCES:.c=.o)
$(ASN_CONVERTER_SOURCES:.c=.o)
regen
:
regenerate-from-asn1-source
regenerate-from-asn1-source
:
../../asn1c/asn1c
-S
../../skeletons
-pdu
=
LDAPMessage
-fcompound-names
../rfc4511-Lightweight-Directory-Access-Protocol-V3.asn1
ASN_PROGRAM
=
ldap3dump
CFLAGS
+=
-DASN_CONVERTER_TITLE
=
"Lightweight Directory Access Protocol V3 decoder"
-DHAVE_CONFIG_H
-DJUNKTEST
-D_DEFAULT_SOURCE
begin
:
LDAPMessage.c maybe-wip-pause all
-include
Makefile.am.example
LDAPMessage.c
:
../sample.makefile.regen ../rfc4511-Lightweight-Directory-Access-Protocol-V3.asn1
make regen-makefile
...
...
@@ -38,13 +11,13 @@ LDAPMessage.c: ../sample.makefile.regen ../rfc4511-Lightweight-Directory-Access-
regen-makefile
:
TITLE
=
"Lightweight Directory Access Protocol V3 decoder"
\
ASN
1
CMDOPTS
=
"-fcompound-names"
\
ASN
1
MODULES
=
"../rfc4511-Lightweight-Directory-Access-Protocol-V3.asn1"
\
ASN
1
PDU
=
LDAPMessage
\
PROGNAME
=
ldap3dump
\
ASN
_
CMDOPTS
=
"-fcompound-names"
\
ASN
_
MODULES
=
"../rfc4511-Lightweight-Directory-Access-Protocol-V3.asn1"
\
ASN
_
PDU
=
LDAPMessage
\
ASN_PROGRAM
=
ldap3dump
\
../sample.makefile.regen
check
:
${
TARGET
} check-ber check-xer check-oer check-per
check
:
${
ASN_PROGRAM
} check-ber check-xer check-oer check-per
@
echo
================
@
echo
All tests passed
@
echo
================
...
...
@@ -52,76 +25,76 @@ check: ${TARGET} check-ber check-xer check-oer check-per
check-ber
:
@
if
test
-f
sample-LDAPMessage-1.[db]er
;
then
\
for
f
in
sample-
*
-
*
.[db]er
;
do
\
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\
\
1/"
`
;
\
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding
$$
f (
$$
pdu) into XER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
diff ./.tmp.1.
$$$$
./.tmp.2.
$$$$
||
exit
4
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
echo
"Test junking
$$
f (please wait)..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-iber
-onull
$$
f
||
exit
5
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-iber
-onull
$$
f
||
exit
6
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-iber
-onull
$$
f
||
exit
5
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-iber
-onull
$$
f
||
exit
6
;
\
done
;
done
;
fi
check-xer
:
@
if
test
-f
sample-LDAPMessage-1.xer
;
then
\
for
f
in
sample-
*
-
*
.xer
;
do
\
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\
\
1/"
`
;
\
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding
$$
f (
$$
pdu) into DER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
diff
$$
f ./.tmp.2.
$$$$
||
exit
4
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
echo
"Test junking
$$
f (please wait)..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-ixer
-onull
$$
f
||
exit
5
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-ixer
-onull
$$
f
||
exit
6
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-ixer
-onull
$$
f
||
exit
5
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-ixer
-onull
$$
f
||
exit
6
;
\
done
;
done
;
fi
check-oer
:
@
if
test
-f
sample-LDAPMessage-1.
*
oer
;
then
\
for
f
in
sample-
*
-
*
.
*
oer
;
do
\
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\
\
1/"
`
;
\
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding
$$
f (
$$
pdu) into XER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ioer
-oxer
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-ooer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ioer
-oxer
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-ooer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
diff
$$
f ./.tmp.2.
$$$$
||
exit
4
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
echo
"Test junking
$$
f (please wait) (
$$
b) ..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-ioer
-onull
$$
f
||
exit
5
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-ioer
-onull
$$
f
||
exit
6
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-ioer
-onull
$$
f
||
exit
5
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-ioer
-onull
$$
f
||
exit
6
;
\
done
;
done
;
fi
check-per
:
@
if
test
-f
sample-LDAPMessage-1-nopad.per
;
then
\
for
f
in
sample-
*
-[1-9]-nopad.per
;
do
\
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\
\
1/"
`
;
\
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding non-padded
$$
f (
$$
pdu) into DER into XER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-oder
./.tmp.2.
$$$$
>
./.tmp.3.
$$$$
||
exit
4
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-oder
./.tmp.2.
$$$$
>
./.tmp.3.
$$$$
||
exit
4
;
\
diff ./.tmp.1.
$$$$
./.tmp.3.
$$$$
||
exit
5
;
\
rm
-f
./.tmp.[123].
$$$$
;
\
echo
"Test junking
$$
f (please wait)..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-onull
$$
f
||
exit
6
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-onull
$$
f
||
exit
7
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-onull
$$
f
||
exit
6
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-onull
$$
f
||
exit
7
;
\
done
;
done
;
fi
@
if
test
-f
sample-LDAPMessage-1.per
;
then
\
for
f
in
sample-
*
-[1-9].per
;
do
\
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\
\
1/"
`
;
\
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding
$$
f (
$$
pdu) into DER into XER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
3
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
4
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-oper
./.tmp.2.
$$$$
>
./.tmp.1.
$$$$
||
exit
5
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
4
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-oper
./.tmp.2.
$$$$
>
./.tmp.1.
$$$$
||
exit
5
;
\
diff
$$
f ./.tmp.1.
$$$$
||
exit
6
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
echo
"Test junking
$$
f (please wait)..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-iper
-onull
$$
f
||
exit
7
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-iper
-onull
$$
f
||
exit
8
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-iper
-onull
$$
f
||
exit
7
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-iper
-onull
$$
f
||
exit
8
;
\
done
;
done
;
fi
maybe-wip-pause
:
...
...
@@ -130,5 +103,5 @@ maybe-wip-pause:
distclean
:
clean
rm
-f
$(ASN_MODULE_SOURCES)
rm
-f
$(ASN_MODULE_HEADERS)
rm
-f
$(ASN_
CONVERTER_SOURCES)
$(ASN_CONVERTER
_HEADERS)
rm
-f
$(ASN_
PROGRAM_SOURCES)
$(ASN_PROGRAM
_HEADERS)
rm
-f
Makefile.am.example
This diff is collapsed.
Click to expand it.
examples/sample.source.LTE-RRC/Makefile
View file @
40b8a7ae
...
...
@@ -3608,10 +3608,10 @@ DL-DCCH-Message.c: ../sample.makefile.regen ../lte-rrc-14.2.1.asn1
make
regen-makefile
:
ASN
1
CMDOPTS
=
"-pdu=auto -fcompound-names -gen-PER"
\
ASN
1
MODULES
=
"../lte-rrc-14.2.1.asn1"
\
ASN
1
PDU
=
DL-DCCH-Message
\
PROGNAME
=
lte-rrc-dump
\
ASN
_
CMDOPTS
=
"-pdu=auto -fcompound-names -gen-PER"
\
ASN
_
MODULES
=
"../lte-rrc-14.2.1.asn1"
\
ASN
_
PDU
=
DL-DCCH-Message
\
ASN_PROGRAM
=
lte-rrc-dump
\
CFLAGS
=
""
\
../sample.makefile.regen
...
...
This diff is collapsed.
Click to expand it.
examples/sample.source.MEGACO/Makefile
View file @
40b8a7ae
...
...
@@ -37,10 +37,10 @@ MegacoMessage.c: ../sample.makefile.regen ../rfc3525-MEDIA-GATEWAY-CONTROL.asn1
make
regen-makefile
:
ASN
1
CMDOPTS
=
"-fcompound-names"
\
ASN
1
MODULES
=
"../rfc3525-MEDIA-GATEWAY-CONTROL.asn1"
\
ASN
1
PDU
=
MegacoMessage
\
PROGNAME
=
megaco-dump
\
ASN
_
CMDOPTS
=
"-fcompound-names"
\
ASN
_
MODULES
=
"../rfc3525-MEDIA-GATEWAY-CONTROL.asn1"
\
ASN
_
PDU
=
MegacoMessage
\
ASN_PROGRAM
=
megaco-dump
\
../sample.makefile.regen
check
:
${TARGET} check-ber check-xer check-oer check-per
...
...
This diff is collapsed.
Click to expand it.
examples/sample.source.MHEG5/Makefile
View file @
40b8a7ae
...
...
@@ -477,10 +477,10 @@ InterchangedObject.c: ../sample.makefile.regen ../ISO13522-MHEG-5.asn
make
regen-makefile
:
ASN
1
CMDOPTS
=
"-fcompound-names"
\
ASN
1
MODULES
=
"../ISO13522-MHEG-5.asn"
\
ASN
1
PDU
=
InterchangedObject
\
PROGNAME
=
mheg5dump
\
ASN
_
CMDOPTS
=
"-fcompound-names"
\
ASN
_
MODULES
=
"../ISO13522-MHEG-5.asn"
\
ASN
_
PDU
=
InterchangedObject
\
ASN_PROGRAM
=
mheg5dump
\
CFLAGS
=
""
\
../sample.makefile.regen
...
...
This diff is collapsed.
Click to expand it.
examples/sample.source.PKIX1/Makefile
View file @
40b8a7ae
-include
Makefile.am.libasncodec
TARGET
=
x509dump
ASN_LIBRARY
=
libasncodec.a
LIBS
+=
-lm
CFLAGS
+=
-DHAVE_CONFIG_H
-DJUNKTEST
-D_DEFAULT_SOURCE
$(ASN_MODULE_CFLAGS)
-DPDU
=
Certificate
-I
.
ASN_CONVERTER_SOURCES
:=
\
converter-example.c
all
:
maybe-wip-pause Certificate.c $(TARGET)
$(TARGET)
:
$(ASN_LIBRARY) $(ASN_CONVERTER_SOURCES:.c=.o)
$(CC)
$(CFLAGS)
$(CPPFLAGS)
-o
$(TARGET)
$(ASN_CONVERTER_SOURCES:.c=.o)
$(LDFLAGS)
$(ASN_LIBRARY)
$(LIBS)
$(ASN_LIBRARY)
:
$(ASN_MODULE_SOURCES:.c=.o)
$(AR)
rcs
$@
$^
.SUFFIXES
:
.SUFFIXES
:
.c .o
.c.o
:
$(CC)
$(CFLAGS)
-o
$@
-c
$<
clean
:
rm
-f
$(TARGET)
$(ASN_LIBRARY)
rm
-f
$(ASN_MODULE_SOURCES:.c=.o)
$(ASN_CONVERTER_SOURCES:.c=.o)
regen
:
regenerate-from-asn1-source
regenerate-from-asn1-source
:
../../asn1c/asn1c
-S
../../skeletons
-pdu
=
Certificate
-fcompound-names
-fwide-types
../rfc3280-PKIX1Explicit88.asn1 ../rfc3280-PKIX1Implicit88.asn1
ASN_PROGRAM
=
x509dump
CFLAGS
+=
-DHAVE_CONFIG_H
-DJUNKTEST
-D_DEFAULT_SOURCE
begin
:
Certificate.c maybe-wip-pause all
-include
Makefile.am.example
Certificate.c
:
../sample.makefile.regen ../rfc3280-*.asn1
make regen-makefile
...
...
@@ -37,13 +10,13 @@ Certificate.c: ../sample.makefile.regen ../rfc3280-*.asn1
make
regen-makefile
:
ASN
1
CMDOPTS
=
"-fcompound-names -fwide-types"
\
ASN
1
MODULES
=
"../rfc3280-*.asn1"
\
ASN
1
PDU
=
Certificate
\
PROGNAME
=
x509dump
\
ASN
_
CMDOPTS
=
"-fcompound-names -fwide-types"
\
ASN
_
MODULES
=
"../rfc3280-*.asn1"
\
ASN
_
PDU
=
Certificate
\
ASN_PROGRAM
=
x509dump
\
../sample.makefile.regen
check
:
${
TARGET
} check-ber check-xer check-oer check-per
check
:
${
ASN_PROGRAM
} check-ber check-xer check-oer check-per
@
echo
================
@
echo
All tests passed
@
echo
================
...
...
@@ -54,13 +27,13 @@ check-ber:
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding
$$
f (
$$
pdu) into XER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
diff ./.tmp.1.
$$$$
./.tmp.2.
$$$$
||
exit
4
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
echo
"Test junking
$$
f (please wait)..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-iber
-onull
$$
f
||
exit
5
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-iber
-onull
$$
f
||
exit
6
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-iber
-onull
$$
f
||
exit
5
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-iber
-onull
$$
f
||
exit
6
;
\
done
;
done
;
fi
check-xer
:
...
...
@@ -69,13 +42,13 @@ check-xer:
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding
$$
f (
$$
pdu) into DER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
diff
$$
f ./.tmp.2.
$$$$
||
exit
4
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
echo
"Test junking
$$
f (please wait)..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-ixer
-onull
$$
f
||
exit
5
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-ixer
-onull
$$
f
||
exit
6
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-ixer
-onull
$$
f
||
exit
5
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-ixer
-onull
$$
f
||
exit
6
;
\
done
;
done
;
fi
check-oer
:
...
...
@@ -84,13 +57,13 @@ check-oer:
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding
$$
f (
$$
pdu) into XER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ioer
-oxer
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-ooer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ioer
-oxer
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-ooer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
diff
$$
f ./.tmp.2.
$$$$
||
exit
4
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
echo
"Test junking
$$
f (please wait) (
$$
b) ..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-ioer
-onull
$$
f
||
exit
5
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-ioer
-onull
$$
f
||
exit
6
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-ioer
-onull
$$
f
||
exit
5
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-ioer
-onull
$$
f
||
exit
6
;
\
done
;
done
;
fi
check-per
:
...
...
@@ -99,28 +72,28 @@ check-per:
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding non-padded
$$
f (
$$
pdu) into DER into XER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-oder
./.tmp.2.
$$$$
>
./.tmp.3.
$$$$
||
exit
4
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
2
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-oder
./.tmp.2.
$$$$
>
./.tmp.3.
$$$$
||
exit
4
;
\
diff ./.tmp.1.
$$$$
./.tmp.3.
$$$$
||
exit
5
;
\
rm
-f
./.tmp.[123].
$$$$
;
\
echo
"Test junking
$$
f (please wait)..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-onull
$$
f
||
exit
6
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-onull
$$
f
||
exit
7
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-onull
$$
f
||
exit
6
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-per-nopad
-iper
-onull
$$
f
||
exit
7
;
\
done
;
done
;
fi
@
if
test
-f
sample-Certificate-1.per
;
then
\
for
f
in
sample-
*
-[1-9].per
;
do
\
pdu
=
`
echo
$$
f |
sed
-E
-e
"s/sample-([A-Za-z0-9-]+)-[0-9].*/
\1
/"
`
;
\
for
b
in
1 17 33 980 8192
;
do
\
echo
"Recoding
$$
f (
$$
pdu) into DER into XER and back (
$$
b)..."
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
3
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
4
;
\
./
${
TARGET
}
-p
$$
pdu
-b
$$
b
-ixer
-oper
./.tmp.2.
$$$$
>
./.tmp.1.
$$$$
||
exit
5
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iper
-oder
$$
f
>
./.tmp.1.
$$$$
||
exit
3
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-iber
-oxer
./.tmp.1.
$$$$
>
./.tmp.2.
$$$$
||
exit
4
;
\
./
${
ASN_PROGRAM
}
-p
$$
pdu
-b
$$
b
-ixer
-oper
./.tmp.2.
$$$$
>
./.tmp.1.
$$$$
||
exit
5
;
\
diff
$$
f ./.tmp.1.
$$$$
||
exit
6
;
\
rm
-f
./.tmp.[12].
$$$$
;
\
echo
"Test junking
$$
f (please wait)..."
;
\
./
${
TARGET
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-iper
-onull
$$
f
||
exit
7
;
\
./
${
TARGET
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-iper
-onull
$$
f
||
exit
8
;
\
./
${
ASN_PROGRAM
}
-J0
.0001
-n
1000
-p
$$
pdu
-b
$$
b
-iper
-onull
$$
f
||
exit
7
;
\
./
${
ASN_PROGRAM
}
-J0
.001
-n
1000
-p
$$
pdu
-b
$$
b
-iper
-onull
$$
f
||
exit
8
;
\
done
;
done
;
fi
maybe-wip-pause
:
...
...
@@ -129,5 +102,5 @@ maybe-wip-pause:
distclean
:
clean
rm
-f
$(ASN_MODULE_SOURCES)
rm
-f
$(ASN_MODULE_HEADERS)
rm
-f
$(ASN_
CONVERTER_SOURCES)
$(ASN_CONVERTER
_HEADERS)
rm
-f
$(ASN_
PROGRAM_SOURCES)
$(ASN_PROGRAM
_HEADERS)
rm
-f
Makefile.am.example
This diff is collapsed.
Click to expand it.
examples/sample.source.RRC/Makefile
View file @
40b8a7ae
...
...
@@ -38,10 +38,10 @@ DL-DCCH-Message.c: ../sample.makefile.regen ../rrc-7.1.0.asn1
make
regen-makefile
:
ASN
1
CMDOPTS
=
"-pdu=auto -fcompound-names -gen-PER"
\
ASN
1
MODULES
=
"../rrc-7.1.0.asn1"
\
ASN
1
PDU
=
DL-DCCH-Message
\
PROGNAME
=
rrc-dump
\
ASN
_
CMDOPTS
=
"-pdu=auto -fcompound-names -gen-PER"
\
ASN
_
MODULES
=
"../rrc-7.1.0.asn1"
\
ASN
_
PDU
=
DL-DCCH-Message
\
ASN_PROGRAM
=
rrc-dump
\
../sample.makefile.regen
check
:
${TARGET} check-ber check-xer check-oer check-per
...
...
This diff is collapsed.
Click to expand it.
examples/sample.source.TAP3/Makefile
View file @
40b8a7ae
...
...
@@ -38,10 +38,10 @@ DataInterChange.c: ../sample.makefile.regen ../tap3.asn1
regen-makefile
:
TITLE
=
"GSM TAP3 (Transferred Account Procedure, Version 3) decoder"
\
ASN
1
CMDOPTS
=
""
\
ASN
1
MODULES
=
"../tap3.asn1"
\
ASN
1
PDU
=
DataInterChange
\
PROGNAME
=
tap3dump
\
ASN
_
CMDOPTS
=
""
\
ASN
_
MODULES
=
"../tap3.asn1"
\
ASN
_
PDU
=
DataInterChange
\
ASN_PROGRAM
=
tap3dump
\
../sample.makefile.regen
check
:
${TARGET} check-ber check-xer check-oer check-per
...
...
This diff is collapsed.
Click to expand it.
examples/sample.source.ULP/Makefile
View file @
40b8a7ae
...
...
@@ -39,10 +39,10 @@ ULP-PDU.c: ../sample.makefile.regen ../ulp.asn1
regen-makefile
:
TITLE
=
"OMA UserPlane Location Protocol decoder"
\
ASN
1
CMDOPTS
=
"-pdu=SUPLINIT -fcompound-names -gen-PER"
\
ASN
1
MODULES
=
"../ulp.asn1"
\
ASN
1
PDU
=
ULP-PDU
\
PROGNAME
=
ulp-dump
\
ASN
_
CMDOPTS
=
"-pdu=SUPLINIT -fcompound-names -gen-PER"
\
ASN
_
MODULES
=
"../ulp.asn1"
\
ASN
_
PDU
=
ULP-PDU
\
ASN_PROGRAM
=
ulp-dump
\
../sample.makefile.regen
check
:
${TARGET} check-ber check-xer check-oer check-per
...
...
This diff is collapsed.
Click to expand it.
libasn1compiler/asn1c_save.c
View file @
40b8a7ae
...
...
@@ -159,11 +159,11 @@ asn1c__save_example_makefile(arg_t *arg, const asn1c_fdeps_t *deps,
safe_fprintf
(
mkf
,
"include %s
\n\n
"
"TARGET = converter-example
\n
"
"ASN_LIBRARY=libasncodec.a
\n
"
"LIBS += -lm
\n
"
"CFLAGS += $(ASN_MODULE_CFLAGS) %s%s-I.
\n
"
"ASN_CONVERTER_SOURCES = "
,
"ASN_LIBRARY ?= libasncodec.a
\n
"
"ASN_PROGRAM ?= converter-example
\n
"
"ASN_PROGRAM_SOURCES ?= "
,
library_makefile_name
,
(
arg
->
flags
&
A1C_PDU_TYPE
)
?
generate_pdu_C_definition
()
:
""
,
need_to_generate_pdu_collection
(
arg
)
?
"-DASN_PDU_COLLECTION "
:
""
);
...
...
@@ -187,9 +187,9 @@ asn1c__save_example_makefile(arg_t *arg, const asn1c_fdeps_t *deps,
safe_fprintf
(
mkf
,
"
\n\n
all: $(
TARGET
)
\n
"
"
\n
$(
TARGET): $(ASN_LIBRARY) $(ASN_CONVERTER
_SOURCES:.c=.o)"
"
\n\t
$(CC) $(CFLAGS) $(CPPFLAGS) -o $(
TARGET) $(ASN_CONVERTER
_SOURCES:.c=.o) $(LDFLAGS) $(ASN_LIBRARY) $(LIBS)
\n
"
"
\n\n
all: $(
ASN_PROGRAM
)
\n
"
"
\n
$(
ASN_PROGRAM): $(ASN_LIBRARY) $(ASN_PROGRAM
_SOURCES:.c=.o)"
"
\n\t
$(CC) $(CFLAGS) $(CPPFLAGS) -o $(
ASN_PROGRAM) $(ASN_PROGRAM
_SOURCES:.c=.o) $(LDFLAGS) $(ASN_LIBRARY) $(LIBS)
\n
"
"
\n
$(ASN_LIBRARY): $(ASN_MODULE_SOURCES:.c=.o)"
"
\n\t
$(AR) rcs $@ $(ASN_MODULE_SOURCES:.c=.o)
\n
"
"
\n
.SUFFIXES:"
...
...
@@ -198,7 +198,7 @@ asn1c__save_example_makefile(arg_t *arg, const asn1c_fdeps_t *deps,
"
\n\t
$(CC) $(CFLAGS) -o $@ -c $<
\n
"
"
\n
clean:"
"
\n\t
rm -f $(TARGET) $(ASN_LIBRARY)"
"
\n\t
rm -f $(ASN_MODULE_SOURCES:.c=.o) $(ASN_
CONVERTER
_SOURCES:.c=.o)
\n
"
"
\n\t
rm -f $(ASN_MODULE_SOURCES:.c=.o) $(ASN_
PROGRAM
_SOURCES:.c=.o)
\n
"
"
\n
regen: regenerate-from-asn1-source
\n
"
"
\n
regenerate-from-asn1-source:
\n\t
"
);
...
...
This diff is collapsed.
Click to expand it.
tests/tests-c-compiler/Makefile.am
View file @
40b8a7ae
...
...
@@ -44,7 +44,6 @@ TESTS += check-src/check-39.c
TESTS
+=
check-src/check-41.-fwide-types.c
TESTS
+=
check-src/check-41.c
TESTS
+=
check-src/check-42.c
TESTS
+=
check-src/check-42.-fwide-types.cc
TESTS
+=
check-src/check-43.c
TESTS
+=
check-src/check-44.c
TESTS
+=
check-src/check-46.c
...
...
@@ -72,8 +71,7 @@ EXTRA_DIST = \
data-119
\
data-126
\
check-src/check64-134.-gen-PER.c
\
check-src/check64-136.-gen-OER.c
\
check-src/check-42.-fwide-types.cc
check-src/check64-136.-gen-OER.c
clean-local
:
rm
-rf
test-
*
This diff is collapsed.
Click to expand it.
tests/tests-c-compiler/check-assembly.sh
View file @
40b8a7ae
...
...
@@ -28,26 +28,10 @@ fi
source_short
=
$(
echo
"
$source_full
"
|
sed
-e
's/.*\///'
)
testno
=
$(
echo
"
$source_short
"
|
cut
-f2
-d
'-'
|
cut
-f1
-d
'.'
)
CODECS_FLAGS
=
""
has_oer
=
$(
echo
"
$source_short
"
|
grep
"gen-OER"
||
:
)
if
[
!
"
$has_oer
"
]
;
then
CODECS_FLAGS
=
"
${
CODECS_FLAGS
}
-DASN_DISABLE_OER_SUPPORT"
fi
has_per
=
$(
echo
"
$source_short
"
|
grep
"gen-PER"
||
:
)
if
[
!
"
$has_per
"
]
;
then
CODECS_FLAGS
=
"
${
CODECS_FLAGS
}
-DASN_DISABLE_PER_SUPPORT"
fi
args
=
$(
echo
"
$source_short
"
|
sed
-E
-e
's/\.c+$//'
)
source_obj
=
$(
echo
"
$source_short
"
|
sed
-E
-e
's/\.c+$/.o/'
)
ext
=
$(
echo
"
$source_short
"
|
sed
-E
-e
's/.*\.(c+)$/\1/'
)
if
[
"
$ext
"
=
"cc"
]
;
then
COMPILER
=
'$(CXX) $(CXX_CFLAGS)'
else
COMPILER
=
'$(CC)'
fi
OFS
=
$IFS
IFS
=
"."
set
$args
...
...
@@ -84,25 +68,25 @@ asn_module=$(echo "${abs_top_srcdir}/tests/tests-asn1c-compiler/${testno}"-*.asn
AUTOGENERATED
=
"# This file is autogenerated by
$0
${
source_full
}
${
AFLAGS
}
"
# Create a common Makefile for the project
cat
<<
TARGETS
> "
${
testdir
}
/Makefile.targets
"
cat
<<
END_MAKEFILE
> "
${
testdir
}
/Makefile
"
${
AUTOGENERATED
}
COMMON_FLAGS= -I.
CFLAGS =
\$
{COMMON_FLAGS}
${
CFLAGS
:-}
-g -O1
CFLAGS += -DSRCDIR=../
${
srcdir
}
${
CODECS_FLAGS
}
CFLAGS += -DSRCDIR=../
${
srcdir
}
CXXFLAGS =
\$
{CFLAGS}
${
CXXFLAGS
}
LIBFUZZER_CFLAGS =
${
LIBFUZZER_CFLAGS
}
LDFLAGS =
${
LDFLAGS
:-}
ASN_PROGRAM = check-program
ASN_PROGRAM_SOURCES =
${
source_short
}
CC ?=
${
CC
}
CXX ?=
${
CXX
}
all: compiled-module
\$
(MAKE) check-executable
-include Makefile.am.example
check-executable:
\$
(OBJS)
@rm -f *.core
${
COMPILER
}
\$
(CFLAGS)
\$
(LDFLAGS) -o check-executable
\$
(OBJS) -lm
all: compiled-module
\$
(MAKE) check-program
# Compile the corresponding .asn1 spec.
compiled-module:
${
asn_module
}
${
abs_top_builddir
}
/asn1c/asn1c
...
...
@@ -113,33 +97,30 @@ compiled-module: ${asn_module} ${abs_top_builddir}/asn1c/asn1c
rm -f converter-example.c
@touch compiled-module
TARGETS
END_MAKEFILE
if
[
"
${
MAKE_FUZZER
}
"
!=
"yes"
]
;
then
CHECK_FUZZER
=
"@echo
\"
No fuzzer defined, skipping.
\"
"
cat
<<
TARGETS
>> "
${
testdir
}
/Makefile.targets
"
cat
<<
END_MAKEFILE
>> "
${
testdir
}
/Makefile
"
.PHONY: check-fuzzer
check-fuzzer:
TARGETS
END_MAKEFILE
else
CHECK_FUZZER
=
"ASAN_OPTIONS=detect_leaks=1 UBSAN_OPTIONS=print_stacktrace=1 ./check-fuzzer -timeout=3 -max_total_time=60 -max_len=512
${
OPT_DATA_DIR
}
"
cat
<<
TARGETS
>> "
${
testdir
}
/Makefile.targets"
check-fuzzer:
\$
(OBJS)
rm -f
${
source_obj
}
${
COMPILER
}
\$
(CFLAGS)
\$
(LIBFUZZER_CFLAGS) -c -o
${
source_obj
}
${
source_short
}
${
COMPILER
}
\$
(CFLAGS)
\$
(LIBFUZZER_CFLAGS)
\$
(LDFLAGS) -o check-fuzzer
\$
(OBJS)
rm -f
${
source_obj
}
TARGETS
cat
<<
END_MAKEFILE
>> "
${
testdir
}
/Makefile"
check-fuzzer:
${
source_short
}
\$
(ASN_LIBRARY)
${
CC
}
\$
(CFLAGS)
\$
(LIBFUZZER_CFLAGS)
\$
(LDFLAGS) -o check-fuzzer
\$
^
END_MAKEFILE
fi
cat
<<
TARGETS
>> "
${
testdir
}
/Makefile.targets
"
cat
<<
END_MAKEFILE
>> "
${
testdir
}
/Makefile
"
check-succeeded: compiled-module
\$
(MAKE) check-
executable
check-succeeded: compiled-module
\$
(ASN_LIBRARY)
${
source_short
}
\$
(MAKE) check-
program
\$
(MAKE) check-fuzzer
@rm -f check-succeeded
./check-
executable
./check-
program
\$
(MAKE) fuzz
@touch check-succeeded
@echo "OK:
${
source_full
}
"
...
...
@@ -150,43 +131,10 @@ fuzz:
check: check-succeeded
clean:
@rm -f *.o check-executable
TARGETS
# Create a BSD- or GNU-specific Makefile for the project.
produce_specific_makefile
()
{
local
make_type
=
$1
local
make_file
=
"
$testdir
/
${
make_type
}
makefile"
if
[
${
make_type
}
=
"BSD"
]
;
then
cat
<<-
OBJECTS
>
${
make_file
}
${
AUTOGENERATED
}
SRCS_C!=find . -name
\*
.c
SRCS_CXX!=find . -name
\*
.cc
SRCS=
\$
(SRCS_C)
\$
(SRCS_CXX)
OBJS=
\$
{SRCS_C:.c=.o}
\$
{SRCS_CXX:.cc=.o}
include Makefile.targets
OBJECTS
else
cat
<<-
OBJECTS
>
${
make_file
}
${
AUTOGENERATED
}
SRCS_C :=
\$
(wildcard *.c)
SRCS_CXX :=
\$
(wildcard *.cc)
SRCS =
\$
(SRCS_C)
\$
(SRCS_CXX)
OBJS =
\$
(patsubst %.c,%.o,
\$
(SRCS_C))
OBJS+=
\$
(patsubst %.cc,%.o,
\$
(SRCS_CXX))
include Makefile.targets
OBJECTS
fi
}
produce_specific_makefile BSD
produce_specific_makefile GNU
END_MAKEFILE
# Perform building and checking
${
TEST_DRIVER
}
make
-C
"
$testdir
"
check
${
TEST_DRIVER
}
${
MAKE
:-
make
}
-C
"
${
testdir
}
"
check
# Make sure the test is not marked as failed any longer.
rm
-f
"
${
testdir
}
-FAILED"
This diff is collapsed.
Click to expand it.
tests/tests-randomized/Makefile.am
View file @
40b8a7ae
...
...
@@ -16,12 +16,18 @@ TESTS_ENVIRONMENT= \
ASAN_ENV_FLAGS
=
"@ASAN_ENV_FLAGS@"
\
srcdir
=
${srcdir}
\
abs_top_srcdir
=
${abs_top_srcdir}
\
abs_top_builddir
=
${abs_top_builddir}
abs_top_builddir
=
${abs_top_builddir}
\
${srcdir}
/check-bundles.sh
TESTS
=
$(dist_check_SCRIPTS)
TESTS
=
TESTS
+=
bundles/01-1.txt
TESTS
+=
bundles/01-2.txt
EXTRA_DIST
=
bundles random-test-driver.c
EXTRA_DIST
=
\
random-test-driver.c
\
$(srcdir)
/bundles/README
\
$(srcdir)
/bundles/
*
.txt
clean-local
:
rm
-rf
.tmp.
random
rm
-rf
.tmp.
*
This diff is collapsed.
Click to expand it.
tests/tests-randomized/check-bundles.sh
View file @
40b8a7ae
...
...
@@ -26,7 +26,7 @@ usage() {
exit
1
}
RNDTEMP
=
.tmp.random
RNDTEMP
=
"
${
RNDTEMP
:-
.tmp.random
}
"
srcdir
=
"
${
srcdir
:-
.
}
"
abs_top_srcdir
=
"
${
abs_top_srcdir
:-
`
pwd
`
/../../
}
"
...
...
@@ -38,7 +38,7 @@ stop_after_failed=1 # We stop after 3 failures.
need_clean_before_bundle
=
1
# Clean before testing a bundle file
need_clean_before_test
=
0
# Before each line in a bundle file
encodings
=
""
# Default is to verify all supported ASN.1 transfer syntaxes
parallelism
=
4
parallelism
=
1
asn1c_flags
=
""
make_clean_before_bundle
()
{
...
...
@@ -229,9 +229,12 @@ asn_compile() {
fi
rm
-f
converter-example.c
ln
-sf
"../
${
srcdir
}
/random-test-driver.c"
||
cp
"../
${
srcdir
}
/random-test-driver.c"
.
echo
"CFLAGS+= -DASN1_TEXT='
$short_asn
'"
>
Makefile
sed
-e
's/converter-example/random-test-driver/'
\
< Makefile.am.example
>>
Makefile
{
echo
"CFLAGS+= -DASN1_TEXT='
$short_asn
'"
;
echo
"ASN_PROGRAM = random-test-driver"
echo
"ASN_PROGRAM_SOURCES = random-test-driver.c"
echo
"include Makefile.am.example"
}
>
Makefile
echo
"Makefile.am.example -> Makefile"
}
...
...
@@ -271,11 +274,26 @@ test_drive() {
fi
}
if
echo
"
$*
"
|
grep
' -- '
>
/dev/null
;
then
TEST_DRIVER
=
`
echo
"
$*
"
|
sed
-e
's/ -- .*/ -- /g'
`
args
=
`
echo
"
$*
"
|
sed
-e
's/.* //g'
`
set
"
${
args
}
"
else
TEST_DRIVER
=
""
fi
# Command line parsing
while
:
;
do
case
"
$1
"
in
-h
)
usage
;;
--asn1c
)
asn1c_flags
=
"
${
asn1c_flags
}
$2
"
;
shift
2
;
continue
;;
--bundle
)
shift
base
=
`
basename
"
$1
"
|
sed
-e
's/.txt$//'
`
RNDTEMP
=
".tmp.
${
base
}
"
test_drive verify_asn_types_in_file
"
$@
"
break
;;
--dirty
)
need_clean_before_bundle
=
0
need_clean_before_test
=
0
...
...
@@ -285,7 +303,6 @@ while :; do
-e
)
encodings
=
"
${
encodings
}
-e
$2
"
;
shift
2
;
continue
;;
-j
)
parallelism
=
"
$1
"
;
shift
2
;
continue
;;
-t
)
parallelism
=
1
# Better for debuggability
test_drive verify_asn_type
"
$2
"
"(command line)"
||
exit
1
;;
""
)
for
bundle
in
`
ls
-1
${
srcdir
}
/bundles/
*
.txt |
sort
-nr
`
;
do
...
...
@@ -293,7 +310,7 @@ while :; do
done
;;
*
)
test_drive verify_asn_types_in_fi
le
"
$@
"
exec
${
TEST_DRIVER
}
$0
--bund
le
"
$@
"
;;
esac
break
...
...
This diff is collapsed.
Click to expand it.
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