[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#833430: creduce doesn't pass the files to reduce to the test script



Package: creduce
Version: 2.5.0-1
Severity: serious
Tags: sid stretch

creduce doesn't pass the files to reduce to the test script. This used to work ...

$ creduce --debug ./cr2.sh foo.c
successfully checked prereqs for pass_include_includes
successfully checked prereqs for pass_includes
successfully checked prereqs for pass_unifdef
successfully checked prereqs for pass_comments
successfully checked prereqs for pass_blank
successfully checked prereqs for pass_clang_binsrch
successfully checked prereqs for pass_lines
successfully checked prereqs for pass_special
successfully checked prereqs for pass_ternary
successfully checked prereqs for pass_balanced
successfully checked prereqs for pass_clang
successfully checked prereqs for pass_peep
successfully checked prereqs for pass_ints
successfully checked prereqs for pass_indent
successfully checked prereqs for pass_clex

sanity check... tmpdir = /tmp/creduce-eButm5
usage: /home/packages/tmp/cr2.sh <file.c>

C-Reduce cannot run because the interestingness test does not return
zero. Please ensure that it does so not only in the directory where
you are invoking C-Reduce, but also in an arbitrary temporary
directory containing only the files that are being reduced. In other
words, running these commands:

  DIR=`mktemp -d`
  cp /home/packages/tmp/foo.c $DIR
  cd $DIR
  /home/packages/tmp/cr2.sh
  echo $?

should result in "0" being echoed to the terminal.

See "creduce --help" for more information.


$ cat cr2.sh
#! /bin/sh

if [ $# -ne 1 ]; then
  echo "usage: $0 <file.c>" 1>&2
  exit 1
fi

export LANG=C

CLANG=${CLANG:-clang}
GCC=${GCC:-gcc}
ARGS="-c -Wall"
msg="warning: unused variable 'j' [-Wunused-variable]"

$GCC $ARGS $1 > out.txt 2>&1
if fgrep -q ": error:" out.txt; then
  exit 1
fi
if fgrep -q "$msg" out.txt; then
  if fgrep -v "$msg" out.txt | fgrep ": warning:"; then
    exit 1
  fi
  exit 0
fi
exit 1

$ cat foo.c
int main()
{
        int i = 1, j;

        return i;
}


Reply to: