diff options
author | Jürg Billeter <j@bitron.ch> | 2008-11-22 21:09:35 +0000 |
---|---|---|
committer | Jürg Billeter <juergbi@src.gnome.org> | 2008-11-22 21:09:35 +0000 |
commit | dc8c2b1a99b49cdd4e6f853302f99544d961e424 (patch) | |
tree | 31e63686eb7e90de6d4271e577af7edb154e212b | |
parent | cde9aef502250dff10017bc749c6f57228726e40 (diff) | |
download | vala-dc8c2b1a99b49cdd4e6f853302f99544d961e424.tar.gz |
Prepare support for more complex test cases
2008-11-22 Jürg Billeter <j@bitron.ch>
* tests/:
Prepare support for more complex test cases
svn path=/trunk/; revision=2060
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | tests/Makefile.am | 84 | ||||
-rw-r--r-- | tests/arrays.exp | 6 | ||||
-rw-r--r-- | tests/arrays.test (renamed from tests/arrays.vala) | 3 | ||||
-rw-r--r-- | tests/basic-types/floats.exp | 18 | ||||
-rw-r--r-- | tests/basic-types/floats.test (renamed from tests/basic-types/floats.vala) | 3 | ||||
-rw-r--r-- | tests/basic-types/integers.exp | 10 | ||||
-rw-r--r-- | tests/basic-types/integers.test (renamed from tests/basic-types/integers.vala) | 3 | ||||
-rw-r--r-- | tests/basic-types/strings.exp | 1 | ||||
-rw-r--r-- | tests/basic-types/strings.test (renamed from tests/basic-types/strings.vala) | 3 | ||||
-rw-r--r-- | tests/basic-types/test-027.exp | 2 | ||||
-rw-r--r-- | tests/basic-types/test-027.test (renamed from tests/basic-types/test-027.vala) | 3 | ||||
-rw-r--r-- | tests/control-flow/break.exp | 1 | ||||
-rw-r--r-- | tests/control-flow/break.test (renamed from tests/control-flow/break.vala) | 3 | ||||
-rw-r--r-- | tests/control-flow/expressions-conditional.exp | 1 | ||||
-rw-r--r-- | tests/control-flow/expressions-conditional.test (renamed from tests/control-flow/expressions-conditional.vala) | 3 | ||||
-rw-r--r-- | tests/control-flow/for.exp | 0 | ||||
-rw-r--r-- | tests/control-flow/for.test (renamed from tests/control-flow/for.vala) | 3 | ||||
-rw-r--r-- | tests/control-flow/switch.exp | 2 | ||||
-rw-r--r-- | tests/control-flow/switch.test (renamed from tests/control-flow/switch.vala) | 3 | ||||
-rw-r--r-- | tests/delegates.exp | 2 | ||||
-rw-r--r-- | tests/delegates.test (renamed from tests/delegates.vala) | 3 | ||||
-rw-r--r-- | tests/enums.exp | 1 | ||||
-rw-r--r-- | tests/enums.test (renamed from tests/enums.vala) | 3 | ||||
-rw-r--r-- | tests/exceptions.exp | 1 | ||||
-rw-r--r-- | tests/exceptions.test (renamed from tests/exceptions.vala) | 3 | ||||
-rw-r--r-- | tests/hello.exp | 1 | ||||
-rw-r--r-- | tests/hello.vala | 17 | ||||
-rw-r--r-- | tests/methods/lambda.exp | 1 | ||||
-rw-r--r-- | tests/methods/lambda.test (renamed from tests/methods/lambda.vala) | 3 | ||||
-rw-r--r-- | tests/namespaces.exp | 2 | ||||
-rw-r--r-- | tests/namespaces.test (renamed from tests/namespaces.vala) | 3 | ||||
-rw-r--r-- | tests/objects/classes.exp | 25 | ||||
-rw-r--r-- | tests/objects/classes.test (renamed from tests/objects/classes.vala) | 3 | ||||
-rw-r--r-- | tests/objects/fields.exp | 1 | ||||
-rw-r--r-- | tests/objects/fields.test (renamed from tests/objects/fields.vala) | 3 | ||||
-rw-r--r-- | tests/objects/interfaces.exp | 1 | ||||
-rw-r--r-- | tests/objects/interfaces.test (renamed from tests/objects/interfaces.vala) | 3 | ||||
-rw-r--r-- | tests/objects/methods.exp | 8 | ||||
-rw-r--r-- | tests/objects/methods.test (renamed from tests/objects/methods.vala) | 3 | ||||
-rw-r--r-- | tests/objects/properties.exp | 7 | ||||
-rw-r--r-- | tests/objects/properties.test (renamed from tests/objects/properties.vala) | 3 | ||||
-rw-r--r-- | tests/objects/signals.exp | 3 | ||||
-rw-r--r-- | tests/objects/signals.test (renamed from tests/objects/signals.vala) | 3 | ||||
-rw-r--r-- | tests/objects/test-025.exp | 1 | ||||
-rw-r--r-- | tests/objects/test-025.test (renamed from tests/objects/test-025.vala) | 3 | ||||
-rw-r--r-- | tests/objects/test-026.exp | 1 | ||||
-rw-r--r-- | tests/objects/test-026.test (renamed from tests/objects/test-026.vala) | 3 | ||||
-rw-r--r-- | tests/objects/test-029.exp | 1 | ||||
-rw-r--r-- | tests/objects/test-029.test (renamed from tests/objects/test-029.vala) | 3 | ||||
-rw-r--r-- | tests/objects/test-034.exp | 7 | ||||
-rw-r--r-- | tests/objects/test-034.test (renamed from tests/objects/test-034.vala) | 3 | ||||
-rw-r--r-- | tests/pointers.exp | 0 | ||||
-rw-r--r-- | tests/pointers.test (renamed from tests/pointers.vala) | 3 | ||||
-rw-r--r-- | tests/structs.exp | 15 | ||||
-rw-r--r-- | tests/structs.test (renamed from tests/structs.vala) | 3 | ||||
-rw-r--r-- | tests/test-023.exp | 1 | ||||
-rw-r--r-- | tests/test-023.test (renamed from tests/test-023.vala) | 3 | ||||
-rwxr-xr-x | tests/testrunner.sh | 109 |
59 files changed, 198 insertions, 219 deletions
@@ -1,5 +1,11 @@ 2008-11-22 Jürg Billeter <j@bitron.ch> + * tests/: + + Prepare support for more complex test cases + +2008-11-22 Jürg Billeter <j@bitron.ch> + * gobject/valaccodemethodmodule.vala: Whitespace fixes diff --git a/tests/Makefile.am b/tests/Makefile.am index 07768aa67..204dce88f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,67 +15,37 @@ noinst_PROGRAMS = \ TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT) $(srcdir)/testrunner.sh TESTS = \ - hello.vala \ - basic-types/floats.vala \ - basic-types/integers.vala \ - basic-types/strings.vala \ - basic-types/test-027.vala \ - namespaces.vala \ - methods/lambda.vala \ - control-flow/break.vala \ - control-flow/expressions-conditional.vala \ - control-flow/for.vala \ - control-flow/switch.vala \ - arrays.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 \ + basic-types/floats.test \ + basic-types/integers.test \ + basic-types/strings.test \ + basic-types/test-027.test \ + namespaces.test \ + methods/lambda.test \ + control-flow/break.test \ + control-flow/expressions-conditional.test \ + control-flow/for.test \ + control-flow/switch.test \ + arrays.test \ + enums.test \ + structs.test \ + delegates.test \ + objects/classes.test \ + objects/fields.test \ + objects/interfaces.test \ + objects/methods.test \ + objects/properties.test \ + objects/signals.test \ + objects/test-025.test \ + objects/test-026.test \ + objects/test-029.test \ + objects/test-034.test \ + exceptions.test \ + pointers.test \ + test-023.test \ $(NULL) EXTRA_DIST = \ testrunner.sh \ $(TESTS) \ - \ - hello.exp \ - basic-types/floats.exp \ - basic-types/integers.exp \ - basic-types/strings.exp \ - basic-types/test-027.exp \ - namespaces.exp \ - methods/lambda.exp \ - control-flow/break.exp \ - control-flow/expressions-conditional.exp \ - control-flow/for.exp \ - control-flow/switch.exp \ - arrays.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 \ $(NULL) diff --git a/tests/arrays.exp b/tests/arrays.exp deleted file mode 100644 index 344248b23..000000000 --- a/tests/arrays.exp +++ /dev/null @@ -1,6 +0,0 @@ -One dimensional array creation and assignment: 1 2 3 4 5 6 7 8 9 10 11 -String array creation and assignment: 1 2 3 4 5 6 7 8 9 10 11 -Object array creation and assignment: 1 2 3 4 5 6 7 8 9 10 11 -Array Test: 1 2 3 4 5 -testing switch on strings: 1 2 3 4 5 6 7 -Element access: 1 2 3 4 5 6 7 8 9 10 11 12 13 diff --git a/tests/arrays.vala b/tests/arrays.test index f4dea49f3..3e05b5e4a 100644 --- a/tests/arrays.vala +++ b/tests/arrays.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; class Maman.Foo : Object { diff --git a/tests/basic-types/floats.exp b/tests/basic-types/floats.exp deleted file mode 100644 index 9fef60ec2..000000000 --- a/tests/basic-types/floats.exp +++ /dev/null @@ -1,18 +0,0 @@ -float: range=1.17549e-38...3.40282e+38 - digits=24(6), exp=-125..128(-37..38) - epsilon=1.19209e-07, infinity=inf/-inf, nan=nan -float(1.19209e-07): nan=false, finite=true, normal=true, infinity=none -float(0): nan=false, finite=true, normal=false, infinity=none -float(1): nan=false, finite=true, normal=true, infinity=none -float(-inf): nan=false, finite=false, normal=false, infinity=negative -float(inf): nan=false, finite=false, normal=false, infinity=positive -float(nan): nan=true, finite=false, normal=false, infinity=none -double: range=2.22507e-308...1.79769e+308 - digits=53(15), exp=-1021..1024(-307..308) - epsilon=2.22045e-16, infinity=inf/-inf, nan=nan -double(2.22045e-16): nan=false, finite=true, normal=true, infinity=none -double(0): nan=false, finite=true, normal=false, infinity=none -double(1): nan=false, finite=true, normal=true, infinity=none -double(-inf): nan=false, finite=false, normal=false, infinity=negative -double(inf): nan=false, finite=false, normal=false, infinity=positive -double(nan): nan=true, finite=false, normal=false, infinity=none diff --git a/tests/basic-types/floats.vala b/tests/basic-types/floats.test index 21a3d0004..da7e6c07c 100644 --- a/tests/basic-types/floats.vala +++ b/tests/basic-types/floats.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; class Maman.Foo : Object { diff --git a/tests/basic-types/integers.exp b/tests/basic-types/integers.exp deleted file mode 100644 index 9c8ef76c9..000000000 --- a/tests/basic-types/integers.exp +++ /dev/null @@ -1,10 +0,0 @@ -Binary Expression Test: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 -Assignment Test: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 -int8: -128...127 -int16: -32768...32767 -int32: -2147483648...2147483647 -int64: -9223372036854775808...9223372036854775807 -uint8: 0...255 -uint16: 0...65535 -uint32: 0...4294967295 -uint64: 0...18446744073709551615 diff --git a/tests/basic-types/integers.vala b/tests/basic-types/integers.test index e6927d5dc..0ab6fdbf5 100644 --- a/tests/basic-types/integers.vala +++ b/tests/basic-types/integers.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; class Maman.Bar : Object { diff --git a/tests/basic-types/strings.exp b/tests/basic-types/strings.exp deleted file mode 100644 index 5b9feab5e..000000000 --- a/tests/basic-types/strings.exp +++ /dev/null @@ -1 +0,0 @@ -String Test: 1 2 3 4 5 6 7 8 diff --git a/tests/basic-types/strings.vala b/tests/basic-types/strings.test index 95ba30562..0ecd559b3 100644 --- a/tests/basic-types/strings.vala +++ b/tests/basic-types/strings.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; class Maman.Foo : Object { diff --git a/tests/basic-types/test-027.exp b/tests/basic-types/test-027.exp deleted file mode 100644 index 58bbc8cff..000000000 --- a/tests/basic-types/test-027.exp +++ /dev/null @@ -1,2 +0,0 @@ -Postfix and Prefix Expression Test: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 -Prefix Increment in Loop Test: 0 1 2 3 4 5 6 7 8 9 10 diff --git a/tests/basic-types/test-027.vala b/tests/basic-types/test-027.test index 3b7cd322d..cb97a19c7 100644 --- a/tests/basic-types/test-027.vala +++ b/tests/basic-types/test-027.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; class Maman.Bar : Object { diff --git a/tests/control-flow/break.exp b/tests/control-flow/break.exp deleted file mode 100644 index da2c08e56..000000000 --- a/tests/control-flow/break.exp +++ /dev/null @@ -1 +0,0 @@ -Break Test: 1 2 3 diff --git a/tests/control-flow/break.vala b/tests/control-flow/break.test index 6566f9349..71f3297b4 100644 --- a/tests/control-flow/break.vala +++ b/tests/control-flow/break.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; class Maman.Bar : Object { diff --git a/tests/control-flow/expressions-conditional.exp b/tests/control-flow/expressions-conditional.exp deleted file mode 100644 index 722484515..000000000 --- a/tests/control-flow/expressions-conditional.exp +++ /dev/null @@ -1 +0,0 @@ -Conditional Expression Test: 1 2 3 4 5 diff --git a/tests/control-flow/expressions-conditional.vala b/tests/control-flow/expressions-conditional.test index 570b24798..f9e7c1fc2 100644 --- a/tests/control-flow/expressions-conditional.vala +++ b/tests/control-flow/expressions-conditional.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; class Maman.Bar : Object { diff --git a/tests/control-flow/for.exp b/tests/control-flow/for.exp deleted file mode 100644 index e69de29bb..000000000 --- a/tests/control-flow/for.exp +++ /dev/null diff --git a/tests/control-flow/for.vala b/tests/control-flow/for.test index c435c0417..60f3c97d8 100644 --- a/tests/control-flow/for.vala +++ b/tests/control-flow/for.test @@ -1,3 +1,6 @@ + +Program: test + void void_method () { } diff --git a/tests/control-flow/switch.exp b/tests/control-flow/switch.exp deleted file mode 100644 index 0cd510332..000000000 --- a/tests/control-flow/switch.exp +++ /dev/null @@ -1,2 +0,0 @@ -For Test: 1 2 3 4 5 6 7 -Switch statement: 1 2 3 4 5 6 7 diff --git a/tests/control-flow/switch.vala b/tests/control-flow/switch.test index 5e6450455..1ee8bb735 100644 --- a/tests/control-flow/switch.vala +++ b/tests/control-flow/switch.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; class Maman.Bar : Object { diff --git a/tests/delegates.exp b/tests/delegates.exp deleted file mode 100644 index 4d6380edd..000000000 --- a/tests/delegates.exp +++ /dev/null @@ -1,2 +0,0 @@ -Delegate Test: 1 2 3 4 5 6 7 -testing function pointers: 1 2 3 diff --git a/tests/delegates.vala b/tests/delegates.test index 6ff52c83d..504ff0824 100644 --- a/tests/delegates.vala +++ b/tests/delegates.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; public static delegate void Maman.VoidCallback (); diff --git a/tests/enums.exp b/tests/enums.exp deleted file mode 100644 index d39e190f1..000000000 --- a/tests/enums.exp +++ /dev/null @@ -1 +0,0 @@ -Enum Test: 1 2 3 4 5 6 diff --git a/tests/enums.vala b/tests/enums.test index aa5437a5b..f687e4c13 100644 --- a/tests/enums.vala +++ b/tests/enums.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; enum Maman.Foo { diff --git a/tests/exceptions.exp b/tests/exceptions.exp deleted file mode 100644 index e884946f6..000000000 --- a/tests/exceptions.exp +++ /dev/null @@ -1 +0,0 @@ -Exception Test: 1 2 3 4 5 6 7 8 9 10 11 diff --git a/tests/exceptions.vala b/tests/exceptions.test index 95fa07c56..469564930 100644 --- a/tests/exceptions.vala +++ b/tests/exceptions.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; errordomain Maman.BarError { diff --git a/tests/hello.exp b/tests/hello.exp deleted file mode 100644 index af5626b4a..000000000 --- a/tests/hello.exp +++ /dev/null @@ -1 +0,0 @@ -Hello, world! diff --git a/tests/hello.vala b/tests/hello.vala deleted file mode 100644 index ddc560318..000000000 --- a/tests/hello.vala +++ /dev/null @@ -1,17 +0,0 @@ -using GLib; - -public class Sample : Object { - public Sample () { - } - - public void run () { - stdout.printf ("Hello, world!\n"); - } - - static int main (string[] args) { - var sample = new Sample (); - sample.run (); - return 0; - } -} - diff --git a/tests/methods/lambda.exp b/tests/methods/lambda.exp deleted file mode 100644 index e644d9bec..000000000 --- a/tests/methods/lambda.exp +++ /dev/null @@ -1 +0,0 @@ -Lambda Test: 1 2 3 4 diff --git a/tests/methods/lambda.vala b/tests/methods/lambda.test index 5811d93d1..e2f4ad1e6 100644 --- a/tests/methods/lambda.vala +++ b/tests/methods/lambda.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; static delegate int Maman.ActionCallback (int i); diff --git a/tests/namespaces.exp b/tests/namespaces.exp deleted file mode 100644 index 5fd7a44e2..000000000 --- a/tests/namespaces.exp +++ /dev/null @@ -1,2 +0,0 @@ -Namespace Test -Class in Namespace Test diff --git a/tests/namespaces.vala b/tests/namespaces.test index 1469ec894..748ae5d24 100644 --- a/tests/namespaces.vala +++ b/tests/namespaces.test @@ -1,3 +1,6 @@ + +Program: test + using Foo.Sub; public class GlobalTestClass { diff --git a/tests/objects/classes.exp b/tests/objects/classes.exp deleted file mode 100644 index 795410563..000000000 --- a/tests/objects/classes.exp +++ /dev/null @@ -1,25 +0,0 @@ -Classes Test: -new CompactClass () -new DerivedClass () -new PublicClass () -new ClassWithCreationMethod () -ClassWithCreationMethod -new ClassWithNamedCreationMethod () -ClassWithNamedCreationMethod -new CompactClassWithDestructor () -~CompactClassWithDestructor -new SimpleGTypeInstanceClass () -new DerivedGTypeInstanceClass () -new PublicGTypeInstanceClass () -new GTypeInstanceClassWithCreationMethod () -GTypeInstanceClassWithCreationMethod -new GTypeInstanceClassWithNamedCreationMethod () -GTypeInstanceClassWithNamedCreationMethod -new SimpleGObjectClass () -new DerivedGObjectClass () -new PublicGObjectClass () -new GObjectClassWithCreationMethod () -new GObjectClassWithNamedCreationMethod () -new CompactClass () { field = 1 } -compact_class.field = 1 -. diff --git a/tests/objects/classes.vala b/tests/objects/classes.test index a89f475e6..edcbaca48 100644 --- a/tests/objects/classes.vala +++ b/tests/objects/classes.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; [Compact] diff --git a/tests/objects/fields.exp b/tests/objects/fields.exp deleted file mode 100644 index 2be916e98..000000000 --- a/tests/objects/fields.exp +++ /dev/null @@ -1 +0,0 @@ -Field Test: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 diff --git a/tests/objects/fields.vala b/tests/objects/fields.test index 0d091c75f..f347fbb1a 100644 --- a/tests/objects/fields.vala +++ b/tests/objects/fields.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; [Compact] diff --git a/tests/objects/interfaces.exp b/tests/objects/interfaces.exp deleted file mode 100644 index 388004fe9..000000000 --- a/tests/objects/interfaces.exp +++ /dev/null @@ -1 +0,0 @@ -Interface Test: 1 2 3 4 5 6 7 diff --git a/tests/objects/interfaces.vala b/tests/objects/interfaces.test index 7eb652e3f..64d42794c 100644 --- a/tests/objects/interfaces.vala +++ b/tests/objects/interfaces.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; interface Maman.Ibaz : Object { diff --git a/tests/objects/methods.exp b/tests/objects/methods.exp deleted file mode 100644 index b32fe50f8..000000000 --- a/tests/objects/methods.exp +++ /dev/null @@ -1,8 +0,0 @@ -Inheritance Test: 1 2 3 -Static Inheritance Test: 1 2 3 -Virtual Method Test: 1 2 3 -Interface Inheritance Test: 1 2 3 -Access class method in class constructor: OK -Access class method in static constructor: OK -Access class method by member access: OK -Access class method in instance method: OK diff --git a/tests/objects/methods.vala b/tests/objects/methods.test index 33696ca52..0682ed674 100644 --- a/tests/objects/methods.vala +++ b/tests/objects/methods.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; class Maman.Bar : Object { diff --git a/tests/objects/properties.exp b/tests/objects/properties.exp deleted file mode 100644 index ee2398dd0..000000000 --- a/tests/objects/properties.exp +++ /dev/null @@ -1,7 +0,0 @@ -property `name' has changed! -automatic: TheNewAutomatic -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/objects/properties.vala b/tests/objects/properties.test index e3571d089..b8e6f332b 100644 --- a/tests/objects/properties.vala +++ b/tests/objects/properties.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; public class Sample : Object { diff --git a/tests/objects/signals.exp b/tests/objects/signals.exp deleted file mode 100644 index ec783ec45..000000000 --- a/tests/objects/signals.exp +++ /dev/null @@ -1,3 +0,0 @@ -Signal Test: 1 2 3 4 5 6 7 8 9 10 -User Signal Test: 1 2 3 4 5 6 -Signal Return Test: 1 2 3 4 5 6 7 8 diff --git a/tests/objects/signals.vala b/tests/objects/signals.test index 52b4b2538..ced2f3ae0 100644 --- a/tests/objects/signals.vala +++ b/tests/objects/signals.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; class Maman.Foo : Object { diff --git a/tests/objects/test-025.exp b/tests/objects/test-025.exp deleted file mode 100644 index 176920418..000000000 --- a/tests/objects/test-025.exp +++ /dev/null @@ -1 +0,0 @@ -Base Access Test: 1 2 3 4 5 diff --git a/tests/objects/test-025.vala b/tests/objects/test-025.test index 2d83913e7..5f224ab0c 100644 --- a/tests/objects/test-025.vala +++ b/tests/objects/test-025.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; class Maman.Bar : Object { diff --git a/tests/objects/test-026.exp b/tests/objects/test-026.exp deleted file mode 100644 index b201cf130..000000000 --- a/tests/objects/test-026.exp +++ /dev/null @@ -1 +0,0 @@ -Hidden Base Method Access Test: 1 2 3 4 5 diff --git a/tests/objects/test-026.vala b/tests/objects/test-026.test index 2c6ab84e4..2a133f94e 100644 --- a/tests/objects/test-026.vala +++ b/tests/objects/test-026.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; class Maman.Bar : Object { diff --git a/tests/objects/test-029.exp b/tests/objects/test-029.exp deleted file mode 100644 index 4dcfda1c9..000000000 --- a/tests/objects/test-029.exp +++ /dev/null @@ -1 +0,0 @@ -Construct Formal Parameter Test: 1 2 3 4 5 diff --git a/tests/objects/test-029.vala b/tests/objects/test-029.test index 966caf898..bb13e2673 100644 --- a/tests/objects/test-029.vala +++ b/tests/objects/test-029.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; class Maman.Foo : Object { diff --git a/tests/objects/test-034.exp b/tests/objects/test-034.exp deleted file mode 100644 index 5b6d300be..000000000 --- a/tests/objects/test-034.exp +++ /dev/null @@ -1,7 +0,0 @@ -init: 1 1 1 -is A: 1 1 0 -is B: 0 1 0 -is C: 0 0 1 -as A: 1 1 0 -as B: 0 1 0 -as C: 0 0 1 diff --git a/tests/objects/test-034.vala b/tests/objects/test-034.test index 4f16b3481..f8394fd43 100644 --- a/tests/objects/test-034.vala +++ b/tests/objects/test-034.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; class Maman.A : Object { diff --git a/tests/pointers.exp b/tests/pointers.exp deleted file mode 100644 index e69de29bb..000000000 --- a/tests/pointers.exp +++ /dev/null diff --git a/tests/pointers.vala b/tests/pointers.test index 2225487e3..75b43ff26 100644 --- a/tests/pointers.vala +++ b/tests/pointers.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; struct SimpleStruct { diff --git a/tests/structs.exp b/tests/structs.exp deleted file mode 100644 index 868124385..000000000 --- a/tests/structs.exp +++ /dev/null @@ -1,15 +0,0 @@ -Structs Test: -new SimpleStruct () -new PublicStruct () -new StructWithCreationMethod () -StructWithCreationMethod -new StructWithNamedCreationMethod () -StructWithNamedCreationMethod -new SimpleStruct () { field = 1 } -simple_struct.field = 1 -test_in_parameter: st.field = 1 -test_ref_parameter: st.field = 1 -after test_ref_parameter: st.field = 2 -after test_out_parameter: st.field = 3 -StructWithPrivateField: field = 1 -. diff --git a/tests/structs.vala b/tests/structs.test index 2a5c06c47..4b39feeb4 100644 --- a/tests/structs.vala +++ b/tests/structs.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; struct SimpleStruct { diff --git a/tests/test-023.exp b/tests/test-023.exp deleted file mode 100644 index 2524c562e..000000000 --- a/tests/test-023.exp +++ /dev/null @@ -1 +0,0 @@ -List construction: 1 2 3 4 diff --git a/tests/test-023.vala b/tests/test-023.test index ac2387eb1..b4f073dc1 100644 --- a/tests/test-023.vala +++ b/tests/test-023.test @@ -1,3 +1,6 @@ + +Program: test + using GLib; class Maman.Foo : Object { diff --git a/tests/testrunner.sh b/tests/testrunner.sh index 96a92092f..37c0cb89f 100755 --- a/tests/testrunner.sh +++ b/tests/testrunner.sh @@ -25,10 +25,6 @@ topbuilddir=$builddir/.. srcdir=`dirname $0` topsrcdir=$srcdir/.. vapidir=$topsrcdir/vapi -exe=$EXEEXT - -# make sure we detect failed test cases -set -o pipefail export G_DEBUG=fatal_warnings @@ -39,31 +35,94 @@ LDLIBS="-lm" CODE=0 -for testcasesource in "$@" -do - testsrc=${testcasesource/.vala/} - if ! $VALAC -C --vapidir "$vapidir" --basedir $topsrcdir -d $topbuilddir $testsrc.vala > $testsrc.err 2>&1 - then - echo "ERROR: Compiling" $testcasesource - cat $testsrc.err - CODE=1 - continue +function testheader() { + if [ "$1" = "Packages:" ]; then + shift + PACKAGES="$@" + for pkg in $PACKAGES; do + if [ "$pkg" = "dbus-glib-1" ]; then + echo 'eval `dbus-launch --sh-syntax`' >> prepare + echo 'trap "kill $DBUS_SESSION_BUS_PID" INT TERM EXIT' >> prepare + fi + done fi - if ! $CC $CFLAGS $testsrc.c $(pkg-config --cflags --libs gobject-2.0) -o $testsrc $LDLIBS > $testsrc.err 2>&1 - then - echo "ERROR: Compiling" $testsrc.c - cat $testsrc.err - CODE=1 - continue +} + +function sourceheader() { + if [ "$1" = "Program:" ]; then + PROGRAM=$2 + SOURCEFILE=$PROGRAM.vala fi - if ./$testsrc 2>&1 | tee $testsrc.err | cmp -s $testsrc.exp - then - rm $testsrc.c $testsrc.h $testsrc$exe $testsrc.err - else - echo "ERROR: test failed. This is the difference between" $testsrc.exp "and" $testsrc.err - diff -u $testsrc.exp $testsrc.err +} + +function sourceend() { + if [ -n "$PROGRAM" ]; then + echo "$VALAC $(echo $PACKAGES | xargs -n 1 -r echo --pkg) -C $SOURCEFILE" >> build + echo "$CC $CFLAGS $LDLIBS \$(pkg-config --cflags --libs glib-2.0 gobject-2.0 $PACKAGES) -o $PROGRAM$EXEEXT $PROGRAM.c" >> build + echo "./$PROGRAM$EXEEXT" > check + fi +} + +for testfile in "$@"; do + testname=$(basename $testfile) + testdir=${testname/.test/.d} + rm -rf $testdir + mkdir $testdir + cd $testdir + + touch prepare build check cleanup + + echo 'set -e' >> prepare + + PART=0 + INHEADER=1 + PACKAGES= + PROGRAM= + cat "$builddir/$testfile" | while true; do + if IFS="" read -r line; then + if [ $PART -eq 0 ]; then + if [ -n "$line" ]; then + testheader $line + else + PART=1 + fi + else + if [ $INHEADER -eq 1 ]; then + if [ -n "$line" ]; then + sourceheader $line + else + INHEADER=0 + fi + else + if echo "$line" | grep -q "^[A-Za-z]\+:"; then + sourceend + PART=$(($PART + 1)) + INHEADER=1 + PROGRAM= + sourceheader $line + else + echo "$line" >> $SOURCEFILE + fi + fi + fi + else + sourceend + break + fi + done + + cat prepare build check cleanup > script + if ! bash script >log 2>&1; then + cat log CODE=1 fi + + cd $builddir + + if [ $CODE -eq 0 ]; then + rm -rf $testdir + fi done exit $CODE + |