Exclude the CUnit tests themselves from lcov
This commit is contained in:
@@ -51,10 +51,10 @@
|
||||
#define BITMASK_ARRAY_SIZE 2 /*!< Number of 32bits integer used to handle bitmask in the fko_var_bitmask_t structure */
|
||||
#define LF_CHAR 0x0A /*!< Hexadecimal value associated to the LF char */
|
||||
|
||||
#ifdef HAVE_C_UNIT_TESTS
|
||||
#ifdef HAVE_C_UNIT_TESTS /* LCOV_EXCL_START */
|
||||
#include "cunit_common.h"
|
||||
DECLARE_TEST_SUITE(config_init, "Config init test suite");
|
||||
#endif
|
||||
#endif /* LCOV_EXCL_STOP */
|
||||
|
||||
/**
|
||||
* Structure to handle long bitmask.
|
||||
@@ -2676,7 +2676,7 @@ usage(void)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HAVE_C_UNIT_TESTS
|
||||
#ifdef HAVE_C_UNIT_TESTS /* LCOV_EXCL_START */
|
||||
|
||||
DECLARE_TEST_SUITE_INIT(config_init)
|
||||
{
|
||||
@@ -2734,4 +2734,4 @@ int register_ts_config_init(void)
|
||||
return register_ts(&TEST_SUITE(config_init));
|
||||
}
|
||||
|
||||
#endif /* HAVE_C_UNIT_TESTS */
|
||||
#endif /* HAVE_C_UNIT_TESTS */ /* LCOV_EXCL_STOP */
|
||||
|
||||
+4
-4
@@ -49,10 +49,10 @@
|
||||
|
||||
#define NULL_STRING "<NULL>" /*!< String which represents a NULL buffer */
|
||||
|
||||
#ifdef HAVE_C_UNIT_TESTS
|
||||
#ifdef HAVE_C_UNIT_TESTS /* LCOV_EXCL_START */
|
||||
#include "cunit_common.h"
|
||||
DECLARE_TEST_SUITE(utils_test, "Utility functions test suite");
|
||||
#endif
|
||||
#endif /* LCOV_EXCL_STOP */
|
||||
|
||||
/**
|
||||
* Structure to handle an encryption mode string string and its associated integer value
|
||||
@@ -1085,7 +1085,7 @@ count_characters(const char *str, const char match, int len)
|
||||
return count;
|
||||
}
|
||||
|
||||
#ifdef HAVE_C_UNIT_TESTS
|
||||
#ifdef HAVE_C_UNIT_TESTS /* LCOV_EXCL_START */
|
||||
|
||||
DECLARE_UTEST(test_count_characters, "test the count_characters function")
|
||||
{
|
||||
@@ -1109,5 +1109,5 @@ int register_utils_test(void)
|
||||
|
||||
return register_ts(&TEST_SUITE(utils_test));
|
||||
}
|
||||
#endif
|
||||
#endif /* LCOV_EXCL_STOP */
|
||||
/***EOF***/
|
||||
|
||||
+4
-4
@@ -51,10 +51,10 @@ static unsigned char map2[] =
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_C_UNIT_TESTS
|
||||
#ifdef HAVE_C_UNIT_TESTS /* LCOV_EXCL_START */
|
||||
#include "cunit_common.h"
|
||||
DECLARE_TEST_SUITE(base64_test, "Utility functions test suite");
|
||||
#endif
|
||||
#endif /* LCOV_EXCL_STOP */
|
||||
|
||||
int
|
||||
b64_decode(const char *in, unsigned char *out)
|
||||
@@ -140,7 +140,7 @@ strip_b64_eq(char *data)
|
||||
*ndx = '\0';
|
||||
}
|
||||
|
||||
#ifdef HAVE_C_UNIT_TESTS
|
||||
#ifdef HAVE_C_UNIT_TESTS /* LCOV_EXCL_START */
|
||||
DECLARE_UTEST(test_base64_encode, "test base64 encoding functions")
|
||||
{
|
||||
char test_str[32] = {0};
|
||||
@@ -248,5 +248,5 @@ int register_base64_test(void)
|
||||
|
||||
return register_ts(&TEST_SUITE(base64_test));
|
||||
}
|
||||
#endif
|
||||
#endif /* LCOV_EXCL_STOP */
|
||||
/***EOF***/
|
||||
|
||||
+4
-4
@@ -48,9 +48,9 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_C_UNIT_TESTS
|
||||
#ifdef HAVE_C_UNIT_TESTS /* LCOV_EXCL_START */
|
||||
DECLARE_TEST_SUITE(digest_test, "Cipher functions test suite");
|
||||
#endif
|
||||
#endif /* LCOV_EXCL_STOP */
|
||||
|
||||
/* Get random data.
|
||||
*/
|
||||
@@ -417,7 +417,7 @@ add_gpg_prefix(fko_ctx_t ctx)
|
||||
return(FKO_SUCCESS);
|
||||
}
|
||||
|
||||
#ifdef HAVE_C_UNIT_TESTS
|
||||
#ifdef HAVE_C_UNIT_TESTS /* LCOV_EXCL_START */
|
||||
|
||||
|
||||
|
||||
@@ -659,5 +659,5 @@ int register_ts_aes_test(void)
|
||||
|
||||
return register_ts(&TEST_SUITE(digest_test));
|
||||
}
|
||||
#endif
|
||||
#endif /* LCOV_EXCL_STOP */
|
||||
/***EOF***/
|
||||
|
||||
+4
-4
@@ -29,9 +29,9 @@
|
||||
#include "fko_common.h"
|
||||
#include "digest.h"
|
||||
#include "base64.h"
|
||||
#ifdef HAVE_C_UNIT_TESTS
|
||||
#ifdef HAVE_C_UNIT_TESTS /* LCOV_EXCL_START */
|
||||
DECLARE_TEST_SUITE(digest_test, "digest functions test suite");
|
||||
#endif
|
||||
#endif /* LCOV_EXCL_STOP */
|
||||
/* Compute MD5 hash on in and store result in out.
|
||||
*/
|
||||
void
|
||||
@@ -192,7 +192,7 @@ sha3_512_base64(char *out, unsigned char *in, size_t size)
|
||||
|
||||
}
|
||||
|
||||
#ifdef HAVE_C_UNIT_TESTS
|
||||
#ifdef HAVE_C_UNIT_TESTS /* LCOV_EXCL_START */
|
||||
|
||||
DECLARE_UTEST(test_md5, "md5 test vectors") //https://tools.ietf.org/html/rfc1321.html
|
||||
{
|
||||
@@ -575,5 +575,5 @@ int register_ts_digest_test(void)
|
||||
return register_ts(&TEST_SUITE(digest_test));
|
||||
}
|
||||
|
||||
#endif /* HAVE_C_UNIT_TESTS */
|
||||
#endif /* HAVE_C_UNIT_TESTS */ /* LCOV_EXCL_STOP */
|
||||
/***EOF***/
|
||||
|
||||
+4
-5
@@ -38,9 +38,9 @@
|
||||
/* Char used to separate SPA fields in an SPA packet */
|
||||
#define SPA_FIELD_SEPARATOR ":"
|
||||
|
||||
#ifdef HAVE_C_UNIT_TESTS
|
||||
#ifdef HAVE_C_UNIT_TESTS /* LCOV_EXCL_START */
|
||||
DECLARE_TEST_SUITE(fko_decode, "FKO decode test suite");
|
||||
#endif
|
||||
#endif /* LCOV_EXCL_STOP */
|
||||
|
||||
static int
|
||||
num_fields(char *str)
|
||||
@@ -590,7 +590,7 @@ fko_decode_spa_data(fko_ctx_t ctx)
|
||||
return(FKO_SUCCESS);
|
||||
}
|
||||
|
||||
#ifdef HAVE_C_UNIT_TESTS
|
||||
#ifdef HAVE_C_UNIT_TESTS /* LCOV_EXCL_START */
|
||||
|
||||
DECLARE_UTEST(num_fields, "Count the number of SPA fields in a SPA packet")
|
||||
{
|
||||
@@ -649,6 +649,5 @@ int register_ts_fko_decode(void)
|
||||
return register_ts(&TEST_SUITE(fko_decode));
|
||||
}
|
||||
|
||||
#endif /* HAVE_C_UNIT_TESTS */
|
||||
|
||||
#endif /* HAVE_C_UNIT_TESTS */ /* LCOV_EXCL_STOP */
|
||||
/***EOF***/
|
||||
|
||||
+4
-4
@@ -29,9 +29,9 @@
|
||||
*/
|
||||
|
||||
#include "hmac.h"
|
||||
#ifdef HAVE_C_UNIT_TESTS
|
||||
#ifdef HAVE_C_UNIT_TESTS /* LCOV_EXCL_START */
|
||||
DECLARE_TEST_SUITE(hmac_test, "hmac functions test suite");
|
||||
#endif
|
||||
#endif /* LCOV_EXCL_STOP */
|
||||
|
||||
/**
|
||||
* /brief populate the inner and outer pads
|
||||
@@ -383,7 +383,7 @@ hmac_sha3_512(const char *msg, const unsigned int msg_len,
|
||||
return FKO_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef HAVE_C_UNIT_TESTS
|
||||
#ifdef HAVE_C_UNIT_TESTS /* LCOV_EXCL_START */
|
||||
|
||||
DECLARE_UTEST(test_hmac_md5, "hmac_md5 test vectors") // https://tools.ietf.org/html/rfc2202
|
||||
{
|
||||
@@ -1474,4 +1474,4 @@ int register_ts_hmac_test(void)
|
||||
return register_ts(&TEST_SUITE(hmac_test));
|
||||
}
|
||||
|
||||
#endif /* HAVE_C_UNIT_TESTS */
|
||||
#endif /* HAVE_C_UNIT_TESTS */ /* LCOV_EXCL_STOP */
|
||||
|
||||
+4
-5
@@ -48,10 +48,10 @@
|
||||
#define SUCCESS 1
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_C_UNIT_TESTS
|
||||
#ifdef HAVE_C_UNIT_TESTS /* LCOV_EXCL_START */
|
||||
#include "cunit_common.h"
|
||||
DECLARE_TEST_SUITE(access, "Access test suite");
|
||||
#endif
|
||||
#endif /* LCOV_EXCL_STOP */
|
||||
|
||||
/**
|
||||
* \brief include keys file
|
||||
@@ -2482,7 +2482,7 @@ include_keys_file(acc_stanza_t *curr_acc, const char *access_filename, fko_srv_o
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef HAVE_C_UNIT_TESTS
|
||||
#ifdef HAVE_C_UNIT_TESTS /* LCOV_EXCL_START */
|
||||
|
||||
DECLARE_UTEST(compare_port_list, "check compare_port_list function")
|
||||
{
|
||||
@@ -2511,6 +2511,5 @@ int register_ts_access(void)
|
||||
|
||||
return register_ts(&TEST_SUITE(access));
|
||||
}
|
||||
#endif /* HAVE_C_UNIT_TESTS */
|
||||
|
||||
#endif /* HAVE_C_UNIT_TESTS */ /* LCOV_EXCL_STOP */
|
||||
/***EOF***/
|
||||
|
||||
@@ -7,7 +7,9 @@ cd ..
|
||||
lcov $LCOV_RC_BC --no-checksum --capture --directory . --output-file $LCOV_INFO
|
||||
lcov $LCOV_RC_BC --no-checksum -a $LCOV_BASE -a $LCOV_INFO --output-file $LCOV_INFO_TMP
|
||||
lcov $LCOV_RC_BC --no-checksum -r $LCOV_INFO_TMP /usr/include/\* --output-file $LCOV_INFO_TMP2
|
||||
lcov $LCOV_RC_BC --no-checksum -r $LCOV_INFO_TMP2 test/fko-wrapper/\* --output-file $LCOV_INFO_FINAL
|
||||
lcov $LCOV_RC_BC --no-checksum -r $LCOV_INFO_TMP2 \*cunit\* --output-file $LCOV_INFO_TMP3
|
||||
lcov $LCOV_RC_BC --no-checksum -r $LCOV_INFO_TMP3 \*utests\* --output-file $LCOV_INFO_TMP4
|
||||
lcov $LCOV_RC_BC --no-checksum -r $LCOV_INFO_TMP4 test/fko-wrapper/\* --output-file $LCOV_INFO_FINAL
|
||||
genhtml $GENHTML_USE_BC --output-directory $LCOV_RESULTS_DIR --branch-coverage $LCOV_INFO_FINAL
|
||||
|
||||
cd $TOP_DIR
|
||||
|
||||
@@ -3,6 +3,8 @@ LCOV_BASE="$TOP_DIR/lcov_coverage.base"
|
||||
LCOV_INFO="$TOP_DIR/lcov_coverage.info"
|
||||
LCOV_INFO_TMP="$TOP_DIR/lcov_coverage.info_tmp"
|
||||
LCOV_INFO_TMP2="$TOP_DIR/lcov_coverage.info_tmp2"
|
||||
LCOV_INFO_TMP3="$TOP_DIR/lcov_coverage.info_tmp3"
|
||||
LCOV_INFO_TMP4="$TOP_DIR/lcov_coverage.info_tmp4"
|
||||
LCOV_INFO_FINAL="$TOP_DIR/lcov_coverage_final.info"
|
||||
LCOV_RESULTS_DIR="$TOP_DIR/lcov-results"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user