Enable gating tests for libtalloc

This commit is contained in:
Pavel Filipenský 2024-10-21 20:53:03 +02:00
parent eeca0334fc
commit 18b4fb0b3b
8 changed files with 2248 additions and 0 deletions

View File

@ -0,0 +1,14 @@
SRCS = testsuite.c testsuite_main.c
CFLAG = -Wall -Wextra -Werror=implicit-function-declaration
CC = gcc
LIBS = -ltalloc
OBJS = talloc_testsuite
talloc_testsuite:${SRCS}
${CC} ${CFLAGS} -o $@ ${SRCS} ${LIBS}
run: talloc_testsuite
./talloc_testsuite
clean:
-rm -f *~ ${OBJS}

View File

@ -0,0 +1,5 @@
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
#define PTR_DIFF(p1,p2) ((ptrdiff_t)(((const char *)(p1)) - (const char *)(p2)))

View File

@ -0,0 +1 @@
#include <sys/time.h>

View File

@ -0,0 +1,7 @@
#ifndef __LIB_TALLOC_TALLOC_TESTSUITE_H__
#define __LIB_TALLOC_TALLOC_TESTSUITE_H__
struct torture_context;
bool torture_local_talloc(struct torture_context *tctx);
#endif

View File

@ -0,0 +1,4 @@
#/bin/bash
make run || exit 1
make clean || exit 2

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,36 @@
/*
Unix SMB/CIFS implementation.
local testing of talloc routines.
Copyright (C) Andrew Tridgell 2004
** NOTE! The following LGPL license applies to the talloc
** library. This does NOT imply that all of Samba is released
** under the LGPL
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "replace.h"
#include "talloc_testsuite.h"
int main(void)
{
bool ret = torture_local_talloc(NULL);
if (!ret)
return -1;
return 0;
}

14
tests/tests.yml Normal file
View File

@ -0,0 +1,14 @@
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
tests:
- sanity-tests:
dir: sanity-tests
run: ./talloctest.sh
required_packages:
- make
- gcc
- libtalloc
- libtalloc-devel