]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: convert tests/ to module
authorKarel Zak <kzak@redhat.com>
Fri, 1 Jun 2012 13:30:56 +0000 (15:30 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 26 Jun 2012 18:50:53 +0000 (20:50 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
Makefile.am
configure.ac
tests/Makefile.am [deleted file]
tests/Makemodule.am [new file with mode: 0644]
tests/commands.sh.in
tests/expected/mount/mtablock [deleted file]
tests/helpers/Makefile.am [deleted file]
tests/helpers/Makemodule.am [new file with mode: 0644]
tests/ts/mount/mtablock [deleted file]

index 98f7a38662733baf33dcf9662ecf32f96a6d6528..56a7a65063f3fb354b08fdf39297c6173f313490 100644 (file)
@@ -19,6 +19,7 @@ systemdsystemunit_DATA =
 INSTALL_EXEC_HOOKS =
 UNINSTALL_HOOKS =
 INSTALL_DATA_HOOKS =
+CLEAN_LOCALS =
 
 EXTRA_DIST =
 CLEANFILES =
@@ -28,8 +29,7 @@ MAN_DIRS = man/ru
 SUBDIRS = \
        $(MAN_DIRS) \
        fdisk \
-       po \
-       tests
+       po
 
 RCS_FIND_IGNORE = \( -name SCCS -o -name BitKeeper -o -name .svn -o \
                -name CVS -o -name .pc -o -name .hg -o -name .git \) -prune -o
@@ -59,6 +59,9 @@ include sys-utils/Makemodule.am
 include misc-utils/Makemodule.am
 include disk-utils/Makemodule.am
 
+include tests/Makemodule.am
+
+
 # Arrange so that .tarball-version appears only in the distribution
 # tarball, and never in a checked-out repository.
 dist-hook:
@@ -120,3 +123,4 @@ uninstall-hook: $(UNINSTALL_HOOKS)
 
 install-data-hook: $(INSTALL_DATA_HOOKS)
 
+clean-local: $(CLEAN_LOCALS)
index 2f3e196b5d7db99c9901119d89dbfd13e93a09d4..6e6399f366c8137d9db4bc6b4ac8a538e5248147 100644 (file)
@@ -1303,9 +1303,7 @@ libuuid/uuid.pc
 man/ru/Makefile
 misc-utils/uuidd.service
 po/Makefile.in
-tests/Makefile
 tests/commands.sh
-tests/helpers/Makefile
 ])
 
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
deleted file mode 100644 (file)
index c22f30e..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-include $(top_srcdir)/config/include-Makefile.am
-
-SUBDIRS = helpers
-
-EXTRA_DIST = \
-       expected \
-       functions.sh \
-       run.sh \
-       ts
-
-clean-local:
-       rm -rf output diff
diff --git a/tests/Makemodule.am b/tests/Makemodule.am
new file mode 100644 (file)
index 0000000..e25f713
--- /dev/null
@@ -0,0 +1,13 @@
+
+include tests/helpers/Makemodule.am
+
+EXTRA_DIST += \
+       tests/expected \
+       tests/functions.sh \
+       tests/run.sh \
+       tests/ts
+
+clean-local-tests:
+       rm -rf output diff
+
+CLEAN_LOCALS += clean-local-tests
index 2b2a5771e5137292bcc0cb6b97aee003b3ab30b6..002c2c01e031a70c0d96b942cea84ce563916e35 100644 (file)
@@ -6,69 +6,63 @@ top_srcdir=@abs_top_srcdir@
 TS_TESTUSER=${TS_TESTUSER:-"test"}
 
 # helpers
-TS_HELPER_SYSINFO="$top_builddir/tests/helpers/test_sysinfo"
-TS_HELPER_PATHS="$top_builddir/tests/helpers/test_pathnames"
-TS_HELPER_BYTESWAP="$top_builddir/tests/helpers/test_byteswap"
-TS_HELPER_MD5="$top_builddir/tests/helpers/test_md5"
+TS_HELPER_SYSINFO="$top_builddir/test_sysinfo"
+TS_HELPER_PATHS="$top_builddir/test_pathnames"
+TS_HELPER_BYTESWAP="$top_builddir/test_byteswap"
+TS_HELPER_MD5="$top_builddir/test_md5"
 
-TS_HELPER_ISMOUNTED="$top_builddir/lib/test_ismounted"
-TS_HELPER_STRUTILS="$top_builddir/lib/test_strutils"
-TS_HELPER_CPUSET="$top_builddir/lib/test_cpuset"
+TS_HELPER_ISMOUNTED="$top_builddir/test_ismounted"
+TS_HELPER_STRUTILS="$top_builddir/test_strutils"
+TS_HELPER_CPUSET="$top_builddir/test_cpuset"
 
 # libmount
-TS_HELPER_LIBMOUNT_OPTSTR="$top_builddir/libmount/src/test_optstr"
-TS_HELPER_LIBMOUNT_TAB="$top_builddir/libmount/src/test_tab"
-TS_HELPER_LIBMOUNT_UTILS="$top_builddir/libmount/src/test_utils"
-TS_HELPER_LIBMOUNT_LOCK="$top_builddir/libmount/src/test_lock"
-TS_HELPER_LIBMOUNT_UPDATE="$top_builddir/libmount/src/test_tab_update"
-TS_HELPER_LIBMOUNT_CONTEXT="$top_builddir/libmount/src/test_context"
-TS_HELPER_LIBMOUNT_TABDIFF="$top_builddir/libmount/src/test_tab_diff"
+TS_HELPER_LIBMOUNT_OPTSTR="$top_builddir/test_optstr"
+TS_HELPER_LIBMOUNT_TAB="$top_builddir/test_tab"
+TS_HELPER_LIBMOUNT_UTILS="$top_builddir/test_utils"
+TS_HELPER_LIBMOUNT_LOCK="$top_builddir/test_lock"
+TS_HELPER_LIBMOUNT_UPDATE="$top_builddir/test_tab_update"
+TS_HELPER_LIBMOUNT_CONTEXT="$top_builddir/test_context"
+TS_HELPER_LIBMOUNT_TABDIFF="$top_builddir/test_tab_diff"
 
-TS_HELPER_ISLOCAL="$top_builddir/login-utils/test_islocal"
-TS_HELPER_LOGINDEFS="$top_builddir/login-utils/test_logindefs"
+TS_HELPER_ISLOCAL="$top_builddir/test_islocal"
+TS_HELPER_LOGINDEFS="$top_builddir/test_logindefs"
 
 # TODO: use partx
-TS_HELPER_PARTITIONS="$top_builddir/libblkid/samples/partitions"
+TS_HELPER_PARTITIONS="$top_builddir/samples-partitions"
 
 # paths to commands
-if [ -x "$top_builddir/sys-utils/mount" ]; then
- TS_CMD_MOUNT=${TS_CMD_MOUNT:-"$top_builddir/sys-utils/mount"}
- TS_CMD_UMOUNT=${TS_CMD_UMOUNT:-"$top_builddir/sys-utils/umount"}
-else
- TS_CMD_MOUNT=${TS_CMD_MOUNT:-"$top_builddir/mount/mount"}
- TS_CMD_UMOUNT=${TS_CMD_UMOUNT:-"$top_builddir/mount/umount"}
- TS_CMD_MTABLOCK=${TS_CMD_MTABLOCK:-"$top_builddir/mount/mtab_lock_test"}
-fi
-
-TS_CMD_SWAPON=${TS_CMD_SWAPON:-"$top_builddir/sys-utils/swapon"}
-TS_CMD_SWAPOFF=${TS_CMD_SWAPOFF:-"$top_builddir/sys-utils/swapoff"}
-TS_CMD_LOSETUP=${TS_CMD_LOSETUP:-"$top_builddir/sys-utils/losetup"}
-
-TS_CMD_MKSWAP=${TS_CMD_MKSWAP:-"$top_builddir/disk-utils/mkswap"}
-TS_CMD_MKCRAMFS=${TS_CMD_MKCRAMFS:-"$top_builddir/disk-utils/mkfs.cramfs"}
-TS_CMD_MKMINIX=${TS_CMD_MKMINIX:-"$top_builddir/disk-utils/mkfs.minix"}
-TS_CMD_FSCKCRAMFS=${TS_CMD_FSCKCRAMFS:-"$top_builddir/disk-utils/fsck.cramfs"}
-TS_CMD_FSCKMINIX=${TS_CMD_FSCKMINIX:-"$top_builddir/disk-utils/fsck.minix"}
-
-TS_CMD_IPCS=${TS_CMD_IPCS:-"$top_builddir/sys-utils/ipcs"}
-
-TS_CMD_COL=${TS_CMD_COL:-"$top_builddir/text-utils/col"}
-TS_CMD_COLUMN=${TS_CMD_COLUMN:-"$top_builddir/text-utils/column"}
-TS_CMD_COLRM=${TS_CMD_COLRM:-"$top_builddir/text-utils/colrm"}
-
-TS_CMD_NAMEI=${TS_CMD_NAMEI-"$top_builddir/misc-utils/namei"}
-TS_CMD_LOOK=${TS_CMD_LOOK-"$top_builddir/misc-utils/look"}
-TS_CMD_CAL=${TS_CMD_CAL-"$top_builddir/misc-utils/cal"}
-TS_CMD_SCRIPT=${TS_CMD_SCRIPT-"$top_builddir/term-utils/script"}
-TS_CMD_EJECT=${TS_CMD_EJECT-"$top_builddir/sys-utils/eject"}
-
-
-TS_CMD_HWCLOCK=${TS_CMD_HWCLOCK-"$top_builddir/hwclock/hwclock"}
-TS_CMD_LSCPU=${TS_CMD_LSCPU-"$top_builddir/sys-utils/lscpu"}
-
-TS_CMD_BLKID=${TS_CMD_BLKID-"$top_builddir/misc-utils/blkid"}
-TS_CMD_PARTX=${TS_CMD_PARTX-"$top_builddir/partx/partx"}
-TS_CMD_FINDMNT=${TS_CMD_FINDMNT-"$top_builddir/misc-utils/findmnt"}
-
-TS_CMD_FDISK=${TS_CMD_FDISK-"$top_builddir/fdisk/fdisk"}
+TS_CMD_MOUNT=${TS_CMD_MOUNT:-"$top_builddir/mount"}
+TS_CMD_UMOUNT=${TS_CMD_UMOUNT:-"$top_builddir/umount"}
+
+TS_CMD_SWAPON=${TS_CMD_SWAPON:-"$top_builddir/swapon"}
+TS_CMD_SWAPOFF=${TS_CMD_SWAPOFF:-"$top_builddir/swapoff"}
+TS_CMD_LOSETUP=${TS_CMD_LOSETUP:-"$top_builddir/losetup"}
+
+TS_CMD_MKSWAP=${TS_CMD_MKSWAP:-"$top_builddir/mkswap"}
+TS_CMD_MKCRAMFS=${TS_CMD_MKCRAMFS:-"$top_builddir/mkfs.cramfs"}
+TS_CMD_MKMINIX=${TS_CMD_MKMINIX:-"$top_builddir/mkfs.minix"}
+TS_CMD_FSCKCRAMFS=${TS_CMD_FSCKCRAMFS:-"$top_builddir/fsck.cramfs"}
+TS_CMD_FSCKMINIX=${TS_CMD_FSCKMINIX:-"$top_builddir/fsck.minix"}
+
+TS_CMD_IPCS=${TS_CMD_IPCS:-"$top_builddir/ipcs"}
+
+TS_CMD_COL=${TS_CMD_COL:-"$top_builddir/col"}
+TS_CMD_COLUMN=${TS_CMD_COLUMN:-"$top_builddir/column"}
+TS_CMD_COLRM=${TS_CMD_COLRM:-"$top_builddir/colrm"}
+
+TS_CMD_NAMEI=${TS_CMD_NAMEI-"$top_builddir/namei"}
+TS_CMD_LOOK=${TS_CMD_LOOK-"$top_builddir/look"}
+TS_CMD_CAL=${TS_CMD_CAL-"$top_builddir/cal"}
+TS_CMD_SCRIPT=${TS_CMD_SCRIPT-"$top_builddir/script"}
+TS_CMD_EJECT=${TS_CMD_EJECT-"$top_builddir/eject"}
+
+
+TS_CMD_HWCLOCK=${TS_CMD_HWCLOCK-"$top_builddir/hwclock"}
+TS_CMD_LSCPU=${TS_CMD_LSCPU-"$top_builddir/lscpu"}
+
+TS_CMD_BLKID=${TS_CMD_BLKID-"$top_builddir/blkid"}
+TS_CMD_PARTX=${TS_CMD_PARTX-"$top_builddir/partx"}
+TS_CMD_FINDMNT=${TS_CMD_FINDMNT-"$top_builddir/findmnt"}
+
+TS_CMD_FDISK=${TS_CMD_FDISK-"$top_builddir/fdisk"}
 
diff --git a/tests/expected/mount/mtablock b/tests/expected/mount/mtablock
deleted file mode 100644 (file)
index d7e318d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-50000
\ No newline at end of file
diff --git a/tests/helpers/Makefile.am b/tests/helpers/Makefile.am
deleted file mode 100644 (file)
index fa95b9e..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-include $(top_srcdir)/config/include-Makefile.am
-
-noinst_PROGRAMS = \
-       test_byteswap \
-       test_md5 \
-       test_pathnames \
-       test_sysinfo
-
-test_md5_SOURCES = test_md5.c $(top_srcdir)/lib/md5.c
diff --git a/tests/helpers/Makemodule.am b/tests/helpers/Makemodule.am
new file mode 100644 (file)
index 0000000..0228cb3
--- /dev/null
@@ -0,0 +1,12 @@
+
+noinst_PROGRAMS += test_byteswap
+test_byteswap_SOURCES = tests/helpers/test_byteswap.c
+
+noinst_PROGRAMS += test_md5
+test_md5_SOURCES = tests/helpers/test_md5.c lib/md5.c
+
+noinst_PROGRAMS += test_pathnames
+test_pathnames_SOURCES = tests/helpers/test_pathnames.c
+
+noinst_PROGRAMS += test_sysinfo
+test_sysinfo_SOURCES = tests/helpers/test_sysinfo.c
diff --git a/tests/ts/mount/mtablock b/tests/ts/mount/mtablock
deleted file mode 100755 (executable)
index 445e893..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/bash
-
-#
-# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
-#
-# This file is part of util-linux.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This file is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-TS_TOPDIR="$(dirname $0)/../.."
-TS_DESC="mtab lock"
-
-. $TS_TOPDIR/functions.sh
-ts_init "$*"
-ts_skip_nonroot
-
-if [ ! -x "$TS_CMD_MTABLOCK" ]; then
-       ts_skip "not compiled"
-fi
-
-#
-# Be careful with number of processes. Don't forget that there is time limit
-# when the mount waits on the mtab lock. If you define too much processes some
-# of them will fail with timeout.
-#
-# Note: the original version (< 2.13) of util-linux is completely useless for
-# this test (maximum for this old version is NLOOPS=10 and NPROCESSES=5 (2-way
-# 2GHz machine)). It has terrible performance due a bad timeouts implemntation
-# in lock_mtab().
-#
-NLOOPS=1000
-NPROCESSES=50
-
-
-> $TS_OUTPUT.debug
-echo 0 > $TS_OUTPUT
-SYNCTIME=$(( $(date +%s) + 10 ))
-
-for id in $(seq 0 $(( $NPROCESSES - 1 ))); do
-       $TS_CMD_MTABLOCK $id $SYNCTIME $TS_OUTPUT $NLOOPS >> $TS_OUTPUT.debug 2>&1 &
-done
-
-wait
-
-ts_finalize
-