Browse Source

Merge pull request #358 from libtom/travis/build-debug

Travis/build debug
Steffen Jaeckel 7 years ago
parent
commit
4d17d1328d
3 changed files with 15 additions and 4 deletions
  1. 9 2
      .ci/meta_builds.sh
  2. 1 1
      src/pk/asn1/der/sequence/der_decode_sequence_flexi.c
  3. 5 1
      tests/der_test.c

+ 9 - 2
.ci/meta_builds.sh

@@ -27,7 +27,7 @@ function run_gcc() {
    echo
    echo "Build for ASAN..."
 
-   make -j$MAKE_JOBS CFLAGS="-fsanitize=address -fno-omit-frame-pointer -static-libasan $2 $CFLAGS $4" EXTRALIBS="-lasan $5" test LTC_DEBUG=1 1>gcc_1.txt 2>gcc_2.txt
+   make -j$MAKE_JOBS CFLAGS="-fsanitize=address -fno-omit-frame-pointer -static-libasan $2 $CFLAGS $4" EXTRALIBS="-lasan $5" test LTC_DEBUG=1 V=1 1>gcc_1.txt 2>gcc_2.txt
 
    echo
    echo "Run ASAN tests with LTM..."
@@ -63,7 +63,7 @@ function run_clang() {
    echo
    echo "Build for UBSAN..."
 
-   make -j$MAKE_JOBS LDFLAGS="-fsanitize=undefined" CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" all LTC_DEBUG=1 1>gcc_1.txt 2>gcc_2.txt
+   make -j$MAKE_JOBS LDFLAGS="-fsanitize=undefined" CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5" all LTC_DEBUG=1 V=1 1>gcc_1.txt 2>gcc_2.txt
 
    echo "Run UBSAN tests with LTM..."
    UBSAN_OPTIONS=verbosity=1 ./test t ltm 1>test_std.txt 2> test_err.txt || exit 1
@@ -96,6 +96,13 @@ make clean &>/dev/null
 
 bash .ci/testbuild.sh "NOFILE" "-DLTC_NO_FILE" "$3" "$4" "$5"
 
+make clean &>/dev/null
+
+echo
+echo "Build full debug..."
+
+make -j$MAKE_JOBS CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$EXTRALIBS" all_test LTC_DEBUG=2 V=1 1>gcc_1.txt 2>gcc_2.txt
+
 # ref:         $Format:%D$
 # git commit:  $Format:%H$
 # commit time: $Format:%ai$

+ 1 - 1
src/pk/asn1/der/sequence/der_decode_sequence_flexi.c

@@ -96,7 +96,7 @@ int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc
          }
          data_offset = id_len + len_len;
 #if defined(LTC_TEST_DBG) && LTC_TEST_DBG > 1
-         if (l->type == LTC_ASN1_CUSTOM_TYPE && l->class == LTC_ASN1_CL_CONTEXT_SPECIFIC) {
+         if (l->type == LTC_ASN1_CUSTOM_TYPE && l->klass == LTC_ASN1_CL_CONTEXT_SPECIFIC) {
             fprintf(stderr, "OK %02lx: hl=%4lu l=%4lu - Context Specific[%s %llu]\n", identifier, data_offset, len, der_asn1_pc_to_string_map[l->pc], l->tag);
          } else {
             fprintf(stderr, "OK %02lx: hl=%4lu l=%4lu - %s\n", identifier, data_offset, len, der_asn1_tag_to_string_map[l->tag]);

+ 5 - 1
tests/der_test.c

@@ -21,6 +21,10 @@ int der_test(void)
 #include <sys/types.h>
 #include <dirent.h>
 
+#if defined(LTC_TEST_DBG) && LTC_TEST_DBG > 1
+#define LTC_DER_TESTS_PRINT_FLEXI
+#endif
+
 static const unsigned char _der_tests_stinky_root_cert[] =
    "MIIFETCCA/mgAwIBAgIQbv53JNmv518t5lkCHE272jANBgkqhkiG9w0BAQUFADCB"
    "lTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug"
@@ -387,7 +391,7 @@ static void _der_tests_print_flexi(ltc_asn1_list* l, unsigned int level)
        char* s = buf;
        int sz = sizeof(buf);
 
-       r = snprintf(s, sz, "[%s %s %llu]", der_asn1_class_to_string_map[l->class], der_asn1_pc_to_string_map[l->pc], l->tag);
+       r = snprintf(s, sz, "[%s %s %llu]", der_asn1_class_to_string_map[l->klass], der_asn1_pc_to_string_map[l->pc], l->tag);
        if (r < 0 || r >= sz) {
            fprintf(stderr, "%s boom\n", name);
            exit(EXIT_FAILURE);