[MERGED] libosmocore[master]: build: make check: disable sim_test when built with --disabl...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Nov 16 16:40:44 UTC 2016


Harald Welte has submitted this change and it was merged.

Change subject: build: make check: disable sim_test when built with --disable-pcsc
......................................................................


build: make check: disable sim_test when built with --disable-pcsc

Numerous issues caused sim_test to be attempted even though libosmosim was not
built:

In configure.ac, the ENABLE_PCSC variable lacked an AC_SUBST() to be exported.

Furthermore in configure.ac, no value 'yes'/'no' was assigned to the
ENABLE_PCSC variable, only to the enable_pcsc value.

In testsuite.at, encapsulating the sim_test in 'if ENABLE_PCSC' seems to have
no effect, regardless (not even when using a variable that should be defined
accurately).

So fix with these steps, similarly to how we do it in openbsc:

In AC_ARG_ENABLE, directly use 'ENABLE_PCSC' to assign 'yes'/'no'.
Export the same using AC_SUBST().
Add tests/atlocal.in to translate ENABLE_PCSC to enable_sim_test (also add
atlocal to AC_OUTPUT and distclean).
Use enable_sim_test in testuite.at, as seen in openbsc: use AT_CHECK() to
indicate skipping the test if enable_sim_test isn't 'yes'.

Change-Id: I9e8740c7d2dfbd272e22fee85972ef3fda7184a8
---
M configure.ac
M tests/Makefile.am
A tests/atlocal.in
M tests/testsuite.at
4 files changed, 14 insertions(+), 6 deletions(-)

Approvals:
  Max: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/configure.ac b/configure.ac
index ea68839..ec03c26 100644
--- a/configure.ac
+++ b/configure.ac
@@ -104,15 +104,16 @@
 
 AC_ARG_ENABLE([pcsc], [AS_HELP_STRING([--disable-pcsc], [Build without PC/SC support])],
     [
-        enable_pcsc=$enableval
+        ENABLE_PCSC=$enableval
     ],
     [
-        enable_pcsc="yes"
+        ENABLE_PCSC="yes"
     ])
-AS_IF([test "x$enable_pcsc" = "xyes"], [
+AS_IF([test "x$ENABLE_PCSC" = "xyes"], [
 	PKG_CHECK_MODULES(PCSC, libpcsclite)
 ])
-AM_CONDITIONAL(ENABLE_PCSC, test "x$enable_pcsc" = "xyes")
+AM_CONDITIONAL(ENABLE_PCSC, test "x$ENABLE_PCSC" = "xyes")
+AC_SUBST(ENABLE_PCSC)
 
 AC_ARG_ENABLE(plugin,
 	[AS_HELP_STRING(
@@ -231,6 +232,7 @@
 	src/gb/Makefile
 	src/ctrl/Makefile
 	tests/Makefile
+	tests/atlocal
 	utils/Makefile
 	Doxyfile.core
 	Doxyfile.gsm
diff --git a/tests/Makefile.am b/tests/Makefile.am
index ae5735a..f5d095d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -13,10 +13,14 @@
 		 vty/vty_test comp128/comp128_test utils/utils_test	\
 		 smscb/gsm0341_test stats/stats_test			\
 		 bitvec/bitvec_test msgb/msgb_test bits/bitcomp_test	\
-		 sim/sim_test tlv/tlv_test gsup/gsup_test fsm/fsm_test
+		 tlv/tlv_test gsup/gsup_test fsm/fsm_test
 
 if ENABLE_MSGFILE
 check_PROGRAMS += msgfile/msgfile_test
+endif
+
+if ENABLE_PCSC
+check_PROGRAMS += sim/sim_test
 endif
 
 utils_utils_test_SOURCES = utils/utils_test.c
@@ -166,7 +170,7 @@
 	     sim/sim_test.ok tlv/tlv_test.ok gsup/gsup_test.ok		\
 	     fsm/fsm_test.ok fsm/fsm_test.err
 
-DISTCLEANFILES = atconfig
+DISTCLEANFILES = atconfig atlocal
 
 TESTSUITE = $(srcdir)/testsuite
 
diff --git a/tests/atlocal.in b/tests/atlocal.in
new file mode 100644
index 0000000..cd27532
--- /dev/null
+++ b/tests/atlocal.in
@@ -0,0 +1 @@
+enable_sim_test='@ENABLE_PCSC@'
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 2f274f9..77038bc 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -186,6 +186,7 @@
 
 AT_SETUP([sim])
 AT_KEYWORDS([sim])
+AT_CHECK([test "x$enable_sim_test" = xyes || exit 77])
 cat $abs_srcdir/sim/sim_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/sim/sim_test], [0], [expout], [ignore])
 AT_CLEANUP

-- 
To view, visit https://gerrit.osmocom.org/1251
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9e8740c7d2dfbd272e22fee85972ef3fda7184a8
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list