tests: add meta-tests related to the execution control
authorJean Privat <jean@pryen.org>
Thu, 4 Sep 2014 00:55:53 +0000 (20:55 -0400)
committerJean Privat <jean@pryen.org>
Thu, 4 Sep 2014 14:02:08 +0000 (10:02 -0400)
* zzz_tests/zzz_test_args.nit
* zzz_tests/zzz_test_envvar.nit
* zzz_tests/zzz_test_in.nit
* zzz_tests/zzz_test_post_proc.nit
* zzz_tests/zzz_test_write.nit

Signed-off-by: Jean Privat <jean@pryen.org>

17 files changed:
tests/sav/zzz_test_args.res [new file with mode: 0644]
tests/sav/zzz_test_args_args1.res [new file with mode: 0644]
tests/sav/zzz_test_args_args2.res [new file with mode: 0644]
tests/sav/zzz_test_envvar.res [new file with mode: 0644]
tests/sav/zzz_test_in.res [new file with mode: 0644]
tests/sav/zzz_test_post_proc.res [new file with mode: 0644]
tests/sav/zzz_test_post_proc_args1.res [new file with mode: 0644]
tests/sav/zzz_test_write_args1.res [new file with mode: 0644]
tests/zzz_test_args.args [new file with mode: 0644]
tests/zzz_test_in.inputs [new file with mode: 0644]
tests/zzz_test_post_proc.args [new file with mode: 0644]
tests/zzz_test_write.args [new file with mode: 0644]
tests/zzz_tests/zzz_test_args.nit [new file with mode: 0644]
tests/zzz_tests/zzz_test_envvar.nit [new file with mode: 0644]
tests/zzz_tests/zzz_test_in.nit [new file with mode: 0644]
tests/zzz_tests/zzz_test_post_proc.nit [new file with mode: 0644]
tests/zzz_tests/zzz_test_write.nit [new file with mode: 0644]

diff --git a/tests/sav/zzz_test_args.res b/tests/sav/zzz_test_args.res
new file mode 100644 (file)
index 0000000..77ac542
--- /dev/null
@@ -0,0 +1,2 @@
+0
+
diff --git a/tests/sav/zzz_test_args_args1.res b/tests/sav/zzz_test_args_args1.res
new file mode 100644 (file)
index 0000000..7acffac
--- /dev/null
@@ -0,0 +1,2 @@
+1
+hello
diff --git a/tests/sav/zzz_test_args_args2.res b/tests/sav/zzz_test_args_args2.res
new file mode 100644 (file)
index 0000000..3b5896e
--- /dev/null
@@ -0,0 +1,2 @@
+2
+hello world
diff --git a/tests/sav/zzz_test_envvar.res b/tests/sav/zzz_test_envvar.res
new file mode 100644 (file)
index 0000000..27ba77d
--- /dev/null
@@ -0,0 +1 @@
+true
diff --git a/tests/sav/zzz_test_in.res b/tests/sav/zzz_test_in.res
new file mode 100644 (file)
index 0000000..59f3187
--- /dev/null
@@ -0,0 +1,4 @@
+INPUT:
+foo
+bar
+
diff --git a/tests/sav/zzz_test_post_proc.res b/tests/sav/zzz_test_post_proc.res
new file mode 100644 (file)
index 0000000..ce01362
--- /dev/null
@@ -0,0 +1 @@
+hello
diff --git a/tests/sav/zzz_test_post_proc_args1.res b/tests/sav/zzz_test_post_proc_args1.res
new file mode 100644 (file)
index 0000000..94954ab
--- /dev/null
@@ -0,0 +1,2 @@
+hello
+world
diff --git a/tests/sav/zzz_test_write_args1.res b/tests/sav/zzz_test_write_args1.res
new file mode 100644 (file)
index 0000000..ce01362
--- /dev/null
@@ -0,0 +1 @@
+hello
diff --git a/tests/zzz_test_args.args b/tests/zzz_test_args.args
new file mode 100644 (file)
index 0000000..1709fa9
--- /dev/null
@@ -0,0 +1,2 @@
+hello
+hello world
diff --git a/tests/zzz_test_in.inputs b/tests/zzz_test_in.inputs
new file mode 100644 (file)
index 0000000..3bd1f0e
--- /dev/null
@@ -0,0 +1,2 @@
+foo
+bar
diff --git a/tests/zzz_test_post_proc.args b/tests/zzz_test_post_proc.args
new file mode 100644 (file)
index 0000000..eccc3a1
--- /dev/null
@@ -0,0 +1 @@
+; echo "world"
diff --git a/tests/zzz_test_write.args b/tests/zzz_test_write.args
new file mode 100644 (file)
index 0000000..a62688b
--- /dev/null
@@ -0,0 +1 @@
+$WRITE
diff --git a/tests/zzz_tests/zzz_test_args.nit b/tests/zzz_tests/zzz_test_args.nit
new file mode 100644 (file)
index 0000000..0d5a331
--- /dev/null
@@ -0,0 +1,16 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+print args.length
+print args.join(" ")
diff --git a/tests/zzz_tests/zzz_test_envvar.nit b/tests/zzz_tests/zzz_test_envvar.nit
new file mode 100644 (file)
index 0000000..d5fd881
--- /dev/null
@@ -0,0 +1,15 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+print "NIT_TESTING".environ
diff --git a/tests/zzz_tests/zzz_test_in.nit b/tests/zzz_tests/zzz_test_in.nit
new file mode 100644 (file)
index 0000000..704e87e
--- /dev/null
@@ -0,0 +1,16 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+print "INPUT:"
+print stdin.read_all
diff --git a/tests/zzz_tests/zzz_test_post_proc.nit b/tests/zzz_tests/zzz_test_post_proc.nit
new file mode 100644 (file)
index 0000000..01b343d
--- /dev/null
@@ -0,0 +1,15 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+print "hello"
diff --git a/tests/zzz_tests/zzz_test_write.nit b/tests/zzz_tests/zzz_test_write.nit
new file mode 100644 (file)
index 0000000..66082c4
--- /dev/null
@@ -0,0 +1,16 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+if args.length == 0 then return
+"hello\n".write_to_file args.first