automatically disable szmul builtin when testing with coverage default tip

Sat, 23 Nov 2024 15:15:09 +0100

author
Mike Becker <universe@uap-core.de>
date
Sat, 23 Nov 2024 15:15:09 +0100
changeset 990
f708863e7ec6
parent 989
8aa57a7fecc4

automatically disable szmul builtin when testing with coverage

configure file | annotate | diff | comparison | revisions
make/project.xml file | annotate | diff | comparison | revisions
--- a/configure	Sat Nov 23 14:45:32 2024 +0100
+++ b/configure	Sat Nov 23 15:15:09 2024 +0100
@@ -478,6 +478,26 @@
     dep_checked_doxygen=1
     return 0
 }
+dependency_error_no_coverage()
+{
+    print_check_msg "$dep_checked_no_coverage" "checking for no_coverage... "
+    # dependency no_coverage
+    while true
+    do
+        if test -z "$FEATURE_COVERAGE" > /dev/null ; then
+            :
+        else
+            break
+        fi
+        print_check_msg "$dep_checked_no_coverage" "yes\n"
+        dep_checked_no_coverage=1
+        return 1
+    done
+
+    print_check_msg "$dep_checked_no_coverage" "no\n"
+    dep_checked_no_coverage=1
+    return 0
+}
 
 # start collecting dependency information
 echo > "$TEMP_DIR/flags.mk"
@@ -662,6 +682,16 @@
     :
 fi
 if [ -n "$FEATURE_SZMUL_BUILTIN" ]; then
+    # check dependency
+    if dependency_error_no_coverage ; then
+        # "auto" features can fail and are just disabled in this case
+        if [ "$FEATURE_SZMUL_BUILTIN" = "auto" ]; then
+            DISABLE_FEATURE_SZMUL_BUILTIN=1
+        else
+            DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED no_coverage "
+            ERROR=1
+        fi
+    fi
     if [ -n "$DISABLE_FEATURE_SZMUL_BUILTIN" ]; then
         unset FEATURE_SZMUL_BUILTIN
     fi
--- a/make/project.xml	Sat Nov 23 14:45:32 2024 +0100
+++ b/make/project.xml	Sat Nov 23 15:15:09 2024 +0100
@@ -85,6 +85,10 @@
         <ldflags>\${COVERAGE_LDFLAGS}</ldflags>
     </dependency>
 
+    <dependency name="no_coverage">
+        <test>test -z "$FEATURE_COVERAGE"</test>
+    </dependency>
+
     <target>
         <option arg="with-docs">
             <value str="all">
@@ -127,6 +131,7 @@
             </make>
         </feature>
         <feature name="szmul-builtin" default="true">
+            <dependencies>no_coverage</dependencies>
             <desc>use custom implementation, instead</desc>
             <disabled>
                 <define name="CX_NO_SZMUL_BUILTIN"/>

mercurial