From: Jürg Billeter Date: Fri, 14 Nov 2008 08:51:25 +0000 (+0000) Subject: Rearrange test cases X-Git-Tag: VALA_0_5_2~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f58f4f2dd7081eb6ee242a2daeb5f0fcf573dfe2;p=thirdparty%2Fvala.git Rearrange test cases 2008-11-14 Jürg Billeter * tests/: Rearrange test cases svn path=/trunk/; revision=2014 --- diff --git a/ChangeLog b/ChangeLog index 885af2840..80824ea41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-14 Jürg Billeter + + * tests/: + + Rearrange test cases + 2008-11-13 Jürg Billeter * vala/valacodecontext.vala: diff --git a/tests/Makefile.am b/tests/Makefile.am index caa962578..1a81e1930 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,37 +16,35 @@ TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT) $(srcdir)/testrunner.sh TESTS = \ hello.vala \ - strings.vala \ - expressions-relational.vala \ - expressions-conditional.vala \ - expressions-assignments.vala \ - expressions-lambda.vala \ - statements-selection.vala \ - statements-iteration.vala \ - statements-jump.vala \ + basic-types/expressions-assignments.vala \ + basic-types/expressions-relational.vala \ + basic-types/strings.vala \ + basic-types/test-027.vala \ + basic-types/test-030.vala \ + basic-types/test-031.vala \ namespaces.vala \ - classes.vala \ - classes-fields.vala \ - classes-methods.vala \ - classes-properties.vala \ - classes-signals.vala \ - structs.vala \ - interfaces.vala \ - interfaces-properties.vala \ - enums.vala \ + methods/lambda.vala \ + control-flow/break.vala \ + control-flow/expressions-conditional.vala \ + control-flow/for.vala \ + control-flow/switch.vala \ arrays.vala \ - pointers.vala \ + enums.vala \ + structs.vala \ delegates.vala \ + objects/classes.vala \ + objects/fields.vala \ + objects/interfaces.vala \ + objects/methods.vala \ + objects/properties.vala \ + objects/signals.vala \ + objects/test-025.vala \ + objects/test-026.vala \ + objects/test-029.vala \ + objects/test-034.vala \ exceptions.vala \ - \ + pointers.vala \ test-023.vala \ - test-025.vala \ - test-026.vala \ - test-027.vala \ - test-029.vala \ - test-030.vala \ - test-031.vala \ - test-034.vala \ $(NULL) EXTRA_DIST = \ @@ -54,36 +52,34 @@ EXTRA_DIST = \ $(TESTS) \ \ hello.exp \ - strings.exp \ - expressions-relational.exp \ - expressions-conditional.exp \ - expressions-assignments.exp \ - expressions-lambda.exp \ - statements-selection.exp \ - statements-iteration.exp \ - statements-jump.exp \ + basic-types/expressions-assignments.exp \ + basic-types/expressions-relational.exp \ + basic-types/strings.exp \ + basic-types/test-027.exp \ + basic-types/test-030.exp \ + basic-types/test-031.exp \ namespaces.exp \ - classes.exp \ - classes-fields.exp \ - classes-methods.exp \ - classes-properties.exp \ - classes-signals.exp \ - structs.exp \ - interfaces.exp \ - interfaces-properties.exp \ - enums.exp \ + methods/lambda.exp \ + control-flow/break.exp \ + control-flow/expressions-conditional.exp \ + control-flow/for.exp \ + control-flow/switch.exp \ arrays.exp \ - pointers.exp \ + enums.exp \ + structs.exp \ delegates.exp \ + objects/classes.exp \ + objects/fields.exp \ + objects/interfaces.exp \ + objects/methods.exp \ + objects/properties.exp \ + objects/signals.exp \ + objects/test-025.exp \ + objects/test-026.exp \ + objects/test-029.exp \ + objects/test-034.exp \ exceptions.exp \ - \ + pointers.exp \ test-023.exp \ - test-025.exp \ - test-026.exp \ - test-027.exp \ - test-029.exp \ - test-030.exp \ - test-031.exp \ - test-034.exp \ $(NULL) diff --git a/tests/expressions-assignments.exp b/tests/basic-types/expressions-assignments.exp similarity index 100% rename from tests/expressions-assignments.exp rename to tests/basic-types/expressions-assignments.exp diff --git a/tests/expressions-assignments.vala b/tests/basic-types/expressions-assignments.vala similarity index 100% rename from tests/expressions-assignments.vala rename to tests/basic-types/expressions-assignments.vala diff --git a/tests/expressions-relational.exp b/tests/basic-types/expressions-relational.exp similarity index 100% rename from tests/expressions-relational.exp rename to tests/basic-types/expressions-relational.exp diff --git a/tests/expressions-relational.vala b/tests/basic-types/expressions-relational.vala similarity index 100% rename from tests/expressions-relational.vala rename to tests/basic-types/expressions-relational.vala diff --git a/tests/strings.exp b/tests/basic-types/strings.exp similarity index 100% rename from tests/strings.exp rename to tests/basic-types/strings.exp diff --git a/tests/strings.vala b/tests/basic-types/strings.vala similarity index 100% rename from tests/strings.vala rename to tests/basic-types/strings.vala diff --git a/tests/test-027.exp b/tests/basic-types/test-027.exp similarity index 100% rename from tests/test-027.exp rename to tests/basic-types/test-027.exp diff --git a/tests/test-027.vala b/tests/basic-types/test-027.vala similarity index 100% rename from tests/test-027.vala rename to tests/basic-types/test-027.vala diff --git a/tests/test-030.exp b/tests/basic-types/test-030.exp similarity index 100% rename from tests/test-030.exp rename to tests/basic-types/test-030.exp diff --git a/tests/test-030.vala b/tests/basic-types/test-030.vala similarity index 100% rename from tests/test-030.vala rename to tests/basic-types/test-030.vala diff --git a/tests/test-031.exp b/tests/basic-types/test-031.exp similarity index 100% rename from tests/test-031.exp rename to tests/basic-types/test-031.exp diff --git a/tests/test-031.vala b/tests/basic-types/test-031.vala similarity index 100% rename from tests/test-031.vala rename to tests/basic-types/test-031.vala diff --git a/tests/statements-jump.exp b/tests/control-flow/break.exp similarity index 100% rename from tests/statements-jump.exp rename to tests/control-flow/break.exp diff --git a/tests/statements-jump.vala b/tests/control-flow/break.vala similarity index 100% rename from tests/statements-jump.vala rename to tests/control-flow/break.vala diff --git a/tests/expressions-conditional.exp b/tests/control-flow/expressions-conditional.exp similarity index 100% rename from tests/expressions-conditional.exp rename to tests/control-flow/expressions-conditional.exp diff --git a/tests/expressions-conditional.vala b/tests/control-flow/expressions-conditional.vala similarity index 100% rename from tests/expressions-conditional.vala rename to tests/control-flow/expressions-conditional.vala diff --git a/tests/statements-iteration.exp b/tests/control-flow/for.exp similarity index 100% rename from tests/statements-iteration.exp rename to tests/control-flow/for.exp diff --git a/tests/statements-iteration.vala b/tests/control-flow/for.vala similarity index 100% rename from tests/statements-iteration.vala rename to tests/control-flow/for.vala diff --git a/tests/statements-selection.exp b/tests/control-flow/switch.exp similarity index 100% rename from tests/statements-selection.exp rename to tests/control-flow/switch.exp diff --git a/tests/statements-selection.vala b/tests/control-flow/switch.vala similarity index 100% rename from tests/statements-selection.vala rename to tests/control-flow/switch.vala diff --git a/tests/interfaces-properties.exp b/tests/interfaces-properties.exp deleted file mode 100644 index d5d0c6da6..000000000 --- a/tests/interfaces-properties.exp +++ /dev/null @@ -1 +0,0 @@ -Interface Properties Test: 1 2 3 diff --git a/tests/interfaces-properties.vala b/tests/interfaces-properties.vala deleted file mode 100644 index b65fc5fc4..000000000 --- a/tests/interfaces-properties.vala +++ /dev/null @@ -1,29 +0,0 @@ -using GLib; - -interface Maman.Ibaz : Object { - public abstract int number { get; } - - public void simple_method () { - int n = number; - stdout.printf (" %d", n); - } -} - -class Maman.Baz : Object, Ibaz { - public int number { - get { return 2; } - } -} - -class Maman.SubBaz : Baz { - static int main (string[] args) { - stdout.printf ("Interface Properties Test: 1"); - - Ibaz ibaz = new Baz (); - ibaz.simple_method (); - - stdout.printf (" 3\n"); - - return 0; - } -} diff --git a/tests/expressions-lambda.exp b/tests/methods/lambda.exp similarity index 100% rename from tests/expressions-lambda.exp rename to tests/methods/lambda.exp diff --git a/tests/expressions-lambda.vala b/tests/methods/lambda.vala similarity index 100% rename from tests/expressions-lambda.vala rename to tests/methods/lambda.vala diff --git a/tests/classes.exp b/tests/objects/classes.exp similarity index 100% rename from tests/classes.exp rename to tests/objects/classes.exp diff --git a/tests/classes.vala b/tests/objects/classes.vala similarity index 100% rename from tests/classes.vala rename to tests/objects/classes.vala diff --git a/tests/classes-fields.exp b/tests/objects/fields.exp similarity index 100% rename from tests/classes-fields.exp rename to tests/objects/fields.exp diff --git a/tests/classes-fields.vala b/tests/objects/fields.vala similarity index 100% rename from tests/classes-fields.vala rename to tests/objects/fields.vala diff --git a/tests/interfaces.exp b/tests/objects/interfaces.exp similarity index 100% rename from tests/interfaces.exp rename to tests/objects/interfaces.exp diff --git a/tests/interfaces.vala b/tests/objects/interfaces.vala similarity index 100% rename from tests/interfaces.vala rename to tests/objects/interfaces.vala diff --git a/tests/classes-methods.exp b/tests/objects/methods.exp similarity index 100% rename from tests/classes-methods.exp rename to tests/objects/methods.exp diff --git a/tests/classes-methods.vala b/tests/objects/methods.vala similarity index 100% rename from tests/classes-methods.vala rename to tests/objects/methods.vala diff --git a/tests/classes-properties.exp b/tests/objects/properties.exp similarity index 82% rename from tests/classes-properties.exp rename to tests/objects/properties.exp index 33fd11340..ee2398dd0 100644 --- a/tests/classes-properties.exp +++ b/tests/objects/properties.exp @@ -4,3 +4,4 @@ name: TheNewName read_only: InitialReadOnly automatic: TheNewAutomatic Property Test: 1 2 3 4 5 6 7 +Interface Properties Test: 1 2 3 diff --git a/tests/classes-properties.vala b/tests/objects/properties.vala similarity index 83% rename from tests/classes-properties.vala rename to tests/objects/properties.vala index 6fec5375b..e3571d089 100644 --- a/tests/classes-properties.vala +++ b/tests/objects/properties.vala @@ -49,6 +49,13 @@ public class Sample : Object { Maman.Bar.run (); + stdout.printf ("Interface Properties Test: 1"); + + Maman.Ibaz ibaz = new Maman.Baz (); + ibaz.simple_method (); + + stdout.printf (" 3\n"); + return 0; } } @@ -91,3 +98,17 @@ class Maman.Bar : Foo { } } +interface Maman.Ibaz : Object { + public abstract int number { get; } + + public void simple_method () { + int n = number; + stdout.printf (" %d", n); + } +} + +class Maman.Baz : Object, Ibaz { + public int number { + get { return 2; } + } +} diff --git a/tests/classes-signals.exp b/tests/objects/signals.exp similarity index 100% rename from tests/classes-signals.exp rename to tests/objects/signals.exp diff --git a/tests/classes-signals.vala b/tests/objects/signals.vala similarity index 100% rename from tests/classes-signals.vala rename to tests/objects/signals.vala diff --git a/tests/test-025.exp b/tests/objects/test-025.exp similarity index 100% rename from tests/test-025.exp rename to tests/objects/test-025.exp diff --git a/tests/test-025.vala b/tests/objects/test-025.vala similarity index 100% rename from tests/test-025.vala rename to tests/objects/test-025.vala diff --git a/tests/test-026.exp b/tests/objects/test-026.exp similarity index 100% rename from tests/test-026.exp rename to tests/objects/test-026.exp diff --git a/tests/test-026.vala b/tests/objects/test-026.vala similarity index 100% rename from tests/test-026.vala rename to tests/objects/test-026.vala diff --git a/tests/test-029.exp b/tests/objects/test-029.exp similarity index 100% rename from tests/test-029.exp rename to tests/objects/test-029.exp diff --git a/tests/test-029.vala b/tests/objects/test-029.vala similarity index 100% rename from tests/test-029.vala rename to tests/objects/test-029.vala diff --git a/tests/test-034.exp b/tests/objects/test-034.exp similarity index 100% rename from tests/test-034.exp rename to tests/objects/test-034.exp diff --git a/tests/test-034.vala b/tests/objects/test-034.vala similarity index 100% rename from tests/test-034.vala rename to tests/objects/test-034.vala diff --git a/tests/testrunner.sh b/tests/testrunner.sh index 99026bfe9..96a92092f 100755 --- a/tests/testrunner.sh +++ b/tests/testrunner.sh @@ -42,27 +42,26 @@ CODE=0 for testcasesource in "$@" do testsrc=${testcasesource/.vala/} - testbuild=`basename "$testsrc"` - if ! $VALAC -C --vapidir "$vapidir" --basedir $topsrcdir -d $topbuilddir $testsrc.vala > $testbuild.err 2>&1 + if ! $VALAC -C --vapidir "$vapidir" --basedir $topsrcdir -d $topbuilddir $testsrc.vala > $testsrc.err 2>&1 then echo "ERROR: Compiling" $testcasesource - cat $testbuild.err + cat $testsrc.err CODE=1 continue fi - if ! $CC $CFLAGS $testbuild.c $(pkg-config --cflags --libs gobject-2.0) -o $testbuild $LDLIBS > $testbuild.err 2>&1 + if ! $CC $CFLAGS $testsrc.c $(pkg-config --cflags --libs gobject-2.0) -o $testsrc $LDLIBS > $testsrc.err 2>&1 then - echo "ERROR: Compiling" $testbuild.c - cat $testbuild.err + echo "ERROR: Compiling" $testsrc.c + cat $testsrc.err CODE=1 continue fi - if ./$testbuild 2>&1 | tee $testbuild.err | cmp -s $testsrc.exp + if ./$testsrc 2>&1 | tee $testsrc.err | cmp -s $testsrc.exp then - rm $testbuild.c $testbuild.h $testbuild$exe $testbuild.err + rm $testsrc.c $testsrc.h $testsrc$exe $testsrc.err else - echo "ERROR: test failed. This is the difference between" $testbuild.exp "and" $testbuild.err - diff -u $testbuild.exp $testbuild.err + echo "ERROR: test failed. This is the difference between" $testsrc.exp "and" $testsrc.err + diff -u $testsrc.exp $testsrc.err CODE=1 fi done