mctest 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #!/bin/sh
  2. # This is the testsuite for GNU Midnight Commander.
  3. # Maintainer doing the release must ensure that this testsuite passes.
  4. set -e
  5. trap 'echo >&2 "ERROR: Test not completed, exit with code $?"; exit 1' exit
  6. distcheck() {
  7. id="$1"
  8. shift
  9. make distcheck "$MAKEFLAGS" "$@" >test-$id.out 2>test-$id.err
  10. }
  11. # Specify which warnings we want to see.
  12. # Don't add options that produce massive warnings.
  13. # Add -Wstrict-prototypes after main.h is fixed (always use cpanel).
  14. # Maybe add -W if a better way to initialize quick dialogs is found.
  15. export CFLAGS="-O2 -Wall -Wno-unused-parameter -Wno-sign-compare \
  16. -Wmissing-declarations -Wmissing-prototypes -Wbad-function-cast \
  17. -Wcast-align -Wpointer-arith -Wredundant-decls -Wundef -Wfloat-equal"
  18. # Suppress progress indicator
  19. MAKEFLAGS='MSGMERGE_FLAGS=--no-location --quiet'
  20. echo "Checking the documentation"
  21. maint/doctest
  22. echo "Bootstraping from CVS"
  23. ./autogen.sh >test-autogen.out 2>test-autogen.err
  24. echo "Checking configure"
  25. bash -n configure 2>test-configure.err
  26. echo "Making everything in the source directory"
  27. make all >test0.out 2>test0.err
  28. echo "Checking the default configuration"
  29. distcheck 1
  30. echo "Checking the configuration with maximal code coverage"
  31. distcheck 2 enable_charset=yes with_samba=yes \
  32. with_included_gettext=yes
  33. echo "Checking the configuration with minimal code coverage"
  34. distcheck 3 enable_largefile=no enable_nls=no with_vfs=no \
  35. with_gpm_mouse=no with_subshell=no with_edit=no with_ext2undel=no \
  36. with_screen=ncurses with_x=no enable_background=no
  37. echo "Checking the configuration with minimal code coverage + editor"
  38. distcheck 4 enable_largefile=no enable_nls=no with_vfs=no \
  39. with_gpm_mouse=no with_subshell=no with_ext2undel=no \
  40. with_screen=ncurses
  41. echo "Checking the configuration with experimental and rarely used options"
  42. distcheck 5 with_mmap=no with_subshell=optional
  43. RPMBUILD=/usr/bin/rpmbuild
  44. if test -x $RPMBUILD; then
  45. echo "Building RPM package"
  46. RPM_SRC_DIR="`pwd`/rpm"
  47. rm -rf $RPM_SRC_DIR
  48. mkdir "$RPM_SRC_DIR"
  49. mkdir "$RPM_SRC_DIR/BUILD"
  50. mkdir "$RPM_SRC_DIR/RPMS"
  51. mkdir "$RPM_SRC_DIR/RPMS/`$RPMBUILD --eval='%{_host_cpu}' 2>/dev/null`"
  52. mkdir "$RPM_SRC_DIR/SPECS"
  53. $RPMBUILD -tb --define="_topdir $RPM_SRC_DIR" mc-*.tar.gz >test-rpm.out 2>test-rpm.err
  54. else
  55. echo "rpmbuild not found"
  56. fi
  57. trap - exit
  58. echo "All done. No fatal errors. Please check test*.err files."