1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-22 05:57:43 +03:00

r19350: Properly list LOCAL-TALLOC under the "LOCAL" header.

Support directories for subcategories in tests.
Several small other fixes.
(This used to be commit bde00d97068d559b025ab131ff698a82430d14b3)
This commit is contained in:
Jelmer Vernooij 2006-10-16 23:09:15 +00:00 committed by Gerald (Jerry) Carter
parent c2d6fad69b
commit b58deeea69
12 changed files with 85 additions and 70 deletions

View File

@ -130,3 +130,4 @@ source/web_server/proto.h
source/winbind/wb_helper.h
source/winbind/wb_proto.h
source/wrepl_server/wrepl_server_proto.h
tags

View File

@ -366,18 +366,17 @@ sub Binary($$)
my ($self,$ctx) = @_;
my $installdir;
my $localdir;
my $extradir = "";
if (defined($ctx->{INSTALLDIR}) && $ctx->{INSTALLDIR} eq "TORTUREDIR") {
$localdir = "bin/torture";
} else {
$localdir = "bin";
if (defined($ctx->{INSTALLDIR}) && $ctx->{INSTALLDIR} =~ /^TORTUREDIR/) {
$extradir = "/torture" . substr($ctx->{INSTALLDIR}, length("TORTUREDIR"));
}
my $localdir = "bin$extradir";
if ($self->{duplicate_build}) {
$installdir = "bin/install";
$installdir = "bin/install$extradir";
} else {
$installdir = $localdir;
$installdir = "bin$extradir";
}
push(@{$self->{all_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_FULL_OBJ_LIST)");
@ -387,7 +386,7 @@ sub Binary($$)
push (@{$self->{sbin_progs}}, "$installdir/$ctx->{BINARY}");
} elsif ($ctx->{INSTALLDIR} eq "BINDIR") {
push (@{$self->{bin_progs}}, "$installdir/$ctx->{BINARY}");
} elsif ($ctx->{INSTALLDIR} eq "TORTUREDIR") {
} elsif ($ctx->{INSTALLDIR} =~ /^TORTUREDIR/) {
push (@{$self->{torture_progs}}, "$installdir/$ctx->{BINARY}");
}

View File

@ -12,7 +12,7 @@ DESCRIPTION = A hierarchical pool based memory system with destructors
# End LIBRARY LIBTALLOC
################################################
[BINARY::LOCAL-TALLOC]
[BINARY::TALLOC]
OBJ_FILES = testsuite.o
PRIVATE_DEPENDENCIES = LIBTALLOC
INSTALLDIR = TORTUREDIR
INSTALLDIR = TORTUREDIR/LOCAL

View File

@ -136,12 +136,9 @@ installbin: $(SBIN_PROGS) $(BIN_PROGS) installdirs
$(DESTDIR)$(LIBDIR) \
$(DESTDIR)$(VARDIR) \
$(BIN_PROGS)
@$(SHELL) $(srcdir)/script/installbin.sh \
@$(SHELL) $(srcdir)/script/installtorture.sh \
$(INSTALLPERMS) \
$(DESTDIR)$(BASEDIR) \
$(DESTDIR)$(TORTUREDIR) \
$(DESTDIR)$(LIBDIR) \
$(DESTDIR)$(VARDIR) \
$(TORTURE_PROGS)
installlib: $(INSTALLABLE_SHARED_LIBS) $(STATIC_LIBS) installdirs
@ -175,7 +172,7 @@ uninstallmisc:
uninstallbin:
@$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(SBIN_PROGS)
@$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(BIN_PROGS)
@$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(TORTUREDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(TORTURE_PROGS)
@$(SHELL) $(srcdir)/script/uninstalltorture.sh $(DESTDIR)$(TORTUREDIR) $(TORTURE_PROGS)
uninstalllib:
@$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(LIBDIR) $(SHARED_LIBS)

View File

@ -0,0 +1,18 @@
#!/bin/sh
INSTALLPERMS=$1
TORTUREDIR=$2
shift
shift
for p in $*; do
p2=`dirname $p`
base=`basename $p`
DESTDIR=$TORTUREDIR/`basename $p2`
mkdir -p $DESTDIR
echo Installing $p as $DESTDIR/$base
cp -f $p $DESTDIR/
chmod $INSTALLPERMS $DESTDIR/$base
done
exit 0

View File

@ -0,0 +1,15 @@
#!/bin/sh
TORTUREDIR=$1
shift
shift
for p in $*; do
p2=`dirname $p`
base=`basename $p`
DESTDIR=$TORTUREDIR/`basename $p2`
echo Removing $DESTDIR/$base
rm -f $p $DESTDIR/
done
exit 0

View File

@ -245,7 +245,7 @@ failed:
struct torture_suite *torture_local_dbspeed(TALLOC_CTX *mem_ctx)
{
struct torture_suite *s = torture_suite_create(mem_ctx, "LOCAL-DBSPEED");
struct torture_suite *s = torture_suite_create(mem_ctx, "DBSPEED");
torture_suite_add_simple_tcase(s, "tdb_speed", test_tdb_speed, NULL);
torture_suite_add_simple_tcase(s, "ldb_speed", test_ldb_speed, NULL);
return s;

View File

@ -43,18 +43,18 @@ static bool run_matching(struct torture_context *torture,
bool ret = true;
if (suite == NULL) {
struct torture_suite_list *o;
struct torture_suite *o;
for (o = torture_suites; o; o = o->next) {
if (gen_fnmatch(expr, o->suite->name) == 0) {
for (o = torture_root->children; o; o = o->next) {
if (gen_fnmatch(expr, o->name) == 0) {
*matched = true;
init_iconv();
ret &= torture_run_suite(torture, o->suite);
ret &= torture_run_suite(torture, o);
continue;
}
ret &= run_matching(torture,
o->suite->name, expr, o->suite, matched);
o->name, expr, o, matched);
}
} else {
char *name;
@ -99,11 +99,11 @@ static bool run_test(struct torture_context *torture, const char *name)
{
bool ret = true;
bool matched = false;
struct torture_suite_list *o;
struct torture_suite *o;
if (strequal(name, "ALL")) {
for (o = torture_suites; o; o = o->next) {
ret &= torture_run_suite(torture, o->suite);
for (o = torture_root->children; o; o = o->next) {
ret &= torture_run_suite(torture, o);
}
return ret;
}
@ -160,7 +160,7 @@ static void parse_dns(const char *dns)
static void usage(poptContext pc)
{
struct torture_suite_list *o;
struct torture_suite *o;
struct torture_suite *s;
struct torture_tcase *t;
int i;
@ -217,24 +217,24 @@ static void usage(poptContext pc)
printf("Tests are:");
for (o = torture_suites; o; o = o->next) {
printf("\n%s (%s):\n ", o->suite->description, o->suite->name);
for (o = torture_root->children; o; o = o->next) {
printf("\n%s (%s):\n ", o->description, o->name);
i = 0;
for (s = o->suite->children; s; s = s->next) {
if (i + strlen(o->suite->name) + strlen(s->name) >= (MAX_COLS - 3)) {
for (s = o->children; s; s = s->next) {
if (i + strlen(o->name) + strlen(s->name) >= (MAX_COLS - 3)) {
printf("\n ");
i = 0;
}
i+=printf("%s-%s ", o->suite->name, s->name);
i+=printf("%s-%s ", o->name, s->name);
}
for (t = o->suite->testcases; t; t = t->next) {
if (i + strlen(o->suite->name) + strlen(t->name) >= (MAX_COLS - 3)) {
for (t = o->testcases; t; t = t->next) {
if (i + strlen(o->name) + strlen(t->name) >= (MAX_COLS - 3)) {
printf("\n ");
i = 0;
}
i+=printf("%s-%s ", o->suite->name, t->name);
i+=printf("%s-%s ", o->name, t->name);
}
if (i) printf("\n");
@ -532,10 +532,10 @@ const static struct torture_ui_ops quiet_ui_ops = {
subunit_dir = lp_parm_string_list(-1, "torture", "subunitdir", ":");
if (subunit_dir == NULL)
torture_subunit_load_testsuites(dyn_TORTUREDIR);
torture_subunit_load_testsuites(dyn_TORTUREDIR, true, NULL);
else {
for (i = 0; subunit_dir[i]; i++)
torture_subunit_load_testsuites(subunit_dir[i]);
torture_subunit_load_testsuites(subunit_dir[i], true, NULL);
}

View File

@ -33,42 +33,23 @@ _PUBLIC_ int torture_seed=0;
_PUBLIC_ int torture_numasync=100;
_PUBLIC_ bool torture_showall = false;
struct torture_suite_list *torture_suites = NULL;
struct torture_suite *torture_root = NULL;
NTSTATUS torture_register_suite(struct torture_suite *suite)
bool torture_register_suite(struct torture_suite *suite)
{
struct torture_suite_list *p, *n;
if (!suite)
return true;
if (!suite) {
return NT_STATUS_OK;
}
n = talloc(talloc_autofree_context(), struct torture_suite_list);
n->suite = suite;
for (p = torture_suites; p; p = p->next) {
if (strcmp(p->suite->name, suite->name) == 0) {
/* Check for duplicates */
DEBUG(0,("There already is a suite registered with the name %s!\n", suite->name));
return NT_STATUS_OBJECT_NAME_COLLISION;
}
if (strcmp(p->suite->name, suite->name) < 0 &&
(!p->next || strcmp(p->next->suite->name, suite->name) > 0)) {
DLIST_ADD_AFTER(torture_suites, n, p);
return NT_STATUS_OK;
}
}
DLIST_ADD_END(torture_suites, n, struct torture_suite_list *);
return NT_STATUS_OK;
return torture_suite_add_suite(torture_root, suite);
}
int torture_init(void)
{
init_module_fn static_init[] = STATIC_torture_MODULES;
init_module_fn *shared_init = load_samba_modules(NULL, "torture");
torture_root = talloc_zero(talloc_autofree_context(),
struct torture_suite);
run_init_functions(static_init);
run_init_functions(shared_init);

View File

@ -26,12 +26,7 @@
struct smbcli_state;
struct torture_suite_list {
struct torture_suite *suite;
struct torture_suite_list *prev, *next;
};
extern struct torture_suite_list * torture_suites;
extern struct torture_suite *torture_root;
extern BOOL use_oplocks;
extern BOOL torture_showall;

View File

@ -394,9 +394,14 @@ bool torture_suite_add_suite(struct torture_suite *suite,
}
struct torture_suite *torture_find_suite(const char *name)
struct torture_suite *torture_find_suite(struct torture_suite *parent,
const char *name)
{
/* FIXME */
struct torture_suite *child;
for (child = parent->children; child; child = child->next)
if (!strcmp(child->name, name))
return child;
return NULL;
}

View File

@ -294,4 +294,8 @@ bool torture_setting_bool(struct torture_context *test,
/* Helper function commonly used */
bool torture_teardown_free(struct torture_context *torture, void *data);
struct torture_suite *torture_find_suite(struct torture_suite *parent,
const char *name);
#endif /* __TORTURE_UI_H__ */