mctest 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 with_glib12=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_termcap=yes \
  43. with_mmap=no with_subshell=optional enable_netcode=no
  44. RPMBUILD=/usr/bin/rpmbuild
  45. if test -x $RPMBUILD; then
  46. echo "Building RPM package"
  47. RPM_SRC_DIR="`pwd`/rpm"
  48. rm -rf $RPM_SRC_DIR
  49. mkdir "$RPM_SRC_DIR"
  50. mkdir "$RPM_SRC_DIR/BUILD"
  51. mkdir "$RPM_SRC_DIR/RPMS"
  52. mkdir "$RPM_SRC_DIR/RPMS/`$RPMBUILD --eval='%{_host_cpu}' 2>/dev/null`"
  53. mkdir "$RPM_SRC_DIR/SPECS"
  54. $RPMBUILD -tb --define="_topdir $RPM_SRC_DIR" mc-*.tar.gz >test-rpm.out 2>test-rpm.err
  55. else
  56. echo "rpmbuild not found"
  57. fi
  58. trap - exit
  59. echo "All done. No fatal errors. Please check test*.err files."