Skip to content

Commit

Permalink
Merge pull request chaos#122 from garlick/parallel_build
Browse files Browse the repository at this point in the history
get parallel build/test working
  • Loading branch information
mergify[bot] authored Jan 15, 2025
2 parents b9a3ee9 + f5fe359 commit 105a5c4
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 34 deletions.
6 changes: 1 addition & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ X_AC_EXPAND_INSTALL_DIRS
##
# Automake support
##
AM_INIT_AUTOMAKE([subdir-objects foreign]
m4_esyscmd([case `automake --version | head -n 1` in
*1.11*);;
*) echo serial-tests;;
esac]))
AM_INIT_AUTOMAKE([subdir-objects foreign])
AM_SILENT_RULES([yes])
AC_CONFIG_HEADERS([config/config.h])
AM_MAINTAINER_MODE([enable])
Expand Down
1 change: 1 addition & 0 deletions src/cmd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ common_ldadd = \
$(top_builddir)/src/libnpclient/libnpclient.a \
$(top_builddir)/src/libnpfs/libnpfs.a \
$(top_builddir)/src/liblsd/liblsd.a \
$(top_builddir)/src/libdiod/libdiod.a \
$(LIBWRAP) $(LIBPTHREAD) $(LUA_LIB) $(LIBMUNGE) $(LIBCAP) \
$(LIBIBVERBS) $(LIBRDMACM) $(LIBTCMALLOC) $(ncurses_LIBS)

Expand Down
2 changes: 2 additions & 0 deletions src/daemon/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ diod_LDADD = \
$(top_builddir)/src/libnpclient/libnpclient.a \
$(top_builddir)/src/libnpfs/libnpfs.a \
$(top_builddir)/src/liblsd/liblsd.a \
$(top_builddir)/src/libdiod/libdiod.a \
$(LIBWRAP) $(LIBPTHREAD) $(LUA_LIB) $(LIBMUNGE) $(LIBCAP) \
$(LIBIBVERBS) $(LIBRDMACM) $(LIBTCMALLOC)

Expand All @@ -32,6 +33,7 @@ test_ldadd = \
$(top_builddir)/src/libnpclient/libnpclient.a \
$(top_builddir)/src/libnpfs/libnpfs.a \
$(top_builddir)/src/liblsd/liblsd.a \
$(top_builddir)/src/libdiod/libdiod.a \
$(top_builddir)/src/libtap/libtap.a \
$(LIBPTHREAD)

Expand Down
11 changes: 7 additions & 4 deletions src/daemon/test/threadwrlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ main (int arg, char *argv[])
f.l_len = 64;
if (fcntl (fd, F_SETLK, &f) < 0) {
diag ("fcntl F_WRLCK 32-63: %s", strerror (errno));
exit (1);
_exit (1);
}
exit (0);
_exit (0);
break;
default: /* parent */
if (waitpid (pid, &status, 0) < 0)
Expand All @@ -222,7 +222,7 @@ main (int arg, char *argv[])
if (close (fd) < 0
|| (fd = open (path, O_RDWR)) < 0) {
diag ("close/open %s (child): %s", path, strerror (errno));
exit (2);
_exit (2);
}
f.l_type = F_WRLCK;
f.l_whence = SEEK_SET;
Expand All @@ -232,7 +232,7 @@ main (int arg, char *argv[])
if (exit_code == 1)
diag ("fcntl F_WRLCK 32-63: %s", strerror (errno));
(void)close (fd);
exit (exit_code);
_exit (exit_code);
break;
default: /* parent */
if (waitpid (pid, &status, 0) < 0)
Expand All @@ -246,6 +246,9 @@ main (int arg, char *argv[])
BAIL_OUT ("close: %s", strerror (errno));
if (unlink (path) < 0)
BAIL_OUT ("unlink %s: %s", path, strerror (errno));

done_testing ();

exit (0);
}

Expand Down
4 changes: 3 additions & 1 deletion src/libdiod/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ libdiod_a_SOURCES = \
diod_conf.c \
diod_conf.h \
diod_sock.c \
diod_sock.h
diod_sock.h \
lsderr.c

if RDMATRANS
libdiod_a_SOURCES += diod_rdma.c diod_rdma.h
Expand All @@ -25,6 +26,7 @@ test_ldadd = \
$(top_builddir)/src/libnpclient/libnpclient.a \
$(top_builddir)/src/libnpfs/libnpfs.a \
$(top_builddir)/src/liblsd/liblsd.a \
$(builddir)/libdiod.a \
$(top_builddir)/src/libtap/libtap.a \
$(LUA_LIB) \
$(LIBCAP) \
Expand Down
2 changes: 1 addition & 1 deletion src/liblsd/error.c → src/libdiod/lsderr.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <stdlib.h>
#include <stdarg.h>

#include "src/libdiod/diod_log.h"
#include "diod_log.h"

void
lsd_fatal_error (char *file, int line, char *mesg)
Expand Down
4 changes: 1 addition & 3 deletions src/liblsd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ liblsd_a_SOURCES = \
hash.c \
hash.h \
thread.c \
thread.h \
error.c
thread.h

test_ldadd = \
$(builddir)/liblsd.a \
$(top_builddir)/src/libdiod/libdiod.a \
$(top_builddir)/src/libtap/libtap.a \
$(LIBPTHREAD)

Expand Down
11 changes: 11 additions & 0 deletions src/liblsd/test/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@

static int objcount = 0;

void lsd_fatal_error (char *file, int line, char *mesg)
{
BAIL_OUT ("fatal error: %s: %s::%d", mesg, file, line);
}

void *lsd_nomem_error (char *file, int line, char *mesg)
{
diag ("out of memory: %s: %s::%d", mesg, file, line);
return NULL;
}

void myfree (void *x)
{
free (x);
Expand Down
2 changes: 0 additions & 2 deletions src/libnpfs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ libnpfs_a_SOURCES += rdmatrans.c
endif

test_ldadd = \
$(top_builddir)/src/libdiod/libdiod.a \
$(top_builddir)/src/libnpclient/libnpclient.a \
$(builddir)/libnpfs.a \
$(top_builddir)/src/liblsd/liblsd.a \
$(top_builddir)/src/libtap/libtap.a \
Expand Down
1 change: 0 additions & 1 deletion src/libnpfs/test/capability.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ int main(int argc, char *argv[])
if (geteuid () != 0 || getenv ("FAKEROOTKEY") != NULL)
plan (SKIP_ALL, "this test must run as root");
plan (NO_PLAN);
diod_log_init (argv[0]);
proc0 (); // spawns proc1 and proc2
#else
plan (SKIP_ALL, "libcap2-dev is not installed");
Expand Down
2 changes: 2 additions & 0 deletions src/libnpfs/test/setfsuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ int main(int argc, char *argv[])

check_fsid ("task0", 0, 0);

done_testing ();

exit (0);
}

Expand Down
19 changes: 10 additions & 9 deletions tests/kern/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ check_PROGRAMS = \

SUBDIRS = fstest postmark fsx fsstress

TESTS_ENVIRONMENT = env
TESTS_ENVIRONMENT += "PATH_DIOD=$(top_builddir)/src/daemon/diod"
TESTS_ENVIRONMENT += "PATH_DIODMOUNT=$(top_builddir)/src/cmd/diodmount"
TESTS_ENVIRONMENT += "KERN_SRCDIR=$(top_srcdir)/tests/kern"
TESTS_ENVIRONMENT += "KERN_BUILDDIR=$(top_builddir)/tests/kern"
TESTS_ENVIRONMENT += "TOP_SRCDIR=$(top_srcdir)"
TESTS_ENVIRONMENT += "TOP_BUILDDIR=$(top_builddir)"
TESTS_ENVIRONMENT += "${srcdir}/runtest"
AM_TESTS_ENVIRONMENT = \
PATH_DIOD='$(top_builddir)/src/daemon/diod'; export PATH_DIOD; \
PATH_DIODMOUNT='$(top_builddir)/src/cmd/diodmount'; export PATH_DIODMOUNT; \
KERN_SRCDIR='$(top_srcdir)/tests/kern'; export KERN_SRCDIR; \
KERN_BUILDDIR='$(top_builddir)/tests/kern'; export KERN_BUILDDIR; \
TOP_SRCDIR='$(top_srcdir)'; export TOP_SRCDIR; \
TOP_BUILDDIR='$(top_builddir)'; export TOP_BUILDDIR;

LOG_COMPILER = ${srcdir}/runtest

TESTS = t05 t06 t07 t12 t13 t14 t15 t16 t17 t18 t19 t22 \
t23 t24 t25 t26 t27 t28 t29 t30 t31 t32 t33 \
Expand All @@ -35,7 +36,7 @@ CLEANFILES = *.out *.diff *.diod *.postmark *.dbench
AM_CFLAGS = @WARNING_CFLAGS@

AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir) \
$(LUA_INCLUDE)


Expand Down
2 changes: 1 addition & 1 deletion tests/misc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ CLEANFILES = *.out *.diff
AM_CFLAGS = @WARNING_CFLAGS@

AM_CPPFLAGS = \
-I$(top_srcdir)
-I$(top_srcdir) \
$(LUA_INCLUDE)

LDADD = $(top_builddir)/src/cmd/opt.o \
Expand Down
17 changes: 10 additions & 7 deletions tests/user/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ check_PROGRAMS = \
txattr \
testopenfid

TESTS_ENVIRONMENT = env
TESTS_ENVIRONMENT += "PATH_DIOD=$(top_builddir)/src/daemon/diod"
TESTS_ENVIRONMENT += "PATH_DIODCONF=$(top_builddir)/etc/diod.conf"
TESTS_ENVIRONMENT += "USER_SRCDIR=$(top_srcdir)/tests/user"
TESTS_ENVIRONMENT += "USER_BUILDDIR=$(top_builddir)/tests/user"
TESTS_ENVIRONMENT += "${srcdir}/runtest"
AM_TESTS_ENVIRONMENT = \
PATH_DIOD='$(top_builddir)/src/daemon/diod'; export PATH_DIOD; \
PATH_DIODCONF='$(top_builddir)/etc/diod.conf'; export PATH_DIODCONF; \
USER_SRCDIR='$(top_srcdir)/tests/user'; export USER_SRCDIR; \
USER_BUILDDIR='$(top_builddir)/tests/user'; export USER_BUILDDIR;

LOG_COMPILER = ${srcdir}/runtest

AM_LOG_FLAGS =

TESTS = t01 t02 t03 t04 t05 t06 t07 t08 t09 t10 t11 t12 t13 t15 t16 t17 t18 t19 t20

Expand All @@ -33,7 +36,7 @@ CLEANFILES = *.out *.diff *.diod
AM_CFLAGS = @WARNING_CFLAGS@

AM_CPPFLAGS = \
-I$(top_srcdir)
-I$(top_srcdir) \
$(LUA_INCLUDE)


Expand Down

0 comments on commit 105a5c4

Please sign in to comment.