test-sh was assuming 'bup' was on the PATH. (It wasn't *supposed* to be
assuming that, but the "alias bup=whatever" line wasn't working,
apparently.)
randomgen.c triggered a warning in some versions of gcc about the return
value of write() being ignored. It really doesn't bother me if some of my
random bytes don't get written, but whatever; I'll assert instead, which
should shut it up.
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
+#include <assert.h>
int main(int argc, char **argv)
{
int kbytes = atoi(argv[1]);
uint32_t buf[1024/4];
+ ssize_t written;
int i;
for (; kbytes > 0; kbytes--)
{
for (i = 0; i < sizeof(buf)/sizeof(buf[0]); i++)
buf[i] = random();
- write(1, buf, sizeof(buf));
+ written = write(1, buf, sizeof(buf));
+ assert(written = sizeof(buf)); // we'd die from SIGPIPE otherwise
if (!(kbytes%1024))
fprintf(stderr, ".");
}
#!/bin/bash
set -e
-echo "Testing \"$@\" in Makefile:"
+echo "Testing \"integration\" in $0:"
TOP="$(pwd)"
export BUP_DIR="$TOP/buptest.tmp"
-alias bup="$TOP/bup"
+
+bup()
+{
+ "$TOP/bup" "$@"
+}
set -x
rm -rf "$BUP_DIR"