Lev Walkin | 40b8a7a | 2017-10-08 22:36:29 -0700 | [diff] [blame] | 1 | ASN_PROGRAM = 1609-2-dump |
| 2 | CFLAGS += -DASN_CONVERTER_TITLE="IEEE 1609.2-2016 decoder" -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE |
| 3 | begin: Certificate.c maybe-wip-pause all |
Lev Walkin | d748bff | 2017-08-07 17:47:50 -0700 | [diff] [blame] | 4 | |
Lev Walkin | 40b8a7a | 2017-10-08 22:36:29 -0700 | [diff] [blame] | 5 | -include Makefile.am.example |
Lev Walkin | d748bff | 2017-08-07 17:47:50 -0700 | [diff] [blame] | 6 | |
| 7 | Certificate.c: ../sample.makefile.regen ../IEEE-1609.2-2016.asn1 |
| 8 | make regen-makefile |
| 9 | @touch Certificate.c |
| 10 | make |
| 11 | |
| 12 | regen-makefile: |
| 13 | TITLE="IEEE 1609.2-2016 decoder" \ |
Lev Walkin | 40b8a7a | 2017-10-08 22:36:29 -0700 | [diff] [blame] | 14 | ASN_CMDOPTS="-pdu=auto -pdu=Ieee1609Dot2Data -fcompound-names -gen-OER" \ |
| 15 | ASN_MODULES="../IEEE-1609.2-2016.asn1" \ |
| 16 | ASN_PDU=Certificate \ |
| 17 | ASN_PROGRAM=1609-2-dump \ |
Lev Walkin | d748bff | 2017-08-07 17:47:50 -0700 | [diff] [blame] | 18 | ../sample.makefile.regen |
| 19 | |
Lev Walkin | 40b8a7a | 2017-10-08 22:36:29 -0700 | [diff] [blame] | 20 | check: ${ASN_PROGRAM} check-ber check-xer check-oer check-per |
Lev Walkin | d748bff | 2017-08-07 17:47:50 -0700 | [diff] [blame] | 21 | @echo ================ |
| 22 | @echo All tests passed |
| 23 | @echo ================ |
| 24 | |
| 25 | check-ber: |
| 26 | @if test -f sample-Certificate-1.[db]er ; then \ |
Lev Walkin | aa7e94f | 2017-08-27 23:44:58 -0700 | [diff] [blame] | 27 | for f in sample-*-*.[db]er; do \ |
Lev Walkin | fe4e047 | 2017-09-04 22:34:50 -0700 | [diff] [blame] | 28 | pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \ |
Lev Walkin | d748bff | 2017-08-07 17:47:50 -0700 | [diff] [blame] | 29 | for b in 1 17 33 980 8192; do \ |
Lev Walkin | aa7e94f | 2017-08-27 23:44:58 -0700 | [diff] [blame] | 30 | echo "Recoding $$f ($$pdu) into XER and back ($$b)..."; \ |
Lev Walkin | 40b8a7a | 2017-10-08 22:36:29 -0700 | [diff] [blame] | 31 | ./${ASN_PROGRAM} -p $$pdu -b $$b -iber -oxer $$f > ./.tmp.1.$$$$ || exit 2; \ |
| 32 | ./${ASN_PROGRAM} -p $$pdu -b $$b -ixer -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ |
Lev Walkin | d748bff | 2017-08-07 17:47:50 -0700 | [diff] [blame] | 33 | diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 4; \ |
| 34 | rm -f ./.tmp.[12].$$$$; \ |
| 35 | echo "Test junking $$f (please wait)..."; \ |
Lev Walkin | 40b8a7a | 2017-10-08 22:36:29 -0700 | [diff] [blame] | 36 | ./${ASN_PROGRAM} -J0.0001 -n 1000 -p $$pdu -b $$b -iber -onull $$f || exit 5; \ |
| 37 | ./${ASN_PROGRAM} -J0.001 -n 1000 -p $$pdu -b $$b -iber -onull $$f || exit 6; \ |
Lev Walkin | d748bff | 2017-08-07 17:47:50 -0700 | [diff] [blame] | 38 | done; done; fi |
| 39 | |
| 40 | check-xer: |
| 41 | @if test -f sample-Certificate-1.xer ; then \ |
Lev Walkin | aa7e94f | 2017-08-27 23:44:58 -0700 | [diff] [blame] | 42 | for f in sample-*-*.xer; do \ |
Lev Walkin | fe4e047 | 2017-09-04 22:34:50 -0700 | [diff] [blame] | 43 | pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \ |
Lev Walkin | d748bff | 2017-08-07 17:47:50 -0700 | [diff] [blame] | 44 | for b in 1 17 33 980 8192; do \ |
Lev Walkin | aa7e94f | 2017-08-27 23:44:58 -0700 | [diff] [blame] | 45 | echo "Recoding $$f ($$pdu) into DER and back ($$b)..."; \ |
Lev Walkin | 40b8a7a | 2017-10-08 22:36:29 -0700 | [diff] [blame] | 46 | ./${ASN_PROGRAM} -p $$pdu -b $$b -ixer -oder $$f > ./.tmp.1.$$$$ || exit 2; \ |
| 47 | ./${ASN_PROGRAM} -p $$pdu -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ |
Lev Walkin | d748bff | 2017-08-07 17:47:50 -0700 | [diff] [blame] | 48 | diff $$f ./.tmp.2.$$$$ || exit 4; \ |
| 49 | rm -f ./.tmp.[12].$$$$; \ |
| 50 | echo "Test junking $$f (please wait)..."; \ |
Lev Walkin | 40b8a7a | 2017-10-08 22:36:29 -0700 | [diff] [blame] | 51 | ./${ASN_PROGRAM} -J0.0001 -n 1000 -p $$pdu -b $$b -ixer -onull $$f || exit 5; \ |
| 52 | ./${ASN_PROGRAM} -J0.001 -n 1000 -p $$pdu -b $$b -ixer -onull $$f || exit 6; \ |
Lev Walkin | aa7e94f | 2017-08-27 23:44:58 -0700 | [diff] [blame] | 53 | done; done; fi |
| 54 | |
| 55 | check-oer: |
| 56 | @if test -f sample-Certificate-1.*oer ; then \ |
Lev Walkin | 3b6cba5 | 2017-08-31 01:57:04 -0700 | [diff] [blame] | 57 | for f in sample-*-*.*oer; do \ |
Lev Walkin | fe4e047 | 2017-09-04 22:34:50 -0700 | [diff] [blame] | 58 | pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \ |
Lev Walkin | aa7e94f | 2017-08-27 23:44:58 -0700 | [diff] [blame] | 59 | for b in 1 17 33 980 8192; do \ |
| 60 | echo "Recoding $$f ($$pdu) into XER and back ($$b)..."; \ |
Lev Walkin | 40b8a7a | 2017-10-08 22:36:29 -0700 | [diff] [blame] | 61 | ./${ASN_PROGRAM} -p $$pdu -b $$b -ioer -oxer $$f > ./.tmp.1.$$$$ || exit 2; \ |
| 62 | ./${ASN_PROGRAM} -p $$pdu -b $$b -ixer -ooer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ |
Lev Walkin | 3b6cba5 | 2017-08-31 01:57:04 -0700 | [diff] [blame] | 63 | diff $$f ./.tmp.2.$$$$ || exit 4; \ |
Lev Walkin | aa7e94f | 2017-08-27 23:44:58 -0700 | [diff] [blame] | 64 | rm -f ./.tmp.[12].$$$$; \ |
Lev Walkin | 3b6cba5 | 2017-08-31 01:57:04 -0700 | [diff] [blame] | 65 | echo "Test junking $$f (please wait) ($$b) ..."; \ |
Lev Walkin | 40b8a7a | 2017-10-08 22:36:29 -0700 | [diff] [blame] | 66 | ./${ASN_PROGRAM} -J0.0001 -n 1000 -p $$pdu -b $$b -ioer -onull $$f || exit 5; \ |
| 67 | ./${ASN_PROGRAM} -J0.001 -n 1000 -p $$pdu -b $$b -ioer -onull $$f || exit 6; \ |
Lev Walkin | d748bff | 2017-08-07 17:47:50 -0700 | [diff] [blame] | 68 | done; done; fi |
| 69 | |
| 70 | check-per: |
| 71 | @if test -f sample-Certificate-1-nopad.per ; then \ |
Lev Walkin | aa7e94f | 2017-08-27 23:44:58 -0700 | [diff] [blame] | 72 | for f in sample-*-[1-9]-nopad.per; do \ |
Lev Walkin | fe4e047 | 2017-09-04 22:34:50 -0700 | [diff] [blame] | 73 | pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \ |
Lev Walkin | d748bff | 2017-08-07 17:47:50 -0700 | [diff] [blame] | 74 | for b in 1 17 33 980 8192; do \ |
Lev Walkin | aa7e94f | 2017-08-27 23:44:58 -0700 | [diff] [blame] | 75 | echo "Recoding non-padded $$f ($$pdu) into DER into XER and back ($$b)..."; \ |
Lev Walkin | 40b8a7a | 2017-10-08 22:36:29 -0700 | [diff] [blame] | 76 | ./${ASN_PROGRAM} -p $$pdu -b $$b -per-nopad -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ |
| 77 | ./${ASN_PROGRAM} -p $$pdu -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ |
| 78 | ./${ASN_PROGRAM} -p $$pdu -b $$b -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 4; \ |
Lev Walkin | d748bff | 2017-08-07 17:47:50 -0700 | [diff] [blame] | 79 | diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 5; \ |
| 80 | rm -f ./.tmp.[123].$$$$; \ |
| 81 | echo "Test junking $$f (please wait)..."; \ |
Lev Walkin | 40b8a7a | 2017-10-08 22:36:29 -0700 | [diff] [blame] | 82 | ./${ASN_PROGRAM} -J0.0001 -n 1000 -p $$pdu -b $$b -per-nopad -iper -onull $$f || exit 6; \ |
| 83 | ./${ASN_PROGRAM} -J0.001 -n 1000 -p $$pdu -b $$b -per-nopad -iper -onull $$f || exit 7; \ |
Lev Walkin | d748bff | 2017-08-07 17:47:50 -0700 | [diff] [blame] | 84 | done; done; fi |
| 85 | @if test -f sample-Certificate-1.per ; then \ |
| 86 | for f in sample-*-[1-9].per; do \ |
Lev Walkin | fe4e047 | 2017-09-04 22:34:50 -0700 | [diff] [blame] | 87 | pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \ |
Lev Walkin | d748bff | 2017-08-07 17:47:50 -0700 | [diff] [blame] | 88 | for b in 1 17 33 980 8192; do \ |
Lev Walkin | aa7e94f | 2017-08-27 23:44:58 -0700 | [diff] [blame] | 89 | echo "Recoding $$f ($$pdu) into DER into XER and back ($$b)..."; \ |
Lev Walkin | 40b8a7a | 2017-10-08 22:36:29 -0700 | [diff] [blame] | 90 | ./${ASN_PROGRAM} -p $$pdu -b $$b -iper -oder $$f > ./.tmp.1.$$$$ || exit 3; \ |
| 91 | ./${ASN_PROGRAM} -p $$pdu -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 4; \ |
| 92 | ./${ASN_PROGRAM} -p $$pdu -b $$b -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 5; \ |
Lev Walkin | d748bff | 2017-08-07 17:47:50 -0700 | [diff] [blame] | 93 | diff $$f ./.tmp.1.$$$$ || exit 6; \ |
| 94 | rm -f ./.tmp.[12].$$$$; \ |
| 95 | echo "Test junking $$f (please wait)..."; \ |
Lev Walkin | 40b8a7a | 2017-10-08 22:36:29 -0700 | [diff] [blame] | 96 | ./${ASN_PROGRAM} -J0.0001 -n 1000 -p $$pdu -b $$b -iper -onull $$f || exit 7; \ |
| 97 | ./${ASN_PROGRAM} -J0.001 -n 1000 -p $$pdu -b $$b -iper -onull $$f || exit 8; \ |
Lev Walkin | d748bff | 2017-08-07 17:47:50 -0700 | [diff] [blame] | 98 | done; done; fi |
| 99 | |
| 100 | maybe-wip-pause: |
Lev Walkin | aa7e94f | 2017-08-27 23:44:58 -0700 | [diff] [blame] | 101 | @if [ -f WIP ]; then cat WIP; sleep 2; fi |
Lev Walkin | d748bff | 2017-08-07 17:47:50 -0700 | [diff] [blame] | 102 | |
| 103 | distclean: clean |
| 104 | rm -f $(ASN_MODULE_SOURCES) |
| 105 | rm -f $(ASN_MODULE_HEADERS) |
Lev Walkin | 40b8a7a | 2017-10-08 22:36:29 -0700 | [diff] [blame] | 106 | rm -f $(ASN_PROGRAM_SOURCES) $(ASN_PROGRAM_HEADERS) |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame] | 107 | rm -f Makefile.am.example |