On Fri, Oct 17, 2008 at 06:36:52PM +0000, Adam Litke wrote: > In run_tests.sh, the function check_linkhuge_tests() checks if it is safe to > run the legacy linkhuge tests by examining the default linker script. But > when > binaries are compiled with a different word size, they use a different linker > script. Therefore, we must make a separate decision for each word size > whether > to run the linkhuge tests. > > Splitting up test skipping by wordsize means we need a new skip_test_bits > function. The reporting of skipped tests has now changed. Rather than > reporting a SKIP that applies to all word sizes of a given test. A SKIP for > each word size is printed. > > Signed-off-by: Adam Litke <[EMAIL PROTECTED]> > --- > > tests/run_tests.sh | 38 ++++++++++++++++++++++++++------------ > 1 files changed, 26 insertions(+), 12 deletions(-) > > > diff --git a/tests/run_tests.sh b/tests/run_tests.sh > index 4fe6eed..dc2370f 100755 > --- a/tests/run_tests.sh > +++ b/tests/run_tests.sh > @@ -81,10 +81,15 @@ function check_linkhuge_tests() { > # system linker scripts use the SPECIAL keyword (for placing the got and > # plt). Our linker scripts do not use SPECIAL and are thus broken when > the > # system scripts use it. > - ld --verbose | grep -q SPECIAL > - if [ $? -eq 0 ]; then > - LINKHUGE_SKIP=1 > - fi > + LINKHUGE_WORDSIZES="" > + for bits in $WORDSIZES; do > + gcc -m$bits -Wl,--verbose 2> /dev/null | grep -q SPECIAL > + if [ $? -eq 0 ]; then > + bits="no$bits" > + fi > + LINKHUGE_WORDSIZES="$LINKHUGE_WORDSIZES $bits" > + done > +echo "LINKHUGE_WORDSIZES = $LINKHUGE_WORDSIZES"
So we end up with '32 no64' style contents. A little comment would be nice to make that obvious. > } > > run_test_bits () { > @@ -117,22 +122,31 @@ run_test () { > done > } > > +skip_test_bits () { > + bits=$1 > + shift > + > + echo "$@ ($bits): SKIPPED" > + tot_tests[$bits]=$[tot_tests[$bits] + 1] > + tot_skip[$bits]=$[tot_skip[$bits] + 1] > +} > + > # To manually disable a test (e.g., one that panics an older kernel), > # replace "run_test <options>" with "skip_test <options>". > skip_test () { > - echo "$@: SKIPPED" > for bits in $WORDSIZES; do > - tot_tests[$bits]=$[tot_tests[$bits] + 1] > - tot_skip[$bits]=$[tot_skip[$bits] + 1] > + skip_test_bits $bits "$@" > done > } > > maybe_run_linkhuge_test () { > - if [ "$LINKHUGE_SKIP" != "1" ]; then > - run_test "$@" > - else > - skip_test "$@" > - fi > + for bits in $LINKHUGE_WORDSIZES; do This might be a little more obvious: case "$bits" in no*) skip_test_bits ${bits#no} "$@" ;; *) run_test_bits $bits "$@" ;; esac > + if [ "$bits" == "${bits#no}" ]; then If you keep the if form, I think that == should be = in a [], else its using non-standard extensions. > + run_test_bits $bits "$@" > + else > + skip_test_bits ${bits#no} "$@" > + fi > + done > } > > preload_test () { -apw ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Libhugetlbfs-devel mailing list Libhugetlbfs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel