From af241f4083b7c9661d7070069fc2ee108a381cda Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 21 Oct 2022 12:42:06 +0100 Subject: [PATCH] 10.91: Fix future-test so that it properly skips tests where the compiler does not support the command line option. --- annobin-global.h | 2 +- annocheck/libannocheck.h | 2 +- configure.ac | 2 +- meson.build | 2 +- tests/future-test | 92 ++++++++++++++++++++-------------------- 5 files changed, 49 insertions(+), 51 deletions(-) diff --git a/annobin-global.h b/annobin-global.h index 6ac167f..9bd82b0 100644 --- a/annobin-global.h +++ b/annobin-global.h @@ -24,7 +24,7 @@ extern "C" { NB/ Keep this value in sync with LIBANNOCHECK_VERSION defined in annocheck/libannocheck.h and with 'version' defined in meson.build, and with ANNOBIN_VERSION defined in configure.ac. */ -#define ANNOBIN_VERSION 1090 +#define ANNOBIN_VERSION 1091 /* The version of the annotation specification supported. */ #define SPEC_VERSION 3 diff --git a/annocheck/libannocheck.h b/annocheck/libannocheck.h index 0da09f0..9ad3601 100644 --- a/annocheck/libannocheck.h +++ b/annocheck/libannocheck.h @@ -23,7 +23,7 @@ extern "C" { /* NB/ Keep this value in sync with ANNOBIN_VERSION defined in annobin-global.h. */ -#define LIBANNOCHECK_VERSION 1090 +#define LIBANNOCHECK_VERSION 1091 typedef enum libannocheck_error { diff --git a/configure.ac b/configure.ac index e8d992a..6f66f62 100644 --- a/configure.ac +++ b/configure.ac @@ -7,7 +7,7 @@ AC_INIT([Binary Annotations], 10.0,,[annobin-plugin]) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_SRCDIR([annobin-global.h]) -ANNOBIN_VERSION=10.90 +ANNOBIN_VERSION=10.91 AC_SUBST(ANNOBIN_VERSION) AC_CANONICAL_SYSTEM diff --git a/meson.build b/meson.build index 8341bbf..d4127b1 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'annobin', ['c', 'cpp'], - version: '10.90', + version: '10.91', meson_version: '>=0.59' ) diff --git a/tests/future-test b/tests/future-test index 278d954..ac3205d 100755 --- a/tests/future-test +++ b/tests/future-test @@ -46,7 +46,6 @@ COMMAND="$GCC $OPTS $srcdir/atexit.c -c -ftrivial-auto-var-init=zero" A_OPTS="--skip-all --test-auto-var-init --verbose" A_COMMAND="$ANNOCHECK $A_OPTS atexit.o" - $COMMAND if [ $? != 0 ]; then @@ -75,32 +74,33 @@ else exit 1 fi -fi + # Try a different version of the option, now that we know that it works + COMMAND="$GCC $OPTS $srcdir/atexit.c -c -ftrivial-auto-var-init=pattern" -# Try a different version of the option, now that we know that it works -COMMAND="$GCC $OPTS $srcdir/atexit.c -c -ftrivial-auto-var-init=pattern" + $COMMAND + if [ $? != 0 ]; + then + echo " $TEST_NAME: FAIL: second compilation failed + echo " $TEST_NAME: compile command: $COMMAND" + end_test + exit 1 + fi -$COMMAND -if [ $? != 0 ]; -then - echo " $TEST_NAME: FAIL: second compilation failed - echo " $TEST_NAME: compile command: $COMMAND" - end_test - exit 1 + A_OPTS="--skip-all --test-future --verbose" + $A_COMMAND >> future-test.out + if [ $? == 0 ]; + then + echo " $TEST_NAME: FAIL: annocheck exit code is 0" + echo " $TEST_NAME: compile command: $COMMAND" + echo " $TEST_NAME: annocheck command: $A_COMMAND" + echo " $TEST_NAME: annocheck output" + $A_COMMAND + end_test + exit 1 + fi fi -A_OPTS="--skip-all --test-future --verbose" -$A_COMMAND >> future-test.out -if [ $? == 0 ]; -then - echo " $TEST_NAME: FAIL: annocheck exit code is 0" - echo " $TEST_NAME: compile command: $COMMAND" - echo " $TEST_NAME: annocheck command: $A_COMMAND" - echo " $TEST_NAME: annocheck output" - $A_COMMAND - end_test - exit 1 -fi +#------------------------------------------------------------------------- TEST_NAME="future__zero_call_used_regs" @@ -109,7 +109,6 @@ COMMAND="$GCC $OPTS $srcdir/atexit.c -c -fzero-call-used-regs=all" A_OPTS="--skip-all --test-call-used-regs --verbose" A_COMMAND="$ANNOCHECK $A_OPTS atexit.o" - $COMMAND if [ $? != 0 ]; then @@ -138,31 +137,30 @@ else exit 1 fi -fi - -# Try a different version of the option, now that we know that it works -COMMAND="$GCC $OPTS $srcdir/atexit.c -c -fzero-call-used-regs=skip" + # Try a different version of the option, now that we know that it works + COMMAND="$GCC $OPTS $srcdir/atexit.c -c -fzero-call-used-regs=skip" -$COMMAND -if [ $? != 0 ]; -then - echo " $TEST_NAME: FAIL: fourth compilation failed - echo " $TEST_NAME: compile command: $COMMAND" - end_test - exit 1 -fi + $COMMAND + if [ $? != 0 ]; + then + echo " $TEST_NAME: FAIL: fourth compilation failed + echo " $TEST_NAME: compile command: $COMMAND" + end_test + exit 1 + fi -A_OPTS="--skip-all --test-future --verbose" -$A_COMMAND >> future-test.out -if [ $? == 0 ]; -then - echo " $TEST_NAME: FAIL: annocheck exit code is 0" - echo " $TEST_NAME: compile command: $COMMAND" - echo " $TEST_NAME: annocheck command: $A_COMMAND" - echo " $TEST_NAME: annocheck output" - $A_COMMAND - end_test - exit 1 + A_OPTS="--skip-all --test-future --verbose" + $A_COMMAND >> future-test.out + if [ $? == 0 ]; + then + echo " $TEST_NAME: FAIL: annocheck exit code is 0" + echo " $TEST_NAME: compile command: $COMMAND" + echo " $TEST_NAME: annocheck command: $A_COMMAND" + echo " $TEST_NAME: annocheck output" + $A_COMMAND + end_test + exit 1 + fi fi end_test -- 2.43.5