makefile

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


Update of /cvs/xtest/xtest/src/tet3/demo/slave/ts
In directory gabe:/tmp/cvs-serv27930/src/tet3/demo/slave/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 slave 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 slave 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 sys0[] = { 0 };	/* 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, slave)");

	(void) tet_printf("sync with master (sysid: %d)", *sys0);

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

static void tp2()
{
	int rescode = TET_UNRESOLVED;
	struct tet_synmsg msg;
	char rcvbuf[TET_SMMSGMAX];

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

	(void) tet_printf("sync with master (sysid: %d) and receive data",
			  *sys0);

	msg.tsm_flags = TET_SMRCVMSG;
	msg.tsm_dlen = sizeof(rcvbuf);
	msg.tsm_data = rcvbuf;

	if (tet_remsync(201L, sys0, 1, TIMEOUT, TET_SV_YES, &msg) != 0)
		error(tet_errno, "tet_remsync() failed on slave");
	else if (msg.tsm_sysid == -1)
		error(0, "tet_remsync() set tsm_sysid to -1 on slave");
	else if (msg.tsm_flags & TET_SMTRUNC)
		error(0, "tet_remsync() set TET_SMTRUNC flag on slave");
	else if (msg.tsm_dlen <= 0)
		error(0, "tet_remsync() set tsm_dlen <= 0 on slave");
	else
	{
		(void) tet_printf("received message \"%.*s\" from master",
			msg.tsm_dlen, rcvbuf);
		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:
#	slave system demonstration makefile
#
#	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.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[] = "@(#)tc2.c	1.2 (96/08/15) TET3 release 3.3";
#endif

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

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

DESCRIPTION:
	demo test suite slave 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()
{
	tet_infoline("This is the second test case (tc2, slave)");

	tet_result(TET_FAIL);
}




More information about the xorg-test-commit mailing list