[Swift-commit] r3507 - trunk/tests

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Tue Aug 10 14:17:19 CDT 2010


Author: wozniak
Date: 2010-08-10 14:17:19 -0500 (Tue, 10 Aug 2010)
New Revision: 3507

Added:
   trunk/tests/array_iteration.check.sh
   trunk/tests/array_iteration.clean.sh
   trunk/tests/array_wildcard.check.sh
   trunk/tests/array_wildcard.clean.sh
   trunk/tests/default.check.sh
   trunk/tests/default.clean.sh
   trunk/tests/filesysmapper.check.sh
   trunk/tests/filesysmapper.clean.sh
   trunk/tests/filesysmapper.setup.sh
   trunk/tests/hello.check.sh
   trunk/tests/hello.clean.sh
Modified:
   trunk/tests/array_iteration.swift
   trunk/tests/array_wildcard.swift
   trunk/tests/default.swift
   trunk/tests/filesysmapper.swift
   trunk/tests/hello.swift
   trunk/tests/tc.template.data
Log:
Helper test scripts


Added: trunk/tests/array_iteration.check.sh
===================================================================
--- trunk/tests/array_iteration.check.sh	                        (rev 0)
+++ trunk/tests/array_iteration.check.sh	2010-08-10 19:17:19 UTC (rev 3507)
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -x
+
+FILES=( $( ls f[1-3].txt ) )
+(( ${#FILES[@]} == 3 )) || exit 1
+
+grep "hi there" < ${FILES[1]} || exit 1
+
+exit 0


Property changes on: trunk/tests/array_iteration.check.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/tests/array_iteration.clean.sh
===================================================================
--- trunk/tests/array_iteration.clean.sh	                        (rev 0)
+++ trunk/tests/array_iteration.clean.sh	2010-08-10 19:17:19 UTC (rev 3507)
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -x
+
+rm -v f[1-3].txt || exit 1
+
+exit 0


Property changes on: trunk/tests/array_iteration.clean.sh
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/tests/array_iteration.swift
===================================================================
--- trunk/tests/array_iteration.swift	2010-08-10 18:28:21 UTC (rev 3506)
+++ trunk/tests/array_iteration.swift	2010-08-10 19:17:19 UTC (rev 3507)
@@ -10,6 +10,7 @@
     }
 }
 
-string sa[] = ["hello","hi there","how are you"];
-file fa[];
-fa = echo_batch(sa);
+string m[] = ["hello","hi there","how are you"];
+string f[] = ["f1.txt", "f2.txt", "f3.txt"];
+file fa[]<array_mapper; files=f>;
+fa = echo_batch(m);

Added: trunk/tests/array_wildcard.check.sh
===================================================================
--- trunk/tests/array_wildcard.check.sh	                        (rev 0)
+++ trunk/tests/array_wildcard.check.sh	2010-08-10 19:17:19 UTC (rev 3507)
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -x
+
+grep "how are you" < hw.txt || exit 1
+
+exit 0


Property changes on: trunk/tests/array_wildcard.check.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/tests/array_wildcard.clean.sh
===================================================================
--- trunk/tests/array_wildcard.clean.sh	                        (rev 0)
+++ trunk/tests/array_wildcard.clean.sh	2010-08-10 19:17:19 UTC (rev 3507)
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -x
+
+rm -v hw.txt || exit 1
+
+exit 0


Property changes on: trunk/tests/array_wildcard.clean.sh
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/tests/array_wildcard.swift
===================================================================
--- trunk/tests/array_wildcard.swift	2010-08-10 18:28:21 UTC (rev 3506)
+++ trunk/tests/array_wildcard.swift	2010-08-10 19:17:19 UTC (rev 3507)
@@ -1,11 +1,8 @@
-type file {}
+type file;
 
-
-(file t) echo_wildcard (string s[]) {
-    app {
-        echo s[*] stdout=@filename(t);
-    }
+app (file t) echo_wildcard (string s[]) {
+  echo s[*] stdout=@filename(t);
 }
 
 string greetings[] = ["how","are","you"];
-file hw = echo_wildcard(greetings);
+file hw<"hw.txt"> = echo_wildcard(greetings);

Added: trunk/tests/default.check.sh
===================================================================
--- trunk/tests/default.check.sh	                        (rev 0)
+++ trunk/tests/default.check.sh	2010-08-10 19:17:19 UTC (rev 3507)
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -x
+
+grep "hello world" < hw1.txt || exit 1
+grep "hello again" < hw2.txt || exit 1
+
+exit 0


Property changes on: trunk/tests/default.check.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/tests/default.clean.sh
===================================================================
--- trunk/tests/default.clean.sh	                        (rev 0)
+++ trunk/tests/default.clean.sh	2010-08-10 19:17:19 UTC (rev 3507)
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -x
+
+rm hw[12].txt || exit 1
+
+exit 0


Property changes on: trunk/tests/default.clean.sh
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/tests/default.swift
===================================================================
--- trunk/tests/default.swift	2010-08-10 18:28:21 UTC (rev 3506)
+++ trunk/tests/default.swift	2010-08-10 19:17:19 UTC (rev 3507)
@@ -1,11 +1,13 @@
 type file {}
 
-(file t) echo (string s="hello world") { //s has a default value
-    app {
-        echo s stdout=@filename(t);		//redirect stdout to a file
-    }
+// s has a default value
+app (file t) echo (string s="hello world") {
+  // redirect stdout to a file
+  echo s stdout=@filename(t);
 }
 
-file hw1, hw2;
-hw1 = echo();		// procedure call using the default value
-hw2 = echo(s="hello again"); // using a different value
+file hw1<"hw1.txt">, hw2<"hw2.txt">;
+// procedure call using the default value
+hw1 = echo();
+// using a different value
+hw2 = echo(s="hello again");

Added: trunk/tests/filesysmapper.check.sh
===================================================================
--- trunk/tests/filesysmapper.check.sh	                        (rev 0)
+++ trunk/tests/filesysmapper.check.sh	2010-08-10 19:17:19 UTC (rev 3507)
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -x
+
+ls stdout.txt || exit 1
+COUNT=$( grep -c "file: [abc].dat" < stdout.txt )
+(( $COUNT == 3 )) || exit 1
+
+exit 0


Property changes on: trunk/tests/filesysmapper.check.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/tests/filesysmapper.clean.sh
===================================================================
--- trunk/tests/filesysmapper.clean.sh	                        (rev 0)
+++ trunk/tests/filesysmapper.clean.sh	2010-08-10 19:17:19 UTC (rev 3507)
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+rm -v [abc].dat || exit 1
+
+exit 0


Property changes on: trunk/tests/filesysmapper.clean.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/tests/filesysmapper.setup.sh
===================================================================
--- trunk/tests/filesysmapper.setup.sh	                        (rev 0)
+++ trunk/tests/filesysmapper.setup.sh	2010-08-10 19:17:19 UTC (rev 3507)
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -x
+
+touch a.dat b.dat c.dat || exit 1
+
+exit 0


Property changes on: trunk/tests/filesysmapper.setup.sh
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/tests/filesysmapper.swift
===================================================================
--- trunk/tests/filesysmapper.swift	2010-08-10 18:28:21 UTC (rev 3506)
+++ trunk/tests/filesysmapper.swift	2010-08-10 19:17:19 UTC (rev 3507)
@@ -1,6 +1,6 @@
 type file {};
 
-file files[]<filesys_mapper; patter="*">;
+file files[]<filesys_mapper; pattern="*.dat">;
 
 foreach f in files {
    tracef("file: %s\n", @filename(f));

Added: trunk/tests/hello.check.sh
===================================================================
--- trunk/tests/hello.check.sh	                        (rev 0)
+++ trunk/tests/hello.check.sh	2010-08-10 19:17:19 UTC (rev 3507)
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -x
+
+grep hello < hello.txt || exit 1
+
+exit 0


Property changes on: trunk/tests/hello.check.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/tests/hello.clean.sh
===================================================================
--- trunk/tests/hello.clean.sh	                        (rev 0)
+++ trunk/tests/hello.clean.sh	2010-08-10 19:17:19 UTC (rev 3507)
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -x
+
+rm -v hello.txt || exit 1
+
+exit 0


Property changes on: trunk/tests/hello.clean.sh
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/tests/hello.swift
===================================================================
--- trunk/tests/hello.swift	2010-08-10 18:28:21 UTC (rev 3506)
+++ trunk/tests/hello.swift	2010-08-10 19:17:19 UTC (rev 3507)
@@ -1,12 +1,7 @@
-type file {}
+type file;
 
-
-(file t) echo (string s) {
-    app {
-        echo s stdout=@filename(t);
-    }
+app (file t) echo (string s) {
+  echo s stdout=@filename(t);
 }
 
-file hw = echo("hello world");		// May need syntax to give a call a name.
-
-
+file hw<"hello.txt"> = echo("hello world");

Modified: trunk/tests/tc.template.data
===================================================================
--- trunk/tests/tc.template.data	2010-08-10 18:28:21 UTC (rev 3506)
+++ trunk/tests/tc.template.data	2010-08-10 19:17:19 UTC (rev 3507)
@@ -14,6 +14,7 @@
 localhost 	ls 		/bin/ls		INSTALLED	INTEL32::LINUX	null
 localhost 	grep 		/bin/grep	INSTALLED	INTEL32::LINUX	null
 localhost 	sort 		/bin/sort	INSTALLED	INTEL32::LINUX	null
-localhost 	paste 		/bin/paste	INSTALLED	INTEL32::LINUX	null
+localhost 	paste 		/bin/paste	INSTALLED	INTEL32::LINUX	nul
+localhost 	touch 		/bin/touch      INSTALLED	INTEL32::LINUX	null
 
 localhost       append          _DIR_/append.sh INSTALLED	INTEL32::LINUX	null




More information about the Swift-commit mailing list