Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

get rid of TESTFILE and almost get rid of MYFILE

  • Loading branch information...
commit e315485e1413f44da7149d59247b8aa09c5ca2b7 1 parent dc9e0bd
@bronson authored
View
5 TODO
@@ -100,11 +100,6 @@
0.98:
- Document tmtest and testfile with naturaldocs?
- This should be an example of how to print all important variables.
- for i in MYFILE TESTFILE PWD; do
- eval o=\$$i
- echo $i: $o
- done
- Change the I/O scheme to be event based. Get rid of the tempfiles.
Convert to using the async io library. Don't use temporary files.
This would allow us to recognize that the test is disabled before
View
505 stscan.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.10 on Mon Feb 27 20:04:36 2006 */
+/* Generated by re2c 0.13.5 on Mon Feb 21 20:40:42 2011 */
/* stscan.re
* Scott Bronson
@@ -30,13 +30,11 @@ int stscan_start(scanstate *ss)
{
YYCTYPE yych;
- goto yy0;
- ++YYCURSOR;
-yy0:
- if((YYLIMIT - YYCURSOR) < 8) YYFILL(8);
+
+ if ((YYLIMIT - YYCURSOR) < 8) YYFILL(8);
yych = *YYCURSOR;
- switch(yych){
- case 0x0A: goto yy10;
+ switch (yych) {
+ case '\n': goto yy10;
case 'A': goto yy7;
case 'C': goto yy3;
case 'D': goto yy6;
@@ -45,383 +43,432 @@ int stscan_start(scanstate *ss)
case 'S': goto yy2;
default: goto yy8;
}
-yy2: yych = *++YYCURSOR;
- switch(yych){
- case 'T': goto yy77;
+yy2:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'T': goto yy78;
default: goto yy9;
}
-yy3: yych = *++YYCURSOR;
- switch(yych){
- case 'O': goto yy67;
+yy3:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'O': goto yy68;
default: goto yy9;
}
-yy4: yych = *++YYCURSOR;
- switch(yych){
- case 'R': goto yy55;
+yy4:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R': goto yy56;
default: goto yy9;
}
-yy5: yych = *++YYCURSOR;
- switch(yych){
+yy5:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'U': goto yy44;
default: goto yy9;
}
-yy6: yych = *++YYCURSOR;
- switch(yych){
+yy6:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'I': goto yy23;
case 'O': goto yy24;
default: goto yy9;
}
-yy7: yych = *++YYCURSOR;
- switch(yych){
+yy7:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'B': goto yy12;
default: goto yy9;
}
-yy8: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
+yy8:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy9;
-yy9: switch(yych){
- case 0x0A: goto yy10;
+yy9:
+ switch (yych) {
+ case '\n': goto yy10;
default: goto yy8;
}
-yy10: ++YYCURSOR;
- goto yy11;
-yy11:
+yy10:
+ ++YYCURSOR;
-{ return stGARBAGE; }
+ { return stGARBAGE; }
-yy12: yych = *++YYCURSOR;
- switch(yych){
+yy12:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'O': goto yy13;
default: goto yy9;
}
-yy13: yych = *++YYCURSOR;
- switch(yych){
+yy13:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'R': goto yy14;
default: goto yy9;
}
-yy14: yych = *++YYCURSOR;
- switch(yych){
+yy14:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'T': goto yy15;
default: goto yy9;
}
-yy15: yych = *++YYCURSOR;
- switch(yych){
+yy15:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'E': goto yy16;
default: goto yy9;
}
-yy16: yych = *++YYCURSOR;
- switch(yych){
+yy16:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'D': goto yy17;
default: goto yy9;
}
-yy17: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
+yy17:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy18;
-yy18: switch(yych){
- case 0x09: case ' ': goto yy17;
- case 0x0A: goto yy10;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy17;
+ case '\n': goto yy10;
case ':': goto yy19;
default: goto yy8;
}
-yy19: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
+yy19:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy20;
-yy20: switch(yych){
- case 0x0A: goto yy21;
+ switch (yych) {
+ case '\n': goto yy21;
default: goto yy19;
}
-yy21: ++YYCURSOR;
- goto yy22;
-yy22:
+yy21:
+ ++YYCURSOR;
-{ return stABORTED; }
+ { return stABORTED; }
-yy23: yych = *++YYCURSOR;
- switch(yych){
+yy23:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'S': goto yy33;
default: goto yy9;
}
-yy24: yych = *++YYCURSOR;
- switch(yych){
+yy24:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'N': goto yy25;
default: goto yy9;
}
-yy25: yych = *++YYCURSOR;
- switch(yych){
+yy25:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'E': goto yy26;
default: goto yy9;
}
-yy26: yych = *++YYCURSOR;
- switch(yych){
- case 0x09: case ' ': goto yy29;
- case 0x0A: goto yy27;
+yy26:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy29;
+ case '\n': goto yy27;
default: goto yy8;
}
-yy27: ++YYCURSOR;
- goto yy28;
-yy28:
+yy27:
+ ++YYCURSOR;
-{ return stDONE; }
+ { return stDONE; }
-yy29: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
+yy29:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy30;
-yy30: switch(yych){
- case 0x09: case ' ': goto yy29;
- case 0x0A: goto yy27;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy29;
+ case '\n': goto yy27;
default: goto yy31;
}
-yy31: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
+yy31:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy32;
-yy32: switch(yych){
- case 0x0A: goto yy27;
+ switch (yych) {
+ case '\n': goto yy27;
default: goto yy31;
}
-yy33: yych = *++YYCURSOR;
- switch(yych){
+yy33:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'A': goto yy34;
default: goto yy9;
}
-yy34: yych = *++YYCURSOR;
- switch(yych){
+yy34:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'B': goto yy35;
default: goto yy9;
}
-yy35: yych = *++YYCURSOR;
- switch(yych){
+yy35:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'L': goto yy36;
default: goto yy9;
}
-yy36: yych = *++YYCURSOR;
- switch(yych){
+yy36:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'E': goto yy37;
default: goto yy9;
}
-yy37: yych = *++YYCURSOR;
- switch(yych){
+yy37:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'D': goto yy38;
default: goto yy9;
}
-yy38: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
+yy38:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy39;
-yy39: switch(yych){
- case 0x09: case ' ': goto yy38;
- case 0x0A: goto yy10;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy38;
+ case '\n': goto yy10;
case ':': goto yy40;
default: goto yy8;
}
-yy40: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
+yy40:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy41;
-yy41: switch(yych){
- case 0x0A: goto yy42;
+ switch (yych) {
+ case '\n': goto yy42;
default: goto yy40;
}
-yy42: ++YYCURSOR;
- goto yy43;
-yy43:
+yy42:
+ ++YYCURSOR;
-{ return stDISABLED; }
+ { return stDISABLED; }
-yy44: yych = *++YYCURSOR;
- switch(yych){
+yy44:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'N': goto yy45;
default: goto yy9;
}
-yy45: yych = *++YYCURSOR;
- switch(yych){
+yy45:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'N': goto yy46;
default: goto yy9;
}
-yy46: yych = *++YYCURSOR;
- switch(yych){
+yy46:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'I': goto yy47;
default: goto yy9;
}
-yy47: yych = *++YYCURSOR;
- switch(yych){
+yy47:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'N': goto yy48;
default: goto yy9;
}
-yy48: yych = *++YYCURSOR;
- switch(yych){
+yy48:
+ yych = *++YYCURSOR;
+ switch (yych) {
case 'G': goto yy49;
default: goto yy9;
}
-yy49: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- goto yy50;
-yy50: switch(yych){
- case 0x09: case ' ': goto yy49;
- case 0x0A: goto yy10;
- case ':': goto yy51;
+yy49:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy52;
+ case '\n': goto yy50;
default: goto yy8;
}
-yy51: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
+yy50:
+ ++YYCURSOR;
+
+ { return stRUNNING; }
+
+yy52:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy52;
-yy52: switch(yych){
- case 0x0A: goto yy53;
- default: goto yy51;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy52;
+ case '\n': goto yy50;
+ default: goto yy54;
}
-yy53: ++YYCURSOR;
- goto yy54;
yy54:
-
-{ return stRUNNING; }
-
-yy55: yych = *++YYCURSOR;
- switch(yych){
- case 'E': goto yy56;
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '\n': goto yy50;
+ default: goto yy54;
+ }
+yy56:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E': goto yy57;
default: goto yy9;
}
-yy56: yych = *++YYCURSOR;
- switch(yych){
- case 'P': goto yy57;
+yy57:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'P': goto yy58;
default: goto yy9;
}
-yy57: yych = *++YYCURSOR;
- switch(yych){
- case 'A': goto yy58;
+yy58:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'A': goto yy59;
default: goto yy9;
}
-yy58: yych = *++YYCURSOR;
- switch(yych){
- case 'R': goto yy59;
+yy59:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R': goto yy60;
default: goto yy9;
}
-yy59: yych = *++YYCURSOR;
- switch(yych){
- case 'E': goto yy60;
+yy60:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E': goto yy61;
default: goto yy9;
}
-yy60: yych = *++YYCURSOR;
- switch(yych){
- case 0x09: case ' ': goto yy63;
- case 0x0A: goto yy61;
+yy61:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy64;
+ case '\n': goto yy62;
default: goto yy8;
}
-yy61: ++YYCURSOR;
- goto yy62;
yy62:
+ ++YYCURSOR;
-{ return stPREPARE; }
+ { return stPREPARE; }
-yy63: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
+yy64:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy64;
-yy64: switch(yych){
- case 0x09: case ' ': goto yy63;
- case 0x0A: goto yy61;
- default: goto yy65;
- }
-yy65: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy64;
+ case '\n': goto yy62;
+ default: goto yy66;
+ }
+yy66:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy66;
-yy66: switch(yych){
- case 0x0A: goto yy61;
- default: goto yy65;
+ switch (yych) {
+ case '\n': goto yy62;
+ default: goto yy66;
}
-yy67: yych = *++YYCURSOR;
- switch(yych){
- case 'N': goto yy68;
+yy68:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'N': goto yy69;
default: goto yy9;
}
-yy68: yych = *++YYCURSOR;
- switch(yych){
- case 'F': goto yy69;
+yy69:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'F': goto yy70;
default: goto yy9;
}
-yy69: yych = *++YYCURSOR;
- switch(yych){
- case 'I': goto yy70;
+yy70:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'I': goto yy71;
default: goto yy9;
}
-yy70: yych = *++YYCURSOR;
- switch(yych){
- case 'G': goto yy71;
+yy71:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'G': goto yy72;
default: goto yy9;
}
-yy71: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
+yy72:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy72;
-yy72: switch(yych){
- case 0x09: case ' ': goto yy71;
- case 0x0A: goto yy10;
- case ':': goto yy73;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy72;
+ case '\n': goto yy10;
+ case ':': goto yy74;
default: goto yy8;
}
-yy73: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
+yy74:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy74;
-yy74: switch(yych){
- case 0x0A: goto yy75;
- default: goto yy73;
+ switch (yych) {
+ case '\n': goto yy76;
+ default: goto yy74;
}
-yy75: ++YYCURSOR;
- goto yy76;
yy76:
+ ++YYCURSOR;
-{ return stCONFIG; }
+ { return stCONFIG; }
-yy77: yych = *++YYCURSOR;
- switch(yych){
- case 'A': goto yy78;
+yy78:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'A': goto yy79;
default: goto yy9;
}
-yy78: yych = *++YYCURSOR;
- switch(yych){
- case 'R': goto yy79;
+yy79:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R': goto yy80;
default: goto yy9;
}
-yy79: yych = *++YYCURSOR;
- switch(yych){
- case 'T': goto yy80;
+yy80:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'T': goto yy81;
default: goto yy9;
}
-yy80: yych = *++YYCURSOR;
- switch(yych){
- case 0x09: case ' ': goto yy83;
- case 0x0A: goto yy81;
+yy81:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy84;
+ case '\n': goto yy82;
default: goto yy8;
}
-yy81: ++YYCURSOR;
- goto yy82;
yy82:
+ ++YYCURSOR;
-{ return stSTART; }
+ { return stSTART; }
-yy83: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
+yy84:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy84;
-yy84: switch(yych){
- case 0x09: case ' ': goto yy83;
- case 0x0A: goto yy81;
- default: goto yy85;
- }
-yy85: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy84;
+ case '\n': goto yy82;
+ default: goto yy86;
+ }
+yy86:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- goto yy86;
-yy86: switch(yych){
- case 0x0A: goto yy81;
- default: goto yy85;
+ switch (yych) {
+ case '\n': goto yy82;
+ default: goto yy86;
}
}
View
2  stscan.re
@@ -34,7 +34,7 @@ HASARG = WS* ":" ANYN* "\n";
"START" NOARG { return stSTART; }
"CONFIG" HASARG { return stCONFIG; }
"PREPARE" NOARG { return stPREPARE; }
-"RUNNING" HASARG { return stRUNNING; }
+"RUNNING" NOARG { return stRUNNING; }
"DONE" NOARG { return stDONE; }
"ABORTED" HASARG { return stABORTED; }
View
5 template.sh
@@ -5,8 +5,6 @@ ABORT () { echo "ABORTED: $*" >&%(STATUSFD); exit 0; }
DISABLED () { echo "DISABLED: $*" >&%(STATUSFD); exit 0; }
DISABLE () { DISABLED $*; }
-TESTFILE='%(TESTFILE)'
-
%(CONFIG_FILES)
echo PREPARE >&%(STATUSFD)
@@ -16,8 +14,7 @@ STDOUT: () { exit 0; }
STDERR () { exit 0; }
STDERR: () { exit 0; }
-echo 'RUNNING: %(TESTFILE)' >&%(STATUSFD)
-MYFILE='%(TESTFILE)'
+echo RUNNING >&%(STATUSFD)
exec >&%(OUTFD) 2>&%(ERRFD) %(OUTFD)>&- %(ERRFD)>&-
%(TESTEXEC)
View
6 test.c
@@ -199,11 +199,11 @@ void scan_status_file(struct test *test)
case stRUNNING:
if(test->status == test_pending) {
test->status = test_was_started;
- if(copy_status_arg(token_start(&ss), token_end(&ss), lastfile, sizeof(lastfile))) {
+ if(strlen(test->testfilename) < sizeof(lastfile)) {
+ strcpy(lastfile, test->testfilename);
lastfile_good = 1;
} else {
- fprintf(stderr, "RUNNING needs arg on line %d of the status file: '%.*s'\n",
- ss.line, (int)token_length(&ss)-1, token_start(&ss));
+ fprintf(stderr, "RUNNING lastfile is not big enough for %s", test->testfilename);
}
} else {
fprintf(stderr, "RUNNING but status (%d) wasn't pending on line %d of the status file: '%.*s'\n",
View
14 test/01-testfile/20-TestVars.test
@@ -1,14 +0,0 @@
-# Ensure variables are set up plausibly when we're running a test
-# from stdin.
-
-$tmtest $args -o -q - <<-'EOL' | sed "s/^/ /"
- echo MYFILE: "$MYFILE"
- echo TESTFILE: "$TESTFILE"
-EOL
-
-STDOUT:
- echo MYFILE: "$MYFILE"
- echo TESTFILE: "$TESTFILE"
- STDOUT:
- MYFILE: (STDIN)
- TESTFILE: (STDIN)
View
20 test/01-testfile/21-TestVarsABS.test
@@ -1,20 +0,0 @@
-# Make sure the variables are set up correctly when we are running a
-# test with an absolute pathname.
-
-cat > tt <<-'EOL'
- echo MYFILE: "$MYFILE"
- echo TESTFILE: "$TESTFILE"
-EOL
-
-$tmtest $args --ignore-extension -o -q tt | \
- sed -e "s/${PWD//\//\\/}/\/tmp\/DIR/g" -e "s/^/ /"
-
-rm tt
-
-
-STDOUT:
- echo MYFILE: "$MYFILE"
- echo TESTFILE: "$TESTFILE"
- STDOUT:
- MYFILE: /tmp/DIR/tt
- TESTFILE: /tmp/DIR/tt
View
20 test/01-testfile/22-TestVarsRel.test
@@ -1,20 +0,0 @@
-# Make sure the variables are set up correctly when we are running a
-# test with a relative pathname.
-
-cat > tt <<-'EOL'
- echo MYFILE: "$MYFILE"
- echo TESTFILE: "$TESTFILE"
-EOL
-
-$tmtest $args --ignore-extension -o -q . | \
- sed -e "s/${PWD//\//\\/}/\/tmp\/DIR/g" -e "s/^/ /"
-
-rm tt
-
-
-STDOUT:
- echo MYFILE: "$MYFILE"
- echo TESTFILE: "$TESTFILE"
- STDOUT:
- MYFILE: /tmp/DIR/tt
- TESTFILE: /tmp/DIR/tt
View
22 test/01-testfile/23-TestVarsDeep.test
@@ -1,22 +0,0 @@
-# Make sure the variables are set up correctly when we are running a
-# test with a relative pathname.
-
-mkdir -p do/di
-
-cat > do/di/tt.test <<-'EOL'
- echo MYFILE: "$MYFILE"
- echo TESTFILE: "$TESTFILE"
-EOL
-
-(cd do && $tmtest $config -o -q di/tt.test) | \
- sed -e "s/${PWD//\//\\/}/\/tmp\/DIR/g" -e "s/^/ /"
-
-rm -rf do
-
-
-STDOUT:
- echo MYFILE: "$MYFILE"
- echo TESTFILE: "$TESTFILE"
- STDOUT:
- MYFILE: /tmp/DIR/do/di/tt.test
- TESTFILE: /tmp/DIR/do/di/tt.test
View
19 test/01-testfile/24-TestVarsRoot.test
@@ -1,19 +0,0 @@
-# Make sure the variables are set up correctly when we are running a
-# test with a relative pathname.
-
-cat > tt <<-'EOL'
- echo MYFILE: "$MYFILE"
- echo TESTFILE: "$TESTFILE"
-EOL
-
-$tmtest $args --ignore-extension -o -q . | \
- sed -e "s/${PWD//\//\\/}/\/tmp\/DIR/g" -e "s/^/ /"
-
-rm tt
-
-STDOUT:
- echo MYFILE: "$MYFILE"
- echo TESTFILE: "$TESTFILE"
- STDOUT:
- MYFILE: /tmp/DIR/tt
- TESTFILE: /tmp/DIR/tt
View
5 test/01-testfile/dumpscript/10-Stdout.test
@@ -15,8 +15,6 @@ STDOUT:
DISABLED () { echo "DISABLED: $*" >&FD; exit 0; }
DISABLE () { DISABLED $*; }
- TESTFILE='(STDIN)'
-
echo 'CONFIG: ...tmtest.sub.conf' >STATUSFD
MYFILE='...tmtest.sub.conf'
. '...tmtest.sub.conf'
@@ -29,8 +27,7 @@ STDOUT:
STDERR () { exit 0; }
STDERR: () { exit 0; }
- echo 'RUNNING: (STDIN)' >&FD
- MYFILE='(STDIN)'
+ echo RUNNING >&FD
exec >&FD FD>&FD FD>&- FD>&-
LINENO=0
this test is never run but we do need to specify a file so tmtest
View
5 test/01-testfile/dumpscript/11-AbsoluteDir.test
@@ -29,8 +29,6 @@ STDOUT:
DISABLED () { echo "DISABLED: $*" >&FD; exit 0; }
DISABLE () { DISABLED $*; }
- TESTFILE='/tmp/DIR/dd/tt.test'
-
echo 'CONFIG: ...tmtest.sub.conf' >STATUSFD
MYFILE='...tmtest.sub.conf'
. '...tmtest.sub.conf'
@@ -46,8 +44,7 @@ STDOUT:
STDERR () { exit 0; }
STDERR: () { exit 0; }
- echo 'RUNNING: /tmp/DIR/dd/tt.test' >&FD
- MYFILE='/tmp/DIR/dd/tt.test'
+ echo RUNNING >&FD
exec >&FD FD>&FD FD>&- FD>&-
. '/tmp/DIR/dd/tt.test'
View
5 test/01-testfile/dumpscript/12-TrailingParentDir.test
@@ -34,8 +34,6 @@ STDOUT:
DISABLED () { echo "DISABLED: $*" >&FD; exit 0; }
DISABLE () { DISABLED $*; }
- TESTFILE='/tmp/DIR/do/di/tt.test'
-
echo 'CONFIG: ...tmtest.sub.conf' >STATUSFD
MYFILE='...tmtest.sub.conf'
. '...tmtest.sub.conf'
@@ -54,8 +52,7 @@ STDOUT:
STDERR () { exit 0; }
STDERR: () { exit 0; }
- echo 'RUNNING: /tmp/DIR/do/di/tt.test' >&FD
- MYFILE='/tmp/DIR/do/di/tt.test'
+ echo RUNNING >&FD
exec >&FD FD>&FD FD>&- FD>&-
. '/tmp/DIR/do/di/tt.test'
View
5 test/01-testfile/dumpscript/13-BareParentDir.test
@@ -34,8 +34,6 @@ STDOUT:
DISABLED () { echo "DISABLED: $*" >&FD; exit 0; }
DISABLE () { DISABLED $*; }
- TESTFILE='/tmp/DIR/do/di/tt.test'
-
echo 'CONFIG: ...tmtest.sub.conf' >STATUSFD
MYFILE='...tmtest.sub.conf'
. '...tmtest.sub.conf'
@@ -54,8 +52,7 @@ STDOUT:
STDERR () { exit 0; }
STDERR: () { exit 0; }
- echo 'RUNNING: /tmp/DIR/do/di/tt.test' >&FD
- MYFILE='/tmp/DIR/do/di/tt.test'
+ echo RUNNING >&FD
exec >&FD FD>&FD FD>&- FD>&-
. '/tmp/DIR/do/di/tt.test'
View
5 test/01-testfile/dumpscript/14-DeepDir.test
@@ -34,8 +34,6 @@ STDOUT:
DISABLED () { echo "DISABLED: $*" >&FD; exit 0; }
DISABLE () { DISABLED $*; }
- TESTFILE='/tmp/DIR/do/di/tt.test'
-
echo 'CONFIG: ...tmtest.sub.conf' >STATUSFD
MYFILE='...tmtest.sub.conf'
. '...tmtest.sub.conf'
@@ -54,8 +52,7 @@ STDOUT:
STDERR () { exit 0; }
STDERR: () { exit 0; }
- echo 'RUNNING: /tmp/DIR/do/di/tt.test' >&FD
- MYFILE='/tmp/DIR/do/di/tt.test'
+ echo RUNNING >&FD
exec >&FD FD>&FD FD>&- FD>&-
. '/tmp/DIR/do/di/tt.test'
View
5 test/01-testfile/dumpscript/15-PathOps.test
@@ -25,8 +25,6 @@ STDOUT:
DISABLED () { echo "DISABLED: $*" >&FD; exit 0; }
DISABLE () { DISABLED $*; }
- TESTFILE='/tmp/DIR/dd/tt.test'
-
echo 'CONFIG: ...tmtest.sub.conf' >STATUSFD
MYFILE='...tmtest.sub.conf'
. '...tmtest.sub.conf'
@@ -42,8 +40,7 @@ STDOUT:
STDERR () { exit 0; }
STDERR: () { exit 0; }
- echo 'RUNNING: /tmp/DIR/dd/tt.test' >&FD
- MYFILE='/tmp/DIR/dd/tt.test'
+ echo RUNNING >&FD
exec >&FD FD>&FD FD>&- FD>&-
. '/tmp/DIR/dd/tt.test'
View
5 test/01-testfile/dumpscript/16-AbsoluteDir.test
@@ -34,8 +34,6 @@ STDOUT:
DISABLED () { echo "DISABLED: $*" >&FD; exit 0; }
DISABLE () { DISABLED $*; }
- TESTFILE='/tmp/DIR/do/di/tt.test'
-
echo 'CONFIG: ...tmtest.sub.conf' >STATUSFD
MYFILE='...tmtest.sub.conf'
. '...tmtest.sub.conf'
@@ -54,8 +52,7 @@ STDOUT:
STDERR () { exit 0; }
STDERR: () { exit 0; }
- echo 'RUNNING: /tmp/DIR/do/di/tt.test' >&FD
- MYFILE='/tmp/DIR/do/di/tt.test'
+ echo RUNNING >&FD
exec >&FD FD>&FD FD>&- FD>&-
. '/tmp/DIR/do/di/tt.test'
View
3  test/01-testfile/dumpscript/README
@@ -1,3 +1,2 @@
These tests verify that the testfile can be named on the command
-line in any way possible, yet each config file gets included
-exactly once and MYFILE is normalized and correct each time.
+line in any way possible, yet each config file gets included once.
View
4 tmtest.pod
@@ -69,10 +69,6 @@ Therefore, /home/test/a/b/tmtest.conf overrides /home/test/tmtest.conf
It executes each config files every time it runs a test. If you're
running 40 tests, your config files will each get executed 40 times.
-Note that while config files are running, the current directory
-is set to the testfile's directory. For convenience the MYFILE
-variable gives the full pathname to the currently running config file.
-
Any output produced by the config files goes straight to the screen.
It will not contaminate the test results. tmtest only cares about
the output produced by the testfile itself.
View
15 vars.c
@@ -41,20 +41,6 @@
* Everywhere else we use Unix I/O. Ensure they never mix.
*/
-static int var_testfile(struct test *test, FILE* fp, const char *var)
-{
- if(test->testfilename[0] == '-' && test->testfilename[1] == '\0') {
- fprintf(fp, "(STDIN)");
- } else if(test->testfilename[0] == '/') {
- fprintf(fp, "%s", test->testfilename);
- } else {
- fprintf(fp, "%s/%s", test->testfiledir, test->testfilename);
- }
-
- return 0;
-}
-
-
static int var_testexec(struct test *test, FILE* fp, const char *var)
{
// If the filename is a dash, it means we should feed the test
@@ -259,7 +245,6 @@ int printvar(struct test *test, FILE *fp, const char *varname)
{ "OUTFD", var_outfd },
{ "ERRFD", var_errfd },
{ "STATUSFD", var_statusfd },
- { "TESTFILE", var_testfile },
{ "TESTEXEC", var_testexec },
};
Please sign in to comment.
Something went wrong with that request. Please try again.