2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: Rlogin.c /main/3 1995/10/31 11:52:58 rswiston $ */
31 #define SAVELOG fclose(TermLog); TermLog = fopen("term.log", "a");
37 static char *LogAction[] = {
38 /*0*/ "Testing Resource Option: loginShell True",
39 /*1*/ "Testing Resource Option: loginShell False",
40 /*2*/ "Testing Resource Option: loginShell on",
41 /*3*/ "Testing Resource Option: loginShell off",
45 static char *ResourceArr[] = {
46 /*0*/ "loginShell True",
47 /*1*/ "loginShell False",
48 /*2*/ "loginShell on",
49 /*2*/ "loginShell off",
52 int MakeResourceFile(ResArr)
57 char Resource[50], Value[50];
59 if ((ResFile = fopen("res", "w")) == NULL)
60 {LogError("Resource File Creation fail"); return(-1);}
61 for (i=0; i < 50; i++) Resource[i] = BLANK;
62 for (i=0; i < 50; i++) Value[i] = BLANK;
63 Len = strlen(ResArr); i=0;
66 while (ResArr[i] != BLANK) Resource[j++] = ResArr[i++];
67 Resource[j] = NULLCHAR;
69 while ((ResArr[i] != BLANK) && (ResArr[i] != NULLCHAR))
70 Value[j++] = ResArr[i++];
73 fprintf(ResFile, "%s*%s: %s\n", TERM_EMU, Resource, Value);
79 #define ArrCount (int) (sizeof(ResourceArr) / sizeof(char *))
86 char Command[NEED_LEN], *Shell, *Path, *CurDir;
90 if ((TermLog = fopen("term.log", "a")) == NULL) {
91 if ((TermLog = fopen("term.log", "w")) == NULL)
92 {printf("Logfile could not be opened \n"); exit(-1);}
94 LogError("****************************************************************************");
96 sprintf(Command, "TestName: <%s> STARTS\n", argv[0]);
101 Path = getenv("PATH");
102 CurDir = getenv("PWD");
103 ExecCommand("PATH=.:../bin:../util:/usr/bin/X11:/bin:/opt/dt/bin");
104 for (i=0; i < ArrCount; i++) {
106 ExecCommand("xrdb -load xrdb.out");
107 MakeResourceFile(ResourceArr[i]);
109 LogError(LogAction[i]);
110 strcpy(Command, "xrdb -merge res; ");
111 strcat(Command, TERM_EMU);
112 ExecCommand(Command); sleep(2);
113 if (WaitWinMap("TermWin") < 0) continue;
114 strcpy(Command, CurDir); strcat(Command, "/../util/");
117 strcat(Command, "test-ls");
118 ExecCommand(Command); break;
120 strcat(Command, "test+ls");
121 ExecCommand(Command); break;
123 strcat(Command, "test-ls");
124 ExecCommand(Command); break;
126 strcat(Command, "test+ls");
127 ExecCommand(Command); break;
129 CloseTerm("TermWin");
130 WaitWinUnMap("TermWin", 10L);
133 strcpy(Command, "PATH=");
134 strcat(Command, Path);
135 ExecCommand(Command);
137 ExecCommand("xrdb -load xrdb.out");
140 sprintf(Command, "TestName: <%s> ENDS\n", argv[0]);
142 LogError("****************************************************************************");