1 AT_BANNER([sparse external arrays])
3 m4_divert_push([PREPARE_TESTS])
4 [sparse_xarray_queue_limit () {
5 # Each on-disk sparse_xarray eats up a file descriptor, so for the
6 # tests that involve on-disk sparse_xarrays we need to limit the
7 # maximum length of the queue. Figure out how many file descriptors
8 # we can let the test program open at once.
9 OPEN_MAX=`getconf OPEN_MAX 2>/dev/null`
12 # Divide by 2 because some fds are used by other code.
13 queue_limit=`expr $OPEN_MAX / 2`
16 # Assume that any system with a dynamic fd limit has a large limit.
20 case `uname -m 2>/dev/null` in
22 # Cygwin claims a 256-fd limit as OPEN_MAX in <limits.h>.
26 # The following email claims that Mingw should have a
28 # http://www.mail-archive.com/squid-users@squid-cache.org/msg35249.html
32 # This seems fairly conservative these days.
40 m4_divert_pop([PREPARE_TESTS])
42 AT_SETUP([in-memory sparse_xarray])
43 dnl --values=3 would be a slightly better test but takes much longer.
44 AT_CHECK([sparse-xarray-test$EXEEXT \
45 --verbosity=0 --queue-limit=`sparse_xarray_queue_limit` \
46 --columns=3 --max-rows=3 --max-memory-rows=3 --values=2],
47 [0], [ignore], [ignore])
50 m4_define([SPARSE_XARRAY_ON_DISK],
51 [AT_SETUP([on-disk sparse_xarray max-memory-rows=$1])
52 AT_CHECK([sparse-xarray-test$EXEEXT \
53 --verbosity=0 --queue-limit=`sparse_xarray_queue_limit` \
54 --columns=2 --max-rows=3 --max-memory-rows=$1 --values=2],
55 [0], [ignore], [ignore])
57 SPARSE_XARRAY_ON_DISK([0])
58 SPARSE_XARRAY_ON_DISK([1])
59 SPARSE_XARRAY_ON_DISK([2])
61 AT_SETUP([copying between in-memory sparse_xarrays])
62 AT_KEYWORDS([sparse_xarray])
63 AT_CHECK([sparse-xarray-test$EXEEXT \
64 --verbosity=0 --queue-limit=`sparse_xarray_queue_limit` \
65 --columns=2 --max-rows=2 --max-memory-rows=2 --values=2 \
66 --xarrays=2 --no-write-rows --no-copy-columns],
67 [0], [ignore], [ignore])
70 m4_define([SPARSE_XARRAY_COPY_DISK],
71 [AT_SETUP([copying between on-disk sparse_xarrays max-memory-rows=$1])
72 AT_KEYWORDS([sparse_xarray])
73 limit=`sparse_xarray_queue_limit`
74 AT_CHECK([sparse-xarray-test$EXEEXT \
75 --verbosity=0 --queue-limit=`expr $limit / 2` \
76 --columns=1 --max-rows=2 --max-memory-rows=$max_memory_rows \
77 --values=2 --xarrays=2 --no-write-rows --no-copy-columns],
78 [0], [ignore], [ignore])
80 dnl These parameters are ridiculously low, but it's necessary
81 dnl unless we want the tests to take a very long time.
82 SPARSE_XARRAY_COPY_DISK([0])
83 SPARSE_XARRAY_COPY_DISK([1])