[Swift-commit] r4629 - in trunk/tests: . documentation

achavez at ci.uchicago.edu achavez at ci.uchicago.edu
Fri Jun 17 14:52:39 CDT 2011


Author: achavez
Date: 2011-06-17 14:52:39 -0500 (Fri, 17 Jun 2011)
New Revision: 4629

Added:
   trunk/tests/documentation/
   trunk/tests/documentation/3-1_hello_world.check.sh
   trunk/tests/documentation/3-1_hello_world.clean.sh
   trunk/tests/documentation/3-1_hello_world.swift
   trunk/tests/documentation/4-1-2_many_parameters.check.sh
   trunk/tests/documentation/4-1-2_many_parameters.clean.sh
   trunk/tests/documentation/4-1-2_many_parameters.swift
   trunk/tests/documentation/4-1_parameter.check.sh
   trunk/tests/documentation/4-1_parameter.clean.sh
   trunk/tests/documentation/4-1_parameter.swift
   trunk/tests/documentation/4-2_adding_another_application.check.sh
   trunk/tests/documentation/4-2_adding_another_application.clean.sh
   trunk/tests/documentation/4-2_adding_another_application.swift
   trunk/tests/documentation/4-4_datatypes.check.sh
   trunk/tests/documentation/4-4_datatypes.clean.sh
   trunk/tests/documentation/4-4_datatypes.swift
   trunk/tests/documentation/4-5_arrays.check.sh
   trunk/tests/documentation/4-5_arrays.clean.sh
   trunk/tests/documentation/4-5_arrays.swift
   trunk/tests/documentation/4-6-2_fixed_array_mapper.check.sh
   trunk/tests/documentation/4-6-2_fixed_array_mapper.clean.sh
   trunk/tests/documentation/4-6-2_fixed_array_mapper.swift
   trunk/tests/documentation/4-7_foreach.check.sh
   trunk/tests/documentation/4-7_foreach.clean.sh
   trunk/tests/documentation/4-7_foreach.swift
   trunk/tests/documentation/4-9_sequential_iteration.check.sh
   trunk/tests/documentation/4-9_sequential_iteration.clean.sh
   trunk/tests/documentation/4-9_sequential_iteration.swift
   trunk/tests/documentation/6-1_named_and_optional_params.check.sh
   trunk/tests/documentation/6-1_named_and_optional_params.clean.sh
   trunk/tests/documentation/6-1_named_and_optional_params.swift
   trunk/tests/documentation/swift.log
   trunk/tests/documentation/tc.data
   trunk/tests/documentation/tc.template.data
   trunk/tests/documentation/title.txt
Log:
Test group of the documentation

Added: trunk/tests/documentation/3-1_hello_world.check.sh
===================================================================
--- trunk/tests/documentation/3-1_hello_world.check.sh	                        (rev 0)
+++ trunk/tests/documentation/3-1_hello_world.check.sh	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,5 @@
+#!/bin/bash
+set -x
+grep 'Hello, world!' hello.txt || exit 1
+
+exit 0


Property changes on: trunk/tests/documentation/3-1_hello_world.check.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/documentation/3-1_hello_world.clean.sh
===================================================================
--- trunk/tests/documentation/3-1_hello_world.clean.sh	                        (rev 0)
+++ trunk/tests/documentation/3-1_hello_world.clean.sh	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -x
+rm -rf 3-1_hello_world-* 3-1_hello_world.kml 3-1_hello_world.xml hello.txt || exit 1
+exit 0


Property changes on: trunk/tests/documentation/3-1_hello_world.clean.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/documentation/3-1_hello_world.swift
===================================================================
--- trunk/tests/documentation/3-1_hello_world.swift	                        (rev 0)
+++ trunk/tests/documentation/3-1_hello_world.swift	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,8 @@
+type messagefile;
+
+app (messagefile t) greeting() {
+	echo "Hello, world!" stdout=@filename(t);
+}
+
+messagefile outfile <"hello.txt">;
+outfile = greeting();

Added: trunk/tests/documentation/4-1-2_many_parameters.check.sh
===================================================================
--- trunk/tests/documentation/4-1-2_many_parameters.check.sh	                        (rev 0)
+++ trunk/tests/documentation/4-1-2_many_parameters.check.sh	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,5 @@
+#!/bin/bash
+set -x
+grep 'hello' english.txt | grep 'bonjour' francais.txt | grep 'konnichiwa' nihongo.txt || exit 1
+
+exit 0


Property changes on: trunk/tests/documentation/4-1-2_many_parameters.check.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/documentation/4-1-2_many_parameters.clean.sh
===================================================================
--- trunk/tests/documentation/4-1-2_many_parameters.clean.sh	                        (rev 0)
+++ trunk/tests/documentation/4-1-2_many_parameters.clean.sh	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -x
+rm -rf 4-1-2_many_parameters-* 4-1-2_many_parameters.kml 4-1-2_many_parameters.xml english.txt francais.txt nihongo.txt|| exit 1
+exit 0


Property changes on: trunk/tests/documentation/4-1-2_many_parameters.clean.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/documentation/4-1-2_many_parameters.swift
===================================================================
--- trunk/tests/documentation/4-1-2_many_parameters.swift	                        (rev 0)
+++ trunk/tests/documentation/4-1-2_many_parameters.swift	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,14 @@
+type messagefile;
+
+app (messagefile t) greeting (string s) {
+	echo s stdout=@filename(t);
+}
+
+messagefile english <"english.txt">;
+messagefile french <"francais.txt">;
+english = greeting("hello");
+french = greeting("bonjour");
+
+messagefile japanese <"nihongo.txt">;
+japanese = greeting("konnichiwa");
+

Added: trunk/tests/documentation/4-1_parameter.check.sh
===================================================================
--- trunk/tests/documentation/4-1_parameter.check.sh	                        (rev 0)
+++ trunk/tests/documentation/4-1_parameter.check.sh	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -x
+grep 'hello world' hello2.txt || exit 1
+exit 0


Property changes on: trunk/tests/documentation/4-1_parameter.check.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/documentation/4-1_parameter.clean.sh
===================================================================
--- trunk/tests/documentation/4-1_parameter.clean.sh	                        (rev 0)
+++ trunk/tests/documentation/4-1_parameter.clean.sh	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -x
+rm -rf 4-1_parameter-* 4-1_parameter.kml 4-1_parameter.xml hello2.txt || exit 1
+exit 0


Property changes on: trunk/tests/documentation/4-1_parameter.clean.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/documentation/4-1_parameter.swift
===================================================================
--- trunk/tests/documentation/4-1_parameter.swift	                        (rev 0)
+++ trunk/tests/documentation/4-1_parameter.swift	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,9 @@
+type messagefile;
+
+app (messagefile t) greeting (string s) {
+	echo s stdout=@filename(t);
+}
+
+messagefile outfile <"hello2.txt">;
+
+outfile = greeting("hello world");

Added: trunk/tests/documentation/4-2_adding_another_application.check.sh
===================================================================
--- trunk/tests/documentation/4-2_adding_another_application.check.sh	                        (rev 0)
+++ trunk/tests/documentation/4-2_adding_another_application.check.sh	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,5 @@
+#!/bin/bash
+set -x
+grep 'hello from Swift' hello.txt | grep 'HELLO FROM SWIFT' capitals.txt || exit 1
+
+exit 0


Property changes on: trunk/tests/documentation/4-2_adding_another_application.check.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/documentation/4-2_adding_another_application.clean.sh
===================================================================
--- trunk/tests/documentation/4-2_adding_another_application.clean.sh	                        (rev 0)
+++ trunk/tests/documentation/4-2_adding_another_application.clean.sh	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -x
+rm -rf 4-2_adding_another_application-* 4-2_adding_another_application.kml 4-2_adding_another_application.xml hello.txt capitals.txt|| exit 1
+exit 0


Property changes on: trunk/tests/documentation/4-2_adding_another_application.clean.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/documentation/4-2_adding_another_application.swift
===================================================================
--- trunk/tests/documentation/4-2_adding_another_application.swift	                        (rev 0)
+++ trunk/tests/documentation/4-2_adding_another_application.swift	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,14 @@
+type messagefile;
+
+app (messagefile t) greeting(string s) {
+	echo s stdout=@filename(t);
+}
+app (messagefile o) capitalise(messagefile i) {
+	tr "[a-z]" "[A-Z]" stdin=@filename(i) stdout=@filename(o);
+}
+
+messagefile hellofile <"hello.txt">;
+messagefile final <"capitals.txt">;
+
+hellofile = greeting("hello from Swift");
+final = capitalise(hellofile);

Added: trunk/tests/documentation/4-4_datatypes.check.sh
===================================================================
--- trunk/tests/documentation/4-4_datatypes.check.sh	                        (rev 0)
+++ trunk/tests/documentation/4-4_datatypes.check.sh	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -x
+grep 'Hello. Your name is John and you have eaten 3 pies.' q15.txt || exit 1
+exit 0


Property changes on: trunk/tests/documentation/4-4_datatypes.check.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/documentation/4-4_datatypes.clean.sh
===================================================================
--- trunk/tests/documentation/4-4_datatypes.clean.sh	                        (rev 0)
+++ trunk/tests/documentation/4-4_datatypes.clean.sh	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -x
+rm -rf 4-4_datatypes-* 4-4_datatypes.kml 4-4_datatypes.xml q15.txt || exit 1
+exit 0


Property changes on: trunk/tests/documentation/4-4_datatypes.clean.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/documentation/4-4_datatypes.swift
===================================================================
--- trunk/tests/documentation/4-4_datatypes.swift	                        (rev 0)
+++ trunk/tests/documentation/4-4_datatypes.swift	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,19 @@
+type messagefile;
+
+type details {
+	string name;
+	int pies;
+}
+
+app (messagefile t) greeting (details d) {
+	echo "Hello. Your name is" d.name "and you have eaten" d.pies "pies." stdout=@filename(t);
+}
+
+details person;
+
+person.name = "John";
+person.pies = 3;
+
+messagefile outfile <"q15.txt">;
+
+outfile = greeting(person);

Added: trunk/tests/documentation/4-5_arrays.check.sh
===================================================================
--- trunk/tests/documentation/4-5_arrays.check.sh	                        (rev 0)
+++ trunk/tests/documentation/4-5_arrays.check.sh	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -x
+cat q5out.txt|grep 'how are you'|| exit 1
+exit 0


Property changes on: trunk/tests/documentation/4-5_arrays.check.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/documentation/4-5_arrays.clean.sh
===================================================================
--- trunk/tests/documentation/4-5_arrays.clean.sh	                        (rev 0)
+++ trunk/tests/documentation/4-5_arrays.clean.sh	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -x
+rm -rf 4-5_arrays-* 4-5_arrays.kml 4-5_arrays.xml q5out.txt || exit 1
+exit 0


Property changes on: trunk/tests/documentation/4-5_arrays.clean.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/documentation/4-5_arrays.swift
===================================================================
--- trunk/tests/documentation/4-5_arrays.swift	                        (rev 0)
+++ trunk/tests/documentation/4-5_arrays.swift	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,11 @@
+type messagefile;
+
+app (messagefile t) greeting (string s[]) {
+	echo s[0] s[1] s[2] stdout=@filename(t);
+}
+
+messagefile outfile <"q5out.txt">;
+
+string words[] = ["how","are","you"];
+
+outfile = greeting(words);

Added: trunk/tests/documentation/4-6-2_fixed_array_mapper.check.sh
===================================================================
--- trunk/tests/documentation/4-6-2_fixed_array_mapper.check.sh	                        (rev 0)
+++ trunk/tests/documentation/4-6-2_fixed_array_mapper.check.sh	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,6 @@
+#!/bin/bash
+set -x
+cat one.count | grep '3 one.txt' || exit 1
+cat two.count | grep '3 two.txt' || exit 1
+cat three.count | grep '1 three.txt' || exit 1
+exit 0


Property changes on: trunk/tests/documentation/4-6-2_fixed_array_mapper.check.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/documentation/4-6-2_fixed_array_mapper.clean.sh
===================================================================
--- trunk/tests/documentation/4-6-2_fixed_array_mapper.clean.sh	                        (rev 0)
+++ trunk/tests/documentation/4-6-2_fixed_array_mapper.clean.sh	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -x
+rm -rf 4-6-2_fixed_array_mapper-* 4-6-2_fixed_array_mapper.kml 4-6-2_fixed_array_mapper.xml one.count two.count three.count || exit 1
+exit 0


Property changes on: trunk/tests/documentation/4-6-2_fixed_array_mapper.clean.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/documentation/4-6-2_fixed_array_mapper.swift
===================================================================
--- trunk/tests/documentation/4-6-2_fixed_array_mapper.swift	                        (rev 0)
+++ trunk/tests/documentation/4-6-2_fixed_array_mapper.swift	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,16 @@
+type messagefile {}
+type countfile {}
+
+app (countfile t) countwords (messagefile f) {
+	wc "-w" @filename(f) stdout=@filename(t);
+}
+
+string inputNames = "one.txt two.txt three.txt";
+string outputNames = "one.count two.count three.count";
+
+messagefile inputfiles[] <fixed_array_mapper;files=inputNames>;
+countfile outputfiles[] <fixed_array_mapper;files=outputNames>;
+
+outputfiles[0] = countwords(inputfiles[0]);
+outputfiles[1] = countwords(inputfiles[1]);
+outputfiles[2] = countwords(inputfiles[2]);


Property changes on: trunk/tests/documentation/4-7_foreach.check.sh
___________________________________________________________________
Added: svn:executable
   + *


Property changes on: trunk/tests/documentation/4-7_foreach.clean.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/documentation/4-7_foreach.swift
===================================================================
--- trunk/tests/documentation/4-7_foreach.swift	                        (rev 0)
+++ trunk/tests/documentation/4-7_foreach.swift	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,18 @@
+type messagefile {}
+type countfile {}
+
+app (countfile t) countwords (messagefile f) {
+	wc "-w" @filename(f) stdout=@filename(t);
+}
+
+string inputNames = "one.txt two.txt three.txt";
+
+messagefile inputfiles[] <fixed_array_mapper;files=inputNames>;
+
+foreach f in inputfiles {
+	countfile c<regexp_mapper;
+		    source=@f,
+		    match="(.*)txt",
+		    transform="\\1count">;
+	c = countwords(f);
+}


Property changes on: trunk/tests/documentation/4-9_sequential_iteration.check.sh
___________________________________________________________________
Added: svn:executable
   + *


Property changes on: trunk/tests/documentation/4-9_sequential_iteration.clean.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/documentation/4-9_sequential_iteration.swift
===================================================================
--- trunk/tests/documentation/4-9_sequential_iteration.swift	                        (rev 0)
+++ trunk/tests/documentation/4-9_sequential_iteration.swift	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,18 @@
+type counterfile;
+
+app (counterfile t) echo(string m) {
+	echo m stdout=@filename(t);
+}
+
+app (counterfile t) countstep(counterfile i) {
+	wcl @filename(i) @filename(t);
+}
+
+counterfile a[] <simple_mapper;prefix="foldout">;
+
+a[0] = echo("793578934574893");
+
+iterate v {
+ a[v+1] = countstep(a[v]);
+ trace("extract int value ", at extractint(a[v+1]));
+} until (@extractint(a[v+1]) <= 1);


Property changes on: trunk/tests/documentation/6-1_named_and_optional_params.check.sh
___________________________________________________________________
Added: svn:executable
   + *


Property changes on: trunk/tests/documentation/6-1_named_and_optional_params.clean.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/documentation/6-1_named_and_optional_params.swift
===================================================================
--- trunk/tests/documentation/6-1_named_and_optional_params.swift	                        (rev 0)
+++ trunk/tests/documentation/6-1_named_and_optional_params.swift	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,9 @@
+type messagefile;
+app (messagefile t) greeting (string s="hello") {
+	echo s stdout=@filename(t);
+}
+messagefile french <"french.txt">;
+messagefile english <"english.txt">;
+
+french = greeting(s="bonjour");
+english = greeting();

Added: trunk/tests/documentation/swift.log
===================================================================
--- trunk/tests/documentation/swift.log	                        (rev 0)
+++ trunk/tests/documentation/swift.log	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,6 @@
+2011-06-17 10:34:26,338-0500 DEBUG Loader Loader started
+2011-06-17 10:35:47,746-0500 DEBUG Loader Loader started
+2011-06-17 10:47:09,057-0500 DEBUG Loader Loader started
+2011-06-17 10:47:30,938-0500 DEBUG Loader Loader started
+2011-06-17 10:48:45,486-0500 DEBUG Loader Loader started
+2011-06-17 11:12:05,375-0500 DEBUG Loader Loader started

Added: trunk/tests/documentation/tc.data
===================================================================
--- trunk/tests/documentation/tc.data	                        (rev 0)
+++ trunk/tests/documentation/tc.data	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,24 @@
+#This is the transformation catalog.
+#
+#It comes pre-configured with a number of simple transformations with
+#paths that are likely to work on a linux box. However, on some systems,
+#the paths to these executables will be different (for example, sometimes
+#some of these programs are found in /usr/bin rather than in /bin)
+#
+#NOTE WELL: fields in this file must be separated by tabs, not spaces; and
+#there must be no trailing whitespace at the end of each line.
+#
+# sitename  transformation  path   INSTALLED  platform  profiles
+localhost 	echo 		/bin/echo	INSTALLED	INTEL32::LINUX	null
+localhost	tr		/usr/bin/tr	INSTALLED	INTEL32::LINUX	null
+localhost 	cat 		/bin/cat	INSTALLED	INTEL32::LINUX	null
+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 	cp 		/bin/cp         INSTALLED	INTEL32::LINUX	null
+localhost	wc		/usr/bin/wc	INSTALLED	INTEL32::LINUX	null
+localhost	touch		/bin/touch	INSTALLED	INTEL32::LINUX	null
+localhost	sleep		/bin/sleep	INSTALLED	INTEL32::LINUX	null
+localhost	delayedcat	/home/Alberto/Swift/cog/modules/swift/tests/language-behaviour/delayedcat.sh	INSTALLED	INTEL32::LINUX	null
+#localhost	wcl	/home/Alberto/My\ Shell\ Scripts/wcl.sh	INSTALLED	INTEL32::LINUX	null

Added: trunk/tests/documentation/tc.template.data
===================================================================
--- trunk/tests/documentation/tc.template.data	                        (rev 0)
+++ trunk/tests/documentation/tc.template.data	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1,24 @@
+#This is the transformation catalog.
+#
+#It comes pre-configured with a number of simple transformations with
+#paths that are likely to work on a linux box. However, on some systems,
+#the paths to these executables will be different (for example, sometimes
+#some of these programs are found in /usr/bin rather than in /bin)
+#
+#NOTE WELL: fields in this file must be separated by tabs, not spaces; and
+#there must be no trailing whitespace at the end of each line.
+#
+# sitename  transformation  path   INSTALLED  platform  profiles
+localhost 	echo 		/bin/echo	INSTALLED	INTEL32::LINUX	null
+localhost	tr		/usr/bin/tr	INSTALLED	INTEL32::LINUX	null
+localhost 	cat 		/bin/cat	INSTALLED	INTEL32::LINUX	null
+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 	cp 		/bin/cp         INSTALLED	INTEL32::LINUX	null
+localhost	wc		/usr/bin/wc	INSTALLED	INTEL32::LINUX	null
+localhost	touch		/bin/touch	INSTALLED	INTEL32::LINUX	null
+localhost	sleep		/bin/sleep	INSTALLED	INTEL32::LINUX	null
+localhost	delayedcat	/home/Alberto/Swift/cog/modules/swift/tests/language-behaviour/delayedcat.sh	INSTALLED	INTEL32::LINUX	null
+localhost	wcl		/usr/bin/wcl.sh	INSTALLED	INTEL32::LINUX	null

Added: trunk/tests/documentation/title.txt
===================================================================
--- trunk/tests/documentation/title.txt	                        (rev 0)
+++ trunk/tests/documentation/title.txt	2011-06-17 19:52:39 UTC (rev 4629)
@@ -0,0 +1 @@
+Documentation Files Test




More information about the Swift-commit mailing list