From bb2413eda9a035f75bfad47c72fc0bbeed4e24b7 Mon Sep 17 00:00:00 2001 From: "Tom G. Christensen" Date: Sat, 5 Apr 2008 09:54:30 +0000 Subject: [PATCH] Add generic_check function and add new default check target to build.sh. The check target is excluded from the all target since it can often take a very long time to run. --- build.sh.functions | 2 +- build.sh.generic | 6 ++++++ buildpkg.functions | 12 ++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/build.sh.functions b/build.sh.functions index 2f9bcd1..60210e5 100644 --- a/build.sh.functions +++ b/build.sh.functions @@ -18,7 +18,7 @@ all() for METHOD in $METHODS do case $METHOD in - all*|*clean) ;; + all*|*clean|check) ;; *) $METHOD ;; esac diff --git a/build.sh.generic b/build.sh.generic index 09700ae..668464b 100644 --- a/build.sh.generic +++ b/build.sh.generic @@ -30,6 +30,12 @@ build() generic_build } +reg check +check() +{ + generic_check +} + reg install install() { diff --git a/buildpkg.functions b/buildpkg.functions index ec7bfef..c3513ed 100644 --- a/buildpkg.functions +++ b/buildpkg.functions @@ -154,6 +154,10 @@ generic_configure=1 # We default to an empty string so the default target will be built make_build_target="" +# Allow overriding the make target for running the testsuite +# We default to 'check' +make_check_target="check" + # Allow skipping the configure run no_configure=0 @@ -686,6 +690,14 @@ generic_build() fi } +# generic_check(): Run the check target +# params: $1 = dir to descend to *inside* "source" - optional +generic_check() +{ + setdir ${srcdir}/${topsrcdir}/$1 + $MAKE_PROG -k $(_upls $make_check_target) +} + # generic_build_perl(): Build a perl module from source # params: same as generic_build # This is based on code ripped out of a RPM specfile generated