Great scripts to test stuff; most come from unpublished scripts from our Jenkins instance.
A lot of cleaning in the tests/sav directory.
And some unpublished tests
The `search_tests.sh` script is quite useful to retrieve the original program for some test:
~~~.sh
$ ./search_tests.sh hello_world sav/base_var_type_evolution_null_alt3.res
../examples/hello_world.nit
base_var_type_evolution_null.nit
~~~
It will be also used by Jenkins to check that each sav/*res file has a corresponding test; since commit 'tests: add missing test files whose sav files where committed' show that sometime the .res are committed but without the corresponding .nit
The `search_tests_git.sh` looks in the git commit to found modified things to tests.
Basically, the simple usage is to perform all engines on the result:
~~~.sh
$ ./testall.sh `./search_tests_git.sh origin/master HEAD`
~~~
Pull-Request: #691
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
tests/alt
tests/errlist
+tests/errlist.bak
tests/out
tests/*.xml
tests/nitunit
# Simple class transfered between processors
class ProcessorInfo
auto_serializable
- super Serializable
var rank: Int
var size: Int
--- /dev/null
+Some scripts used by the Nit Jenkins for continuous integration, but you can use them also.
--- /dev/null
+#!/bin/bash
+# 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.
+
+# Check missing signed-off-by in commits
+
+if test "$#" -lt 2; then
+ echo "Usage: checksignedoffby from to"
+ echo ""
+ exit
+fi
+
+from=$1
+to=$2
+
+err=0
+
+for ref in `git rev-list --no-merges "$from".."$to"`; do
+ # What is the expected?
+ sig=`git --no-pager show -s --format='Signed-off-by: %an <%ae>' $ref`
+ # Do we found some signed-off-by?
+ git --no-pager show -s --format="%b" $ref | grep "^Signed-off-by:" > check_signedoff_list.out || {
+ git --no-pager show -s --oneline $ref
+ echo "Missing $sig"
+ err=1
+ continue
+ }
+ # Do we found the expected thing?
+ cat check_signedoff_list.out | grep -q "^$sig\$" && continue
+ git --no-pager show -s --oneline $ref
+ echo "Bad or missing $sig; got:"
+ cat check_signedoff_list.out
+ err=1
+done
+
+rm check_signedoff_list.out 2> /dev/null
+
+exit $err
--- /dev/null
+#!/bin/bash
+# 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.
+
+# This shell script executes a shell command and generates a JUnit compatible XML file
+
+if test $# -lt 2; then
+ echo "Usage: unitrun.sh name command"
+ echo "Runs the command and generates a JUnit XML file name.xml"
+ exit
+fi
+
+name=$1
+shift
+
+# Magic here! This tee and save both stdout and stderr in distinct files without messing with them
+# Time just get the user time
+/usr/bin/time -f%U -o "${name}.t.out" "$@" > >(tee "${name}.out") 2> >(tee "${name}.2.out" >&2)
+res=$?
+
+cat > "${name}.xml"<<END
+<testsuites><testsuite>
+<testcase classname='other' name='$name' time='`cat "${name}.t.out"`' timestamp='`date -Iseconds`'>
+END
+if test "$res" != "0"; then
+echo >> "${name}.xml" "<error message='Command returned $res'/>"
+echo "+ Command returned $res" >&2
+fi
+cat >> "${name}.xml"<<END
+<system-out><![CDATA[
+`cat -v ${name}.out`
+]]></system-out>
+<system-err><![CDATA[
+`cat -v ${name}.2.out`
+]]></system-err>
+</testcase>
+</testsuite></testsuites>
+END
+
+rm "${name}.out" "${name}.2.out" "${name}.t.out"
--- /dev/null
+# 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.
+
+import kernel
+
+class A
+ var b: Bool
+ var c: Char
+ var i: Int
+ var f: Float
+ init is old_style_init do end
+end
+
+fun print(o: Object) do o.output
+
+var a = new A
+#alt1#print a.b
+#alt2#print a.c
+#alt3#print a.i
+#alt4#print a.f
--- /dev/null
+# 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.
+
+import kernel
+
+class A
+ init do 1.output
+end
+
+class B
+ super A
+ init is nosuper do #alt1# init do
+ #alt3#super
+ 2.output
+ end
+ #alt2#fun foo is nosuper do end
+end
+
+var a = new A
+var b = new B
--- /dev/null
+# 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.
+
+import kernel
+
+class A
+ type E: T
+ fun new_e: E do return new T
+end
+
+class B
+ super A
+ redef type E: U
+end
+
+class T
+ fun foo do 0.output
+end
+
+class U
+ super T
+ redef fun foo do 1.output
+ fun bar do 2.output
+end
+
+var a = new A
+a.new_e.foo
+var b = new B
+b.new_e.foo
+b.new_e.bar
--- /dev/null
+#!/bin/sh
+list=""
+for x in ../lib/*
+do
+ bx=`basename $x`
+ y="$x/$bx.nit"
+ test -f $y && list="$list $y"
+done
+printf "%s\n" "$@" *.nit \
+ ../examples/*.nit \
+ ../examples/*/*.nit \
+ ../examples/shoot/src/shoot_logic.nit \
+ ../examples/*/src/*_android.nit \
+ ../examples/*/src/*_linux.nit \
+ ../examples/*/src/*_null.nit \
+ ../examples/pnacl/converter/converter.nit \
+ ../examples/nitcorn/src/*.nit \
+ ../examples/mpi/src/*.nit \
+ ../lib/*.nit $list \
+ ../src/nit*.nit \
+ ../src/test_*.nit \
+ ../contrib/*.nit \
+ ../contrib/*/*.nit \
+ ../contrib/*/src/*.nit
-Runtime error: Uninitialized attribute @b (alt/base_attr_init_val_int_alt1.nit:28)
+Runtime error: Uninitialized attribute _b (alt/base_attr_init_val_int_alt1.nit:28)
-Runtime error: Uninitialized attribute @c (alt/base_attr_init_val_int_alt2.nit:29)
+Runtime error: Uninitialized attribute _c (alt/base_attr_init_val_int_alt2.nit:29)
-Runtime error: Uninitialized attribute @i (alt/base_attr_init_val_int_alt3.nit:30)
+Runtime error: Uninitialized attribute _i (alt/base_attr_init_val_int_alt3.nit:30)
-Runtime error: Uninitialized attribute @f (alt/base_attr_init_val_int_alt4.nit:31)
+Runtime error: Uninitialized attribute _f (alt/base_attr_init_val_int_alt4.nit:31)
+++ /dev/null
-5
-5
-true
+++ /dev/null
-alt/base_for_custom_alt1.nit:38,10: Type error: Expected a type with an 'iterate' method. Found A.
+++ /dev/null
-alt/base_for_custom_alt2.nit:24,3--9: Error: Method or variable 'each' unknown in A.
-alt/base_for_custom_alt2.nit:38,1--41,3: Error: 'iterate' incompatible with 'for': require one closure.
+++ /dev/null
-alt/base_for_custom_alt3.nit:39,1--41,3: Error: Expected 1 variable (i: Int), found 2.
+++ /dev/null
-alt/base_for_custom_alt4.nit:45,1--48,3: Error: Expected 2 variables (i: Int, j: Bool), found 1.
+++ /dev/null
-alt/base_for_custom_alt5.nit:38,1--41,3: Error: 'iterate' incompatible with 'for': require one procedural closure.
+++ /dev/null
-0
-1
-2
-3
-4
-0
-1
-2
-3
-4
-0
-1
-2
-3
-4
-0
-1
-2
-3
-4
+++ /dev/null
-3.09 bench_netsim 1000000
-2.02 bench_netsim 1000000 --boost
-3.08 bench_netsim 1000000 --tag
-3.05 bench_netsim 1000000 --tag --tag
-4.43 bench_netsim 1000000 --gc boehm
-4.17 bench_netsim 1000000 --gc boehm --tag
-4.14 bench_netsim 1000000 --gc boehm --tag --tag
-3.07 bench_netsim 1000000 --select btd
-3.05 bench_netsim 1000000 --tag --select btd
-3.02 bench_netsim 1000000 --tag --select btd --tag
-4.42 bench_netsim 1000000 --gc boehm --select btd
-4.14 bench_netsim 1000000 --gc boehm --tag --select btd
-4.12 bench_netsim 1000000 --gc boehm --tag --select btd --tag
-3.34 bench_string_append 10
-2.71 bench_string_append 10 --boost
-3.37 bench_string_append 10 --tag
-3.36 bench_string_append 10 --tag --tag
-3.71 bench_string_append 10 --gc boehm
-3.70 bench_string_append 10 --gc boehm --tag
-3.71 bench_string_append 10 --gc boehm --tag --tag
-3.38 bench_string_append 10 --select btd
-3.35 bench_string_append 10 --tag --select btd
-3.36 bench_string_append 10 --tag --select btd --tag
-3.72 bench_string_append 10 --gc boehm --select btd
-3.68 bench_string_append 10 --gc boehm --tag --select btd
-3.71 bench_string_append 10 --gc boehm --tag --select btd --tag
-1.28 shootout_binarytrees 15
-1.24 shootout_binarytrees 15 --boost
-1.28 shootout_binarytrees 15 --tag
-1.26 shootout_binarytrees 15 --tag --tag
-4.34 shootout_binarytrees 15 --gc boehm
-4.34 shootout_binarytrees 15 --gc boehm --tag
-4.34 shootout_binarytrees 15 --gc boehm --tag --tag
-1.28 shootout_binarytrees 15 --select btd
-1.29 shootout_binarytrees 15 --tag --select btd
-1.28 shootout_binarytrees 15 --tag --select btd --tag
-4.34 shootout_binarytrees 15 --gc boehm --select btd
-4.34 shootout_binarytrees 15 --gc boehm --tag --select btd
-4.34 shootout_binarytrees 15 --gc boehm --tag --select btd --tag
-5.50 bench_random_n_sort 700
-4.66 bench_random_n_sort 700 --boost
-3.59 bench_random_n_sort 700 --tag
-3.45 bench_random_n_sort 700 --tag --tag
-5.97 bench_random_n_sort 700 --gc boehm
-3.60 bench_random_n_sort 700 --gc boehm --tag
-3.47 bench_random_n_sort 700 --gc boehm --tag --tag
-5.02 bench_random_n_sort 700 --select btd
-3.42 bench_random_n_sort 700 --tag --select btd
-3.33 bench_random_n_sort 700 --tag --select btd --tag
-5.39 bench_random_n_sort 700 --gc boehm --select btd
-3.43 bench_random_n_sort 700 --gc boehm --tag --select btd
-3.35 bench_random_n_sort 700 --gc boehm --tag --select btd --tag
-
+++ /dev/null
-4.14 bench_int 40
-4.01 bench_int 40 --boost
-3.83 bench_int 40 --tag
-4.28 bench_int 40 --tag --tag
-4.21 bench_int 40 --gc boehm
-4.32 bench_int 40 --gc boehm --tag
-3.85 bench_int 40 --gc boehm --tag --tag
-3.56 bench_int 40 --select btd
-3.69 bench_int 40 --tag --select btd
-3.63 bench_int 40 --tag --select btd --tag
-3.96 bench_int 40 --gc boehm --select btd
-4.20 bench_int 40 --gc boehm --tag --select btd
-4.09 bench_int 40 --gc boehm --tag --select btd --tag
-2.38 bench_netsim 1000000
-1.45 bench_netsim 1000000 --boost
-2.38 bench_netsim 1000000 --tag
-2.36 bench_netsim 1000000 --tag --tag
-4.99 bench_netsim 1000000 --gc boehm
-4.47 bench_netsim 1000000 --gc boehm --tag
-4.42 bench_netsim 1000000 --gc boehm --tag --tag
-2.37 bench_netsim 1000000 --select btd
-2.38 bench_netsim 1000000 --tag --select btd
-2.31 bench_netsim 1000000 --tag --select btd --tag
-5.00 bench_netsim 1000000 --gc boehm --select btd
-4.45 bench_netsim 1000000 --gc boehm --tag --select btd
-4.45 bench_netsim 1000000 --gc boehm --tag --select btd --tag
-2.20 bench_string_append 10
-1.91 bench_string_append 10 --boost
-2.19 bench_string_append 10 --tag
-2.21 bench_string_append 10 --tag --tag
-2.37 bench_string_append 10 --gc boehm
-2.41 bench_string_append 10 --gc boehm --tag
-2.39 bench_string_append 10 --gc boehm --tag --tag
-2.18 bench_string_append 10 --select btd
-2.19 bench_string_append 10 --tag --select btd
-2.19 bench_string_append 10 --tag --select btd --tag
-2.38 bench_string_append 10 --gc boehm --select btd
-2.39 bench_string_append 10 --gc boehm --tag --select btd
-2.40 bench_string_append 10 --gc boehm --tag --select btd --tag
-1.29 shootout_binarytrees 15
-1.29 shootout_binarytrees 15 --boost
-1.30 shootout_binarytrees 15 --tag
-1.28 shootout_binarytrees 15 --tag --tag
-5.51 shootout_binarytrees 15 --gc boehm
-5.52 shootout_binarytrees 15 --gc boehm --tag
-5.49 shootout_binarytrees 15 --gc boehm --tag --tag
-1.30 shootout_binarytrees 15 --select btd
-1.30 shootout_binarytrees 15 --tag --select btd
-1.29 shootout_binarytrees 15 --tag --select btd --tag
-5.63 shootout_binarytrees 15 --gc boehm --select btd
-5.50 shootout_binarytrees 15 --gc boehm --tag --select btd
-5.50 shootout_binarytrees 15 --gc boehm --tag --select btd --tag
-3.87 bench_random_n_sort 700
-3.00 bench_random_n_sort 700 --boost
-2.39 bench_random_n_sort 700 --tag
-2.30 bench_random_n_sort 700 --tag --tag
-4.29 bench_random_n_sort 700 --gc boehm
-2.38 bench_random_n_sort 700 --gc boehm --tag
-2.33 bench_random_n_sort 700 --gc boehm --tag --tag
-3.87 bench_random_n_sort 700 --select btd
-2.30 bench_random_n_sort 700 --tag --select btd
-2.36 bench_random_n_sort 700 --tag --select btd --tag
-4.28 bench_random_n_sort 700 --gc boehm --select btd
-2.30 bench_random_n_sort 700 --gc boehm --tag --select btd
-2.33 bench_random_n_sort 700 --gc boehm --tag --select btd --tag
+++ /dev/null
-5.56 bench_421 5000000
-5.56 bench_421 5000000 --boost
-5.55 bench_421 5000000 --tag
-5.38 bench_421 5000000 --tag --tag
-5.59 bench_421 5000000 --gc boehm
-5.49 bench_421 5000000 --gc boehm --tag
-5.56 bench_421 5000000 --gc boehm --tag --tag
-5.57 bench_421 5000000 --select btd
-5.64 bench_421 5000000 --tag --select btd
-5.62 bench_421 5000000 --tag --select btd --tag
-5.50 bench_421 5000000 --gc boehm --select btd
-5.41 bench_421 5000000 --gc boehm --tag --select btd
-5.59 bench_421 5000000 --gc boehm --tag --select btd --tag
-5.44 bench_421 5000000 ref_c
-2.76 bench_netsim 1000000
-1.92 bench_netsim 1000000 --boost
-2.52 bench_netsim 1000000 --tag
-2.50 bench_netsim 1000000 --tag --tag
-10.07 bench_netsim 1000000 --gc boehm
-4.56 bench_netsim 1000000 --gc boehm --tag
-4.54 bench_netsim 1000000 --gc boehm --tag --tag
-2.71 bench_netsim 1000000 --select btd
-2.52 bench_netsim 1000000 --tag --select btd
-2.53 bench_netsim 1000000 --tag --select btd --tag
-10.29 bench_netsim 1000000 --gc boehm --select btd
-4.59 bench_netsim 1000000 --gc boehm --tag --select btd
-4.55 bench_netsim 1000000 --gc boehm --tag --select btd --tag
-4.25 bench_string_append 10
-4.01 bench_string_append 10 --boost
-3.33 bench_string_append 10 --tag
-3.34 bench_string_append 10 --tag --tag
-30.14 bench_string_append 10 --gc boehm
-3.52 bench_string_append 10 --gc boehm --tag
-3.51 bench_string_append 10 --gc boehm --tag --tag
-4.32 bench_string_append 10 --select btd
-3.37 bench_string_append 10 --tag --select btd
-3.33 bench_string_append 10 --tag --select btd --tag
-30.09 bench_string_append 10 --gc boehm --select btd
-3.54 bench_string_append 10 --gc boehm --tag --select btd
-3.45 bench_string_append 10 --gc boehm --tag --select btd --tag
-1.31 shootout_binarytrees 15
-1.28 shootout_binarytrees 15 --boost
-1.30 shootout_binarytrees 15 --tag
-1.31 shootout_binarytrees 15 --tag --tag
-5.53 shootout_binarytrees 15 --gc boehm
-5.54 shootout_binarytrees 15 --gc boehm --tag
-5.53 shootout_binarytrees 15 --gc boehm --tag --tag
-1.31 shootout_binarytrees 15 --select btd
-1.29 shootout_binarytrees 15 --tag --select btd
-1.31 shootout_binarytrees 15 --tag --select btd --tag
-5.56 shootout_binarytrees 15 --gc boehm --select btd
-5.57 shootout_binarytrees 15 --gc boehm --tag --select btd
-5.52 shootout_binarytrees 15 --gc boehm --tag --select btd --tag
-3.73 bench_random_n_sort 700
-3.02 bench_random_n_sort 700 --boost
-2.04 bench_random_n_sort 700 --tag
-2.04 bench_random_n_sort 700 --tag --tag
-4.52 bench_random_n_sort 700 --gc boehm
-2.04 bench_random_n_sort 700 --gc boehm --tag
-2.06 bench_random_n_sort 700 --gc boehm --tag --tag
-3.75 bench_random_n_sort 700 --select btd
-2.02 bench_random_n_sort 700 --tag --select btd
-2.04 bench_random_n_sort 700 --tag --select btd --tag
-4.62 bench_random_n_sort 700 --gc boehm --select btd
-2.04 bench_random_n_sort 700 --gc boehm --tag --select btd
-2.06 bench_random_n_sort 700 --gc boehm --tag --select btd --tag
+++ /dev/null
-FILE_ACCESS
+++ /dev/null
-./error_loop_bool_until.nit:2,1--7: Error: Method or variable 'until' unknown in Sys.
+++ /dev/null
-47 72 94 80 23 35 64 68 88 34 47 25 99 32 22 89 52 38 37 43 45 79 40 70 13 97 35 38 18 76 35 49 78 28 50 88 38 41 27 68 58 38 80 34 59 31 96 60 45 93
-13 18 22 23 25 27 28 31 32 34 34 35 35 35 37 38 38 38 38 40 41 43 45 45 47 47 49 50 52 58 59 60 64 68 68 70 72 76 78 79 80 80 88 88 89 93 94 96 97 99
-80 40 50 80 70 60 41 31 32 72 52 22 23 13 93 43 94 34 34 64 35 35 45 45 25 35 76 96 47 47 37 97 27 68 68 28 58 78 38 38 18 88 88 38 38 79 89 49 99 59
-99 97 96 94 93 89 88 88 80 80 79 78 76 72 70 68 68 64 60 59 58 52 50 49 47 47 45 45 43 41 40 38 38 38 38 37 35 35 35 34 34 32 31 28 27 25 23 22 18 13
-60 80 70 40 50 80 41 31 32 52 22 72 93 13 23 43 64 94 34 34 25 35 35 35 45 45 76 96 47 47 27 37 97 38 38 38 38 88 58 18 78 88 28 68 68 59 79 49 89 99
+++ /dev/null
-2
-4
-8
-16
-32
-64
-128
-256
+++ /dev/null
-usage: nitdoc [options] file...
- -W, --warn Show warnings
- -q, --quiet Do not show warnings
- --stop-on-first-error Stop on first error
- --no-color Do not use color to display errors and warnings
- --log Generate various log files
- --log-dir Directory where to generate log files
- -h, -?, --help Show Help (This screen)
- --version Show version and exit
- -v, --verbose Verbose
- -I, --path Set include path for loaders (may be used more than once)
- --only-parse Only proceed to parse step of loaders
- --only-metamodel Stop after meta-model processing
- -d, --dir Directory where doc is generated
- --source What link for source (%f for filename, %l for first line, %L for last line)
- --sharedir Directory containing the nitdoc files
- --no-dot Do not generate graphes with graphiviz
- --private Generate the private API
- --custom-title Title displayed in the top of the Overview page and as suffix of all page names
- --custom-footer-text Text displayed as footer of all pages
- --custom-overview-text Text displayed as introduction of Overview page before the modules list
- --custom-menu-items Items displayed in menu before the 'Overview' item (Each item must be enclosed in 'li' tags)
- --github-origin The branch where edited commits will be pulled into (ex: user:repo:branch)
+++ /dev/null
-ZeroClipboard.swf
-class_module_0_Int.html
-class_module_0_Object.html
-class_module_0_Sys.html
-class_module_1_A.html
-class_module_1_B.html
-dep.dot
-dep.map
-dep.png
-dep.s.dot
-dep_A.dot
-dep_A.map
-dep_A.png
-dep_A.s.dot
-dep_B.dot
-dep_B.map
-dep_B.png
-dep_B.s.dot
-dep_Int.dot
-dep_Int.map
-dep_Int.png
-dep_Int.s.dot
-dep_Object.dot
-dep_Object.map
-dep_Object.png
-dep_Object.s.dot
-dep_Sys.dot
-dep_Sys.map
-dep_Sys.png
-dep_Sys.s.dot
-dep_module_0.dot
-dep_module_0.map
-dep_module_0.png
-dep_module_0.s.dot
-dep_module_1.dot
-dep_module_1.map
-dep_module_1.png
-dep_module_1.s.dot
-index.html
-module_module_0.html
-module_module_1.html
-quicksearch-list.js
-resources/
-scripts/
-search.html
-styles/
+++ /dev/null
-usage nitcc_test <filepath> | - | -e <text>
+++ /dev/null
-Usage: nit [OPTION]... <file.nit>...
-Interprets and debbugs Nit programs.
-Use --help for help
+++ /dev/null
-Array: iterator
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-Array: iterate
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-Array: for
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-
-List: iterator
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-List: iterate
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-List: for
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-
-ArraySet: iterator
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-ArraySet: iterate
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-ArraySet: for
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-
-HashSet: iterator
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-HashSet: iterate
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-HashSet: for
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-
-ORange: iterator
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-ORange: iterate
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-ORange: for
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-
-CRange: iterator
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-CRange: iterate
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-CRange: for
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-
-ArrayMap: iterator
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-ArrayMap: iterate
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-ArrayMap: for
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-
-HashMap: iterator
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-HashMap: iterate
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-HashMap: for
- 0->0
- 1->1
- 2->2
- 3->3
- 4->4
-
+++ /dev/null
-r rw
-r rw set from native
-rw set from native
-set from native
+++ /dev/null
-0
-1
-5
-144
-0
-1
-5
-144
+++ /dev/null
-a
-a
-allo from 1234
-allo from 2345
-allo from 3456
-allo from 1234
-allo from 1234
+++ /dev/null
-false
-true
-k
-2234
-12345.0
-hello world
+++ /dev/null
-A
-B special A
+++ /dev/null
-1: rank=0; greats=0(0); smalls=19(8):
- >2 >3 >4 >5 >6 >7 >8 >9 >10 >11 >12 >13 >14 >15 >16 >17 >18 >19 >20
-2: rank=1; greats=1(1); smalls=9(4):
- <1 >4 >6 >8 >10 >12 >14 >16 >18 >20
-3: rank=1; greats=1(1); smalls=5(3):
- <1 >6 >9 >12 >15 >18
-4: rank=2; greats=2(1); smalls=4(3):
- <1 <2 >8 >12 >16 >20
-5: rank=1; greats=1(1); smalls=3(2):
- <1 >10 >15 >20
-6: rank=2; greats=3(2); smalls=2(2):
- <1 <2 <3 >12 >18
-7: rank=1; greats=1(1); smalls=1(1):
- <1 >14
-8: rank=3; greats=3(1); smalls=1(1):
- <1 <2 <4 >16
-9: rank=2; greats=2(1); smalls=1(1):
- <1 <3 >18
-10: rank=2; greats=3(2); smalls=1(1):
- <1 <2 <5 >20
-11: rank=1; greats=1(1); smalls=0(0):
- <1
-12: rank=3; greats=5(2); smalls=0(0):
- <1 <2 <3 <4 <6
-13: rank=1; greats=1(1); smalls=0(0):
- <1
-14: rank=2; greats=3(2); smalls=0(0):
- <1 <2 <7
-15: rank=2; greats=3(2); smalls=0(0):
- <1 <3 <5
-16: rank=4; greats=4(1); smalls=0(0):
- <1 <2 <4 <8
-17: rank=1; greats=1(1); smalls=0(0):
- <1
-18: rank=3; greats=5(2); smalls=0(0):
- <1 <2 <3 <6 <9
-19: rank=1; greats=1(1); smalls=0(0):
- <1
-20: rank=3; greats=5(2); smalls=0(0):
- <1 <2 <4 <5 <10
--- /dev/null
+#!/bin/bash
+# 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.
+
+stop=false
+while [ "$stop" = false ]; do
+ case $1 in
+ -v) verbose=true; shift;;
+ *) stop=true
+ esac
+done
+
+if test $# = 0; then
+ echo "Usage: search_test.sh [-v] prog/res/testname..."
+ echo "Search program paths of tests for given nit files, res files, and test names"
+ echo " -v Try to find something and display it when a test is not found."
+ exit
+fi
+
+res=0
+
+# Build the full list once to filter results
+./listfull.sh > listfull.out
+find zzz_tests >> listfull.out
+
+for f in "$@"; do
+ # Get the basename
+ case "$f" in
+ *.nit)
+ if test -f "$ff"; then
+ echo "$f"
+ continue
+ fi
+ b=`basename "$f" .nit`
+ ;;
+ *.res)
+ b=`basename "$f" .res`
+ ;;
+ *)
+ b=`basename "$f"`
+ ;;
+ esac
+ # Remove alts of args test variations
+ c=`echo "$b" | sed 's/\(_[0-9]*alt[0-9][0-9]*\)/\\\\(\1\\\\)\\\\?/g;s/\(_args[0-9][0-9]*\)/\\\\(\1\\\\)\\\\?/'`
+ b=`echo "$b" | sed 's/_[0-9]*alt[0-9][0-9]*//g;s/_args[0-9][0-9]*//'`
+ # Search the orig nit file in the list
+ cat listfull.out | grep "\b$c.nit" || {
+ res=1
+ echo >&2 "No test $b.nit found for $f"
+ test "$verbose" == "true" || continue
+ # Search the nit file outside the list...
+ find ../../nit* -name $b.nit >&2
+ # Search the nit file in the git history...
+ git log -1 -- $b.nit >&2
+ # Search the orig file in the git history...
+ git log -1 -- $f >&2
+ }
+done
+
+exit $res
--- /dev/null
+#!/bin/bash
+# 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.
+
+# List test files associated to modified file or sav
+
+if test "$#" -lt 2; then
+ echo "Usage: git_search_tests from to"
+ echo "List test files associated to modified file or sav"
+ exit
+fi
+
+from=$1
+to=$2
+
+err=0
+
+# base tests that are empirically easy to brake
+moretests="base_compile.nit base_attr.nit base_gen.nit base_gen_reassign.nit"
+
+# Get the modified files
+git diff --name-only $from..$to -- "../*.nit" "*.res" > git_search_tests.out
+
+# filter it trough ./search_tests.sh
+./search_tests.sh $moretests `cat git_search_tests.out` 2> /dev/null | sort -u
#!/bin/sh
-list=""
-for x in ../lib/*
-do
- bx=`basename $x`
- y="$x/$bx.nit"
- test -f $y && list="$list $y"
-done
-./tests.sh "$@" *.nit \
- ../examples/*.nit \
- ../examples/*/*.nit \
- ../examples/shoot/src/shoot_logic.nit \
- ../examples/*/src/*_android.nit \
- ../examples/*/src/*_linux.nit \
- ../examples/*/src/*_null.nit \
- ../examples/pnacl/converter/converter.nit \
- ../lib/*.nit $list \
- ../src/nit*.nit \
- ../src/test_*.nit \
- ../contrib/*.nit \
- ../contrib/*/*.nit \
- ../contrib/*/src/*.nit
+./tests.sh "$@" `./listfull.sh`
OLD=""
LIST=""
FIRST=""
- echo >>$xml "<testcase classname='$pack' name='$description'>"
+ echo >>$xml "<testcase classname='$pack' name='$description' time='`cat out/$pattern.time.out`' timestamp='`date -Iseconds`'>"
#for sav in "sav/$engine/fixme/$pattern.res" "sav/$engine/$pattern.res" "sav/fixme/$pattern.res" "sav/$pattern.res" "sav/$pattern.sav"; do
for savdir in $savdirs; do
sav=$savdir/fixme/$pattern.res
cat -v >>$xml out/$pattern.res
echo >>$xml "]]></system-out>"
nos="$nos $pattern"
+ echo "$ii" >> "$ERRLIST"
else
# no sav but empty res
echo "[0k] out/$pattern.res is empty"
test "$noskip" = true && return 1
if echo "$1" | grep -f "$engine.skip" >/dev/null 2>&1; then
echo "=> $2: [skip]"
- echo >>$xml "<testcase classname='$3' name='$2'><skipped/></testcase>"
+ echo >>$xml "<testcase classname='$3' name='$2' timestamp='`date -Iseconds`'><skipped/></testcase>"
return 0
fi
if test -n "$isinterpret" && echo "$1" | grep -f "exec.skip" >/dev/null 2>&1; then
echo "=> $2: [skip exec]"
- echo >>$xml "<testcase classname='$3' name='$2'><skipped/></testcase>"
+ echo >>$xml "<testcase classname='$3' name='$2' timestamp='`date -Iseconds`'><skipped/></testcase>"
return 0
fi
return 1
echo $NITC --no-color $OPT -o "$ffout" "$i" "$includes" $nocc
fi
NIT_NO_STACK=1 JNI_LIB_PATH=$JNI_LIB_PATH JAVA_HOME=$JAVA_HOME \
- $TIMEOUT $NITC --no-color $OPT -o "$ffout" "$i" $includes $nocc 2> "$ff.cmp.err" > "$ff.compile.log"
+ /usr/bin/time -f%U -o "$ff.time.out" $TIMEOUT $NITC --no-color $OPT -o "$ffout" "$i" $includes $nocc 2> "$ff.cmp.err" > "$ff.compile.log"
ERR=$?
if [ "x$verbose" = "xtrue" ]; then
cat "$ff.compile.log"
chmod +x "$ff.bin"
if grep "Fatal Error: more than one primitive class" "$ff.compile.log" > /dev/null; then
echo " [skip] do no not imports kernel"
- echo >>$xml "<testcase classname='$pack' name='$bf'><skipped/></testcase>"
+ echo >>$xml "<testcase classname='$pack' name='$bf' timestamp='`date -Iseconds`'><skipped/></testcase>"
continue
fi
fi
echo -n "==> $name "
echo "./$ff.bin $args" > "./$fff.bin"
chmod +x "./$fff.bin"
- WRITE="$fff.write" sh -c "NIT_NO_STACK=1 $TIMEOUT ./$fff.bin < $ffinputs > $fff.res 2>$fff.err"
+ WRITE="$fff.write" /usr/bin/time -f%U -o "$fff.time.out" sh -c "NIT_NO_STACK=1 $TIMEOUT ./$fff.bin < $ffinputs > $fff.res 2>$fff.err"
if [ "x$verbose" = "xtrue" ]; then
cat "$fff.res"
cat >&2 "$fff.err"
# write $ERRLIST
if [ "x$ERRLIST" != "x" ]; then
- if [ -x "$ERRLIST_TARGET" ]; then
+ if [ -f "$ERRLIST_TARGET" ]; then
mv "$ERRLIST_TARGET" "${ERRLIST_TARGET}.bak"
fi
- mv $ERRLIST $ERRLIST_TARGET
+ uniq $ERRLIST > $ERRLIST_TARGET
+ rm $ERRLIST
fi
echo >>$xml "</testsuite></testsuites>"