# generate_test_buildinfo - Generate openssl test build.info for vxWorks
#
# Copyright (c) 2019, 2021-2022 Wind River Systems, Inc.
#      
# The right to copy, distribute, modify or otherwise make use
# of this software may be licensed only pursuant to the terms
# of an applicable Wind River license agreement.
#
#/bin/sh

. $(dirname "$0")/common

test_lib_name="libopenssltest.a"
test_proc_name="openssltest"

cat <<EOF > build.info 
IF[{- !\$disabled{tests} -}]
    LIBS{noinst,has_main}=${test_lib_name}

    $(
	for src_file in ${build_file_list}
	do
		if [ "${src_file}" = "mdc2_internal_test.c" ]; then
			echo "IF[{- !\$disabled{mdc2} -}]"
			echo "    SOURCE[${test_lib_name}]="${src_file}""
			echo "ENDIF"
		elif [ "${src_file}" = "poly1305_internal_test.c" ]; then
			echo "IF[{- !\$disabled{poly1305} -}]"
			echo "    SOURCE[${test_lib_name}]="${src_file}""
			echo "ENDIF"
		elif [ "${src_file}" = "chacha_internal_test.c" ]; then
			echo "IF[{- !\$disabled{chacha} -}]"
			echo "    SOURCE[${test_lib_name}]="${src_file}""
			echo "ENDIF"
		elif [ "${src_file}" = "siphash_internal_test.c" ]; then
			echo "IF[{- !\$disabled{siphash} -}]"
			echo "    SOURCE[${test_lib_name}]="${src_file}""
			echo "ENDIF"
		elif [ "${src_file}" = "sm2_internal_test.c" ]; then
			echo "IF[{- !\$disabled{sm2} -}]"
			echo "    SOURCE[${test_lib_name}]="${src_file}""
			echo "ENDIF"
		elif [ "${src_file}" = "sm4_internal_test.c" ]; then
			echo "IF[{- !\$disabled{sm4} -}]"
			echo "    SOURCE[${test_lib_name}]="${src_file}""
			echo "ENDIF"
		elif [ "${src_file}" = "curve448_internal_test.c" ]; then
			echo "IF[{- !\$disabled{ec} -}]"
			echo "    SOURCE[${test_lib_name}]="${src_file}""
			echo "ENDIF"
		elif [ "${src_file}" = "rmdtest.c" ]; then
			echo "IF[{- !\$disabled{rmd160} -}]"
			echo "    SOURCE[${test_lib_name}]="${src_file}""
			echo "ENDIF"
		elif [ "${src_file}" = "cmsapitest.c" ]; then
			echo "IF[{- !\$disabled{cms} -}]"
			echo "    SOURCE[${test_lib_name}]="${src_file}""
			echo "ENDIF"
		elif [ "${src_file}" = "cmp_asn_test.c" ] ||     \
		     [ "${src_file}" = "cmp_client_test.c" ] ||  \
		     [ "${src_file}" = "cmp_ctx_test.c" ] ||     \
		     [ "${src_file}" = "cmp_hdr_test.c" ] ||     \
		     [ "${src_file}" = "cmp_msg_test.c" ] ||     \
		     [ "${src_file}" = "cmp_protect_test.c" ] || \
		     [ "${src_file}" = "cmp_server_test.c" ] ||  \
		     [ "${src_file}" = "cmp_status_test.c" ] ||  \
		     [ "${src_file}" = "cmp_vfy_test.c" ] ||     \
		     [ "${src_file}" = "helpers/cmp_testlib.c" ]; then
			echo "IF[{- !\$disabled{cmp} -}]"
			echo "    SOURCE[${test_lib_name}]="${src_file}""
			echo "ENDIF"
		else
			echo "SOURCE[${test_lib_name}]="${src_file}""
		fi
	done
    )

	INCLUDE[${test_lib_name}]=.. ../include ../include/internal ../apps/include ../crypto/include ../crypto/ec ../crypto/ec/curve448/ ../crypto/bn ../crypto/rsa
	DEPEND[${test_lib_name}]=../libcrypto ../libssl
ENDIF
EOF


