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