mirror of
git://sourceware.org/git/lvm2.git
synced 2025-02-24 17:57:48 +03:00
tests: support invalid and fail results
Allow more detailed check for failing exit code: invalid - expects 3 fail - expects 5
This commit is contained in:
parent
0e02551f04
commit
5b44a036b1
@ -123,6 +123,13 @@ endif
|
|||||||
lib/should: lib/not
|
lib/should: lib/not
|
||||||
ln -sf not lib/should
|
ln -sf not lib/should
|
||||||
|
|
||||||
|
lib/invalid: lib/not
|
||||||
|
ln -sf not lib/invalid
|
||||||
|
|
||||||
|
lib/fail: lib/not
|
||||||
|
ln -sf not lib/fail
|
||||||
|
|
||||||
|
|
||||||
lib/%: lib/%.o .lib-dir-stamp
|
lib/%: lib/%.o .lib-dir-stamp
|
||||||
$(CC) $(LDFLAGS) -o $@ $<
|
$(CC) $(LDFLAGS) -o $@ $<
|
||||||
|
|
||||||
@ -144,7 +151,7 @@ lib/paths: $(srcdir)/Makefile.in .lib-dir-stamp
|
|||||||
echo 'export CLVMD_PIDFILE="@CLVMD_PIDFILE@"' >> $@-t
|
echo 'export CLVMD_PIDFILE="@CLVMD_PIDFILE@"' >> $@-t
|
||||||
mv $@-t $@
|
mv $@-t $@
|
||||||
|
|
||||||
LIB = lib/not lib/should lib/harness \
|
LIB = lib/not lib/invalid lib/fail lib/should lib/harness \
|
||||||
lib/check lib/aux lib/test lib/utils lib/get lib/lvm-wrapper \
|
lib/check lib/aux lib/test lib/utils lib/get lib/lvm-wrapper \
|
||||||
lib/paths
|
lib/paths
|
||||||
|
|
||||||
|
@ -26,6 +26,14 @@ static int finished(const char *cmd, int status) {
|
|||||||
if (status)
|
if (status)
|
||||||
fprintf(stderr, "TEST WARNING: Ignoring command failure.\n");
|
fprintf(stderr, "TEST WARNING: Ignoring command failure.\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
} else if (!strcmp(cmd, "invalid")) {
|
||||||
|
if (status == 3)
|
||||||
|
return 0;
|
||||||
|
fprintf(stderr, "Test expected exit code 3 (invalid), but got %d.\n", status);
|
||||||
|
} else if (!strcmp(cmd, "fail")) {
|
||||||
|
if (status == 5)
|
||||||
|
return 0;
|
||||||
|
fprintf(stderr, "Test expected exit code 5 (fail), but got %d.\n", status);
|
||||||
}
|
}
|
||||||
return 6;
|
return 6;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user