summaryrefslogtreecommitdiffstats
path: root/tests/Makefile.am
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 21:41:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 21:41:43 +0000
commit92cccad89d1c12b39165d5f0ed7ccd2d44965a1a (patch)
treef59a2764cd8c50959050a428bd8fc935138df750 /tests/Makefile.am
parentInitial commit. (diff)
downloadlibtpms-8385d72d414b65e621e941ea8ee9872105198dd6.tar.xz
libtpms-8385d72d414b65e621e941ea8ee9872105198dd6.zip
Adding upstream version 0.9.2.upstream/0.9.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/Makefile.am')
-rw-r--r--tests/Makefile.am92
1 files changed, 92 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..eb23c59
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,92 @@
+#
+# tests/Makefile.am
+#
+# For the license, see the LICENSE file in the root directory.
+#
+
+TESTS_ENVIRONMENT = \
+ abs_top_testdir=`cd '$(top_srcdir)'/tests; pwd` \
+ abs_top_builddir=`cd '$(top_builddir)'; pwd` \
+ abs_top_srcdir=`cd '$(top_srcdir)'; pwd`
+
+AM_CFLAGS = -I$(top_srcdir)/include $(SANITIZERS)
+AM_LDFLAGS = -ltpms -L$(top_builddir)/src/.libs $(SANITIZERS)
+
+check_PROGRAMS = \
+ base64decode
+
+TESTS = \
+ base64decode.sh
+
+if WITH_TPM2
+check_PROGRAMS += \
+ nvram_offsets \
+ tpm2_createprimary \
+ tpm2_pcr_read \
+ tpm2_selftest
+
+TESTS += \
+ fuzz.sh \
+ nvram_offsets \
+ tpm2_createprimary.sh \
+ tpm2_pcr_read.sh \
+ tpm2_selftest.sh
+endif
+
+nvram_offsets_SOURCES = nvram_offsets.c
+nvram_offsets_CFLAGS = $(AM_CFLAGS) \
+ -I$(top_srcdir)/include/libtpms \
+ -I$(top_srcdir)/src \
+ -I$(top_srcdir)/src/tpm2 \
+ -I$(top_srcdir)/src/tpm2/crypto \
+ -I$(top_srcdir)/src/tpm2/crypto/openssl \
+ -DTPM_POSIX
+nvram_offsets_LDFLAGS = $(AM_LDFLAGS)
+
+if WITH_TPM2
+check_PROGRAMS += fuzz
+endif
+fuzz_SOURCES = fuzz.cc
+fuzz_CXXFLAGS = $(FUZZER) $(AM_CFLAGS)
+fuzz_LDFLAGS = $(FUZZER) $(LIB_FUZZING_ENGINE) $(AM_LDFLAGS)
+if !WITH_FUZZER
+if !WITH_FUZZING_ENGINE
+fuzz_SOURCES += fuzz-main.c
+endif
+endif
+
+if LIBTPMS_USE_FREEBL
+
+check_PROGRAMS += freebl_sha1flattensize
+TESTS += freebl_sha1flattensize
+
+endif
+
+freebl_sha1flattensize_SOURCES = \
+ freebl_sha1flattensize.c
+freebl_sha1flattensize_CFLAGS = \
+ $(shell nss-config --cflags) \
+ $(shell nspr-config --cflags) \
+ -Wall -Werror
+freebl_sha1flattensize_LDFLAGS = \
+ -lfreebl \
+ $(shell nspr-config --libs) \
+ $(shell nss-config --libs)
+
+EXTRA_DIST = \
+ freebl_sha1flattensize.c \
+ base64decode.c \
+ base64decode.sh \
+ common \
+ tpm2_createprimary.c \
+ tpm2_createprimary.sh \
+ tpm2_pcr_read.c \
+ tpm2_pcr_read.sh \
+ tpm2_selftest.c \
+ tpm2_selftest.sh \
+ fuzz.sh
+
+CLEANFILES = \
+ *.gcov \
+ *.gcda \
+ *.gcno