Update randread to 0.2.

Based on PR#44354 by Tony Young.
set LICENSE=public-domain, unit-test support by me.

Version 0.2  2002-09-11

    Added unit test framework.
    Read from a list of files, rather than just one, seeking evenly within
	all of them based on the number of blocks in each.
    Allow reading several contiguous blocks for each seek, so we can do
	sequential/random and sequential read testing.
    Print more and clearer information.
    Added disktest shell scripts.
This commit is contained in:
obache 2011-02-03 14:15:12 +00:00
parent 43380c4d7d
commit 583b33d851
9 changed files with 97 additions and 56 deletions

View file

@ -1,13 +1,14 @@
# $NetBSD: Makefile,v 1.10 2010/03/21 16:29:39 wiz Exp $
# $NetBSD: Makefile,v 1.11 2011/02/03 14:15:12 obache Exp $
#
DISTNAME= randread-0.1
DISTNAME= randread-0.2
CATEGORIES= benchmarks
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=randread/}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://randread.sourceforge.net/
COMMENT= Program to help benchmark random disk read performance
LICENSE= public-domain
NOT_FOR_PLATFORM= Interix-*-*
@ -15,11 +16,18 @@ PKG_INSTALLATION_TYPES= overwrite pkgviews
PKG_DESTDIR_SUPPORT= user-destdir
BUILD_TARGET= randread
WRKSRC= ${WRKDIR}
WRKSRC= ${WRKDIR}/${DISTNAME}
INSTALLATION_DIRS= sbin
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/randread ${DESTDIR}${PREFIX}/sbin
.include "../../mk/bsd.prefs.mk"
.if !empty(PKGSRC_RUN_TEST:M[yY][eE][sS])
TEST_TARGET= test
BUILDLINK_DEPMETHOD.check= build
.include "../../devel/check/buildlink3.mk"
.endif
.include "../../mk/bsd.pkg.mk"

View file

@ -1,2 +1,2 @@
@comment $NetBSD: PLIST,v 1.1.1.1 2002/06/25 05:13:27 grant Exp $
@comment $NetBSD: PLIST,v 1.2 2011/02/03 14:15:12 obache Exp $
sbin/randread

View file

@ -1,7 +1,9 @@
$NetBSD: distinfo,v 1.4 2010/12/30 08:20:42 obache Exp $
$NetBSD: distinfo,v 1.5 2011/02/03 14:15:12 obache Exp $
SHA1 (randread-0.1.tar.gz) = fefdf7ebeda6767a85215898e67606745f57d149
RMD160 (randread-0.1.tar.gz) = 012cfc71799affe061bff87a511c6298a7d61361
Size (randread-0.1.tar.gz) = 3490 bytes
SHA1 (patch-aa) = 9d29d08e0830320c3e9964b80c008f2b1b95711c
SHA1 (patch-ab) = 2f7193cfb153d45c14b9fac960260c0244bc6a1f
SHA1 (randread-0.2.tar.gz) = 5085d07cb6c4395d018addb4ab81f060473ea620
RMD160 (randread-0.2.tar.gz) = e8806da27cc231748b9416b16949c4921abc1d91
Size (randread-0.2.tar.gz) = 8112 bytes
SHA1 (patch-Makefile) = 0b709cc55687b274eda350cd263477644964c6e9
SHA1 (patch-filelist.c) = eee8bb8586cdcc568e8cf44965465d5f1885cd93
SHA1 (patch-filelist__test.c) = 15bf7f34db587812061f2e9aa5bf743c72ad458a
SHA1 (patch-test.c) = 0257aea93fdc12840c12e3818672fc8e4c2fb232

View file

@ -0,0 +1,31 @@
$NetBSD: patch-Makefile,v 1.1 2011/02/03 14:15:12 obache Exp $
* proper CPPFLAGS and LDFLAGS will be set by pkgsrc
* honor CFLAGS
--- Makefile.orig 2002-09-11 04:55:38.000000000 +0000
+++ Makefile
@@ -2,11 +2,11 @@
# Add alternative directories for includes files and libraries.
-CPPFLAGS=-I/usr/pkg/include
-LDFLAGS=-L/usr/pkg/lib
+CPPFLAGS?=-I/usr/pkg/include
+LDFLAGS?=-L/usr/pkg/lib
CC=cc ${CPPFLAGS}
randread: randread.c
- ${CC} -g -Wall -o randread randread.c filelist.c
+ ${CC} ${CFLAGS} -Wall -o randread randread.c filelist.c
tarfile: clean
@@ -18,6 +18,6 @@ tarfile: clean
#
test::
- ${CC} -g -Wall -o test test.c ${LDFLAGS} -lcheck
- ${CC} -g -Wall -o filelist_test filelist_test.c filelist.c \
+ ${CC} ${CFLAGS} -Wall -o test test.c ${LDFLAGS} -lcheck
+ ${CC} ${CFLAGS} -Wall -o filelist_test filelist_test.c filelist.c \
${LDFLAGS} -lcheck
./test

View file

@ -1,12 +0,0 @@
$NetBSD: patch-aa,v 1.1.1.1 2002/06/25 05:13:28 grant Exp $
--- Makefile.orig Fri Jun 21 17:12:37 2002
+++ Makefile Wed Jun 26 01:00:37 2002
@@ -1,6 +1,6 @@
randread: randread.c
- cc -g -Wall -o randread randread.c
+ ${CC} ${CFLAGS} -Wall -o randread randread.c
tarfile: clean
tar cf - . | gzip -9 > ../randread.tar.gz

View file

@ -1,34 +0,0 @@
$NetBSD: patch-ab,v 1.2 2010/12/30 08:20:42 obache Exp $
--- randread.c.orig 2002-06-21 07:11:29.000000000 +0000
+++ randread.c
@@ -3,7 +3,11 @@
* by the author, Curt Sampson <cjs@cynic.net>.
*/
+#include <sys/types.h>
#include <sys/disklabel.h>
+#ifdef __DragonFly__
+#include <sys/disklabel32.h>
+#endif
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/time.h>
@@ -100,9 +104,17 @@ int run_test()
*/
int get_char_device_blocks(int filedes)
{
+#ifdef __DragonFly__
+ struct disklabel32 label;
+#else
struct disklabel label;
+#endif
+#ifdef __DragonFly__
+ if (ioctl(filedes, DIOCGDINFO32, &label) == -1)
+#else
if (ioctl(filedes, DIOCGDINFO, &label) == -1)
+#endif
return -1;
/* Hack to make it ignore what this returns. */

View file

@ -0,0 +1,16 @@
$NetBSD: patch-filelist.c,v 1.1 2011/02/03 14:15:12 obache Exp $
--- filelist.c.orig 2002-09-11 05:15:12.000000000 +0000
+++ filelist.c
@@ -7,9 +7,10 @@
#include <errno.h>
#include <fcntl.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
-#include <strings.h>
+#include <string.h>
#include <unistd.h>
#include "filelist.h"

View file

@ -0,0 +1,15 @@
$NetBSD: patch-filelist__test.c,v 1.1 2011/02/03 14:15:12 obache Exp $
* suite_free is not required by check>=0.9.0, everything will be freed when
srunner_free is called.
--- filelist_test.c.orig 2002-09-11 05:15:40.000000000 +0000
+++ filelist_test.c
@@ -177,7 +177,6 @@ int main(void)
srunner_run_all (sr, CK_NORMAL);
num_failed = srunner_ntests_failed (sr);
srunner_free (sr);
- suite_free (s);
return num_failed;
}

View file

@ -0,0 +1,15 @@
$NetBSD: patch-test.c,v 1.1 2011/02/03 14:15:12 obache Exp $
* suite_free is not required by check>=0.9.0, everything will be freed when
srunner_free is called.
--- test.c.orig 2002-07-11 08:23:49.000000000 +0000
+++ test.c
@@ -31,7 +31,6 @@ int main(void)
srunner_run_all (sr, CK_NORMAL);
num_failed = srunner_ntests_failed (sr);
srunner_free (sr);
- suite_free (s);
return num_failed;
}