makefile

Jamey Sharp jamey at gabe.freedesktop.org
Mon Oct 31 15:09:12 PST 2005


Update of /cvs/xtest/xtest/src/tet3/demo/master/ts
In directory gabe:/tmp/cvs-serv27930/src/tet3/demo/master/ts

Added Files:
	makefile tc1.c tc2.c tc3.c 
Log Message:
Importing TET 3.3h (unsupported) sources from http://tetworks.opengroup.org/tet/tet3.3h-unsup.src.tgz.
Omitted the contrib directory: we don't care, and the license situation wasn't entirely clear.


--- NEW FILE: tc1.c ---
/*
 *      SCCS:  @(#)tc1.c	1.2 (96/08/15) 
 *
 * (C) Copyright 1994 UniSoft Ltd., London, England
 *
 * All rights reserved.  No part of this source code may be reproduced,
 * stored in a retrieval system, or transmitted, in any form or by any
 * means, electronic, mechanical, photocopying, recording or otherwise,
 * except as stated in the end-user licence agreement, without the prior
 * permission of the copyright owners.
 */

#ifndef lint
static char sccsid[] = "@(#)tc1.c	1.2 (96/08/15) TET3 release 3.3";
#endif

/************************************************************************

SCCS:   	@(#)tc1.c	1.2 96/08/15 TETware release 3.3
NAME:		tc1.c
PRODUCT:	TETware
AUTHOR:		Denis McConalogue, UniSoft Ltd.
DATE CREATED:	October 1993

DESCRIPTION:
	demo test suite master system test case 1

MODIFICATIONS:

************************************************************************/

#include <stdlib.h>
#include <tet_api.h>

void (*tet_startup)() = NULL, (*tet_cleanup)() = NULL;
void tp1();

struct tet_testlist tet_testlist[] = { {tp1,1}, {NULL,0} };

void tp1()
{
	tet_infoline("This is the first test case (tc1)");
	tet_result(TET_PASS);
}


--- NEW FILE: tc3.c ---
/*
 *      SCCS:  @(#)tc3.c	1.3 (96/10/03) 
 *
 * (C) Copyright 1994 UniSoft Ltd., London, England
 *
 * All rights reserved.  No part of this source code may be reproduced,
 * stored in a retrieval system, or transmitted, in any form or by any
 * means, electronic, mechanical, photocopying, recording or otherwise,
 * except as stated in the end-user licence agreement, without the prior
 * permission of the copyright owners.
 */

#ifndef lint
static char sccsid[] = "@(#)tc3.c	1.3 (96/10/03) TET3 release 3.3";
#endif

/************************************************************************

SCCS:   	@(#)tc3.c	1.3 96/10/03 TETware release 3.3
NAME:		tc3.c
PRODUCT:	TETware
AUTHOR:		Denis McConalogue, UniSoft Ltd.
DATE CREATED:	October 1993

DESCRIPTION:
	demo test suite master system test case 3

MODIFICATIONS:
	Geoff Clare, UniSoft Ltd., Oct 1996
	Use tet_remsync() instead of (deprecated) tet_sync().
	Added tp2.

************************************************************************/

#include <stdlib.h>
#include <stdio.h>
#include <tet_api.h>

#define TIMEOUT	10	/* sync time out */

int sys1[] = { 1 };	/* system IDs to sync with */

static void error(err, rptstr)
int err;	/* tet_errno value, or zero if N/A */
char *rptstr;	/* failure to report */
{
	char *errstr, *colonstr = ": ";
	char errbuf[20];

	if (err == 0)
		errstr = colonstr = "";
	else if (err > 0 && err < tet_nerr)
		errstr = tet_errlist[err];
	else {
		(void) sprintf(errbuf, "unknown tet_errno value %d", tet_errno);
		errstr = errbuf;
	}

	if (tet_printf("%s%s%s", rptstr, colonstr, errstr) < 0) {
		(void) fprintf(stderr, "tet_printf() failed: tet_errno %d\n",
			tet_errno);
		exit(EXIT_FAILURE);
	}
}

static void tp1()
{
	tet_infoline("This is tp1 in the third test case (tc3, master)");

	(void) tet_printf("sync with slave (sysid: %d)", *sys1);

	if (tet_remsync(101L, sys1, 1, TIMEOUT, TET_SV_YES,
				(struct tet_synmsg *)0) != 0) {
		error(tet_errno, "tet_remsync() failed on master");
		tet_result(TET_UNRESOLVED);
	}
	else
		tet_result(TET_PASS);
}

static void tp2()
{
	int rescode = TET_UNRESOLVED;
	struct tet_synmsg msg;
	static char tdata[] = "test data";

	tet_infoline("This is tp2 in the third test case (tc3, master)");

	(void) tet_printf("send message \"%s\" to slave (sysid: %d)",
			  tdata, *sys1);

	msg.tsm_flags = TET_SMSNDMSG;
	msg.tsm_dlen = sizeof(tdata);
	msg.tsm_data = tdata;

	if (tet_remsync(201L, sys1, 1, TIMEOUT, TET_SV_YES, &msg) != 0)
		error(tet_errno, "tet_remsync() failed on master");
	else if ((msg.tsm_flags & TET_SMSNDMSG) == 0)
		error(0, "tet_remsync() cleared TET_SMSNDMSG flag on master");
	else if (msg.tsm_flags & TET_SMTRUNC)
		error(0, "tet_remsync() set TET_SMTRUNC flag on master");
	else
		rescode = TET_PASS;

	tet_result(rescode);
}

void (*tet_startup)() = NULL, (*tet_cleanup)() = NULL;

struct tet_testlist tet_testlist[] = { {tp1,1}, {tp2,2}, {NULL,0} };


--- NEW FILE: makefile ---
# 
#       SCCS:  @(#)makefile	1.5 (96/12/19) 
# 
#  (C) Copyright 1994 UniSoft Ltd., London, England
# 
#  All rights reserved.  No part of this source code may be reproduced,
#  stored in a retrieval system, or transmitted, in any form or by any
#  means, electronic, mechanical, photocopying, recording or otherwise,
#  except as stated in the end-user licence agreement, without the prior
#  permission of the copyright owners.
#
#
# ***********************************************************************
#
# SCCS:   	@(#)makefile	1.5 96/12/19 TETware release 3.3
# NAME:		makefile
# PRODUCT:	TETware
# AUTHOR:	Denis McConalogue, UniSoft Ltd.
# DATE CREATED:	October 1993
#
# DESCRIPTION:
#	TETware demonstration makefile (master system)
#
#	please refer to the chapter entitled "Running the TETware
#	demonstration" in the TETware Installation and User Guide for
#	instructions on how to customise this file for your installation
#
# MODIFICATIONS:
#	Andrew Dingwall, UniSoft Ltd., November 1996
#	changes for Windows NT
#
# ***********************************************************************

# include file and library locations - don't change
LIBDIR	= ../../lib/tet3
INCDIR	= ../../inc/tet3

# SGS definitions - customise as required for your system
# name of the C compiler
CC	= cc
# the following is appropriate when using the defined build environment
# on a Windows NT system
# CC = cl -nologo

# flags for the C compiler
CFLAGS	= -I$(INCDIR)

# system libraries:
# the socket version on SVR4 and Solaris usually needs -lsocket -lnsl
# the XTI version usually needs -lxti
# the Windows NT version needs wsock32.lib
SYSLIBS = 

# suffixes - customise as required for your system
# object file suffix - .o on UNIX, .obj on Windows NT
O = .o
# archive library suffix - .a on UNIX, .lib on Windows NT
A = .a
# executable file suffix - blank on UNIX, .exe on Windows NT
E =

all:	tc1$E tc2$E tc3$E

tc1$E:	tc1.c $(INCDIR)/tet_api.h
	$(CC) $(CFLAGS) -o tc1$E tc1.c $(LIBDIR)/tcm$O $(LIBDIR)/libapi$A \
		$(SYSLIBS)

tc2$E:	tc2.c $(INCDIR)/tet_api.h
	$(CC) $(CFLAGS) -o tc2$E tc2.c $(LIBDIR)/tcm$O $(LIBDIR)/libapi$A \
		$(SYSLIBS)

tc3$E:	tc3.c $(INCDIR)/tet_api.h
	$(CC) $(CFLAGS) -o tc3$E tc3.c $(LIBDIR)/tcm$O $(LIBDIR)/libapi$A \
		$(SYSLIBS)


--- NEW FILE: tc2.c ---
/*
 *      SCCS:  @(#)tc2.c	1.3 (96/10/11) 
 *
 * (C) Copyright 1994 UniSoft Ltd., London, England
 *
 * All rights reserved.  No part of this source code may be reproduced,
 * stored in a retrieval system, or transmitted, in any form or by any
 * means, electronic, mechanical, photocopying, recording or otherwise,
 * except as stated in the end-user licence agreement, without the prior
 * permission of the copyright owners.
 */

#ifndef lint
static char sccsid[] = "@(#)tc2.c	1.3 (96/10/11) TET3 release 3.3";
#endif

/************************************************************************

SCCS:   	@(#)tc2.c	1.3 96/10/11 TETware release 3.3
NAME:		tc2.c
PRODUCT:	TETware
AUTHOR:		Denis McConalogue, UniSoft Ltd.
DATE CREATED:	October 1993

DESCRIPTION:
	demo test suite master system test case 2

MODIFICATIONS:

************************************************************************/

#include <stdlib.h>
#include <tet_api.h>

void (*tet_startup)() = NULL, (*tet_cleanup)() = NULL;
void tp1();

struct tet_testlist tet_testlist[] = { {tp1,1}, {NULL,0} };

void tp1()
{
	static char *lines[] = {
		"This is the second test case (tc2, master).",
		"",
		"The master part of this test purpose reports PASS",
		"but the slave part of this test purpose reports FAIL",
		"so the consolidated result of the test purpose is FAIL.",
		"",
		"The lines in this block of text are printed by a single",
		"call to tet_minfoline() in the master part of the test",
		"purpose so output from the slave part of the test purpose",
		"won't be mixed up with these lines."
	};
	static int Nlines = sizeof lines / sizeof lines[0];

	tet_minfoline(lines, Nlines);
	tet_result(TET_PASS);
}




More information about the xorg-test-commit mailing list