public inbox for debugedit@sourceware.org
 help / color / mirror / Atom feed
* [COMMITTED] tests: Check gcc accepts -gdwarf-5 otherwise skip DWARF5 tests
@ 2021-03-24 23:29 Mark Wielaard
  0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2021-03-24 23:29 UTC (permalink / raw)
  To: debugedit; +Cc: Mark Wielaard

Add a configure check for -gdawrf-5. Set GDWARF_5_FLAG in atlocal.in
to yes or no. Use AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"]) in
debugedit.at.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 configure.ac       | 10 ++++++++++
 tests/atlocal.in   |  2 +-
 tests/debugedit.at |  6 ++++++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 09cc82e..b4bd749 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,6 +73,16 @@ AC_FUNC_MMAP
 AC_FUNC_REALLOC
 AC_CHECK_FUNCS([memchr memset munmap strchr strdup strerror strrchr])
 
+# Checks for compiler flags.
+AC_CACHE_CHECK([whether gcc supports -gdwarf-5], ac_cv_gdwarf_5, [dnl
+save_CFLAGS="$CFLAGS"
+CFLAGS="-gdwarf-5"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE()], ac_cv_gdwarf_5=yes, ac_cv_gdwarf_5=no)
+CFLAGS="$save_CFLAGS"
+])
+GDWARF_5_FLAG=$ac_cv_gdwarf_5
+AC_SUBST([GDWARF_5_FLAG])
+
 # And generate the output files.
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
diff --git a/tests/atlocal.in b/tests/atlocal.in
index 4b7303b..1324898 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -2,4 +2,4 @@
 # Configurable variable values for test suite.
 
 PATH=@abs_builddir@:@abs_top_builddir@:$top_srcdir:$srcdir:$PATH
-
+GDWARF_5_FLAG=@GDWARF_5_FLAG@
diff --git a/tests/debugedit.at b/tests/debugedit.at
index 2d1870b..9e6606a 100644
--- a/tests/debugedit.at
+++ b/tests/debugedit.at
@@ -120,6 +120,7 @@ AT_CLEANUP
 # ===
 AT_SETUP([debugedit .debug_str/line_str objects DWARF5])
 AT_KEYWORDS([debuginfo] [debugedit])
+AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
 RPM_DEBUGEDIT_SETUP([-gdwarf-5])
 
 # Capture strings that start with the testdir (pwd) directory path
@@ -184,6 +185,7 @@ AT_CLEANUP
 # ===
 AT_SETUP([debugedit .debug_str/line_str partial DWARF5])
 AT_KEYWORDS([debuginfo] [debugedit])
+AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
 RPM_DEBUGEDIT_SETUP([-gdwarf-5])
 
 # Capture strings that start with the testdir (pwd) directory path
@@ -245,6 +247,7 @@ AT_CLEANUP
 # ===
 AT_SETUP([debugedit .debug_str/line_str exe DWARF5])
 AT_KEYWORDS([debuginfo] [debugedit])
+AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
 RPM_DEBUGEDIT_SETUP([-gdwarf-5])
 
 # Capture strings that start with the testdir (pwd) directory path
@@ -484,6 +487,7 @@ AT_CLEANUP
 # ===
 AT_SETUP([debugedit .debug_line objects DWARF5])
 AT_KEYWORDS([debuginfo] [debugedit])
+AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
 RPM_DEBUGEDIT_SETUP([-gdwarf-5])
 
 AT_DATA([expout],
@@ -530,6 +534,7 @@ AT_CLEANUP
 # ===
 AT_SETUP([debugedit .debug_line partial DWARF5])
 AT_KEYWORDS([debuginfo] [debugedit])
+AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
 RPM_DEBUGEDIT_SETUP([-gdwarf-5])
 
 AT_DATA([expout],
@@ -574,6 +579,7 @@ AT_CLEANUP
 # ===
 AT_SETUP([debugedit .debug_line exe DWARF5])
 AT_KEYWORDS([debuginfo] [debugedit])
+AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
 RPM_DEBUGEDIT_SETUP([-gdwarf-5])
 
 AT_DATA([expout],
-- 
2.20.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-24 23:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-24 23:29 [COMMITTED] tests: Check gcc accepts -gdwarf-5 otherwise skip DWARF5 tests Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).