]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Prepare support for more complex test cases
authorJürg Billeter <j@bitron.ch>
Sat, 22 Nov 2008 21:09:35 +0000 (21:09 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sat, 22 Nov 2008 21:09:35 +0000 (21:09 +0000)
2008-11-22  Jürg Billeter  <j@bitron.ch>

* tests/:

Prepare support for more complex test cases

svn path=/trunk/; revision=2060

59 files changed:
ChangeLog
tests/Makefile.am
tests/arrays.exp [deleted file]
tests/arrays.test [moved from tests/arrays.vala with 99% similarity]
tests/basic-types/floats.exp [deleted file]
tests/basic-types/floats.test [moved from tests/basic-types/floats.vala with 99% similarity]
tests/basic-types/integers.exp [deleted file]
tests/basic-types/integers.test [moved from tests/basic-types/integers.vala with 99% similarity]
tests/basic-types/strings.exp [deleted file]
tests/basic-types/strings.test [moved from tests/basic-types/strings.vala with 98% similarity]
tests/basic-types/test-027.exp [deleted file]
tests/basic-types/test-027.test [moved from tests/basic-types/test-027.vala with 98% similarity]
tests/control-flow/break.exp [deleted file]
tests/control-flow/break.test [moved from tests/control-flow/break.vala with 93% similarity]
tests/control-flow/expressions-conditional.exp [deleted file]
tests/control-flow/expressions-conditional.test [moved from tests/control-flow/expressions-conditional.vala with 95% similarity]
tests/control-flow/for.exp [deleted file]
tests/control-flow/for.test [moved from tests/control-flow/for.vala with 92% similarity]
tests/control-flow/switch.exp [deleted file]
tests/control-flow/switch.test [moved from tests/control-flow/switch.vala with 98% similarity]
tests/delegates.exp [deleted file]
tests/delegates.test [moved from tests/delegates.vala with 99% similarity]
tests/enums.exp [deleted file]
tests/enums.test [moved from tests/enums.vala with 96% similarity]
tests/exceptions.exp [deleted file]
tests/exceptions.test [moved from tests/exceptions.vala with 98% similarity]
tests/hello.exp [deleted file]
tests/hello.vala [deleted file]
tests/methods/lambda.exp [deleted file]
tests/methods/lambda.test [moved from tests/methods/lambda.vala with 96% similarity]
tests/namespaces.exp [deleted file]
tests/namespaces.test [moved from tests/namespaces.vala with 97% similarity]
tests/objects/classes.exp [deleted file]
tests/objects/classes.test [moved from tests/objects/classes.vala with 99% similarity]
tests/objects/fields.exp [deleted file]
tests/objects/fields.test [moved from tests/objects/fields.vala with 99% similarity]
tests/objects/interfaces.exp [deleted file]
tests/objects/interfaces.test [moved from tests/objects/interfaces.vala with 97% similarity]
tests/objects/methods.exp [deleted file]
tests/objects/methods.test [moved from tests/objects/methods.vala with 99% similarity]
tests/objects/properties.exp [deleted file]
tests/objects/properties.test [moved from tests/objects/properties.vala with 99% similarity]
tests/objects/signals.exp [deleted file]
tests/objects/signals.test [moved from tests/objects/signals.vala with 99% similarity]
tests/objects/test-025.exp [deleted file]
tests/objects/test-025.test [moved from tests/objects/test-025.vala with 96% similarity]
tests/objects/test-026.exp [deleted file]
tests/objects/test-026.test [moved from tests/objects/test-026.vala with 96% similarity]
tests/objects/test-029.exp [deleted file]
tests/objects/test-029.test [moved from tests/objects/test-029.vala with 96% similarity]
tests/objects/test-034.exp [deleted file]
tests/objects/test-034.test [moved from tests/objects/test-034.vala with 98% similarity]
tests/pointers.exp [deleted file]
tests/pointers.test [moved from tests/pointers.vala with 97% similarity]
tests/structs.exp [deleted file]
tests/structs.test [moved from tests/structs.vala with 99% similarity]
tests/test-023.exp [deleted file]
tests/test-023.test [moved from tests/test-023.vala with 96% similarity]
tests/testrunner.sh

index 7f4535a0e90a540d0055ecba14bb742bf944887e..472a5f89ebd116b875d172dfa0473ceb618ebc9c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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:
index 07768aa6770f1f366f5548dbb38cb60ff9cceeff..204dce88f94b12cd6ef02412ad1ebfeb3fdaa415 100644 (file)
@@ -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 (file)
index 344248b..0000000
+++ /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
similarity index 99%
rename from tests/arrays.vala
rename to tests/arrays.test
index f4dea49f3b1d876f073f8acbc1015b0fded35295..3e05b5e4a2ff95208e9382b067b82c542737a771 100644 (file)
@@ -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 (file)
index 9fef60e..0000000
+++ /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
similarity index 99%
rename from tests/basic-types/floats.vala
rename to tests/basic-types/floats.test
index 21a3d00045cfdef785241dad7dc290eb42b12a7d..da7e6c07cd22ac1bea84d2a95bcc99d22d405761 100644 (file)
@@ -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 (file)
index 9c8ef76..0000000
+++ /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
similarity index 99%
rename from tests/basic-types/integers.vala
rename to tests/basic-types/integers.test
index e6927d5dc89194daae711bb7912b1b33c8728f88..0ab6fdbf51dd54ed5bc4ebbd13ebf1fb92d99c74 100644 (file)
@@ -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 (file)
index 5b9feab..0000000
+++ /dev/null
@@ -1 +0,0 @@
-String Test: 1 2 3 4 5 6 7 8
similarity index 98%
rename from tests/basic-types/strings.vala
rename to tests/basic-types/strings.test
index 95ba30562225da4fa45370031bb10fd86776465d..0ecd559b33572d8fe69bb3f4b7b2feff666ccdd9 100644 (file)
@@ -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 (file)
index 58bbc8c..0000000
+++ /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
similarity index 98%
rename from tests/basic-types/test-027.vala
rename to tests/basic-types/test-027.test
index 3b7cd322df990dd0e79df4a6901eac5e47cbbd41..cb97a19c7e8e20a82224747d1108d7266e26704a 100644 (file)
@@ -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 (file)
index da2c08e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Break Test: 1 2 3
similarity index 93%
rename from tests/control-flow/break.vala
rename to tests/control-flow/break.test
index 6566f93494026dbbba043a523e7b4c12a67045ac..71f3297b4eab379355e37677d9b2e091a71c4848 100644 (file)
@@ -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 (file)
index 7224845..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Conditional Expression Test: 1 2 3 4 5
similarity index 95%
rename from tests/control-flow/expressions-conditional.vala
rename to tests/control-flow/expressions-conditional.test
index 570b247987511eac811cbaf0a9d8485be0f09821..f9e7c1fc2f7770879eaafe8fb420db750485a6b5 100644 (file)
@@ -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 (file)
index e69de29..0000000
similarity index 92%
rename from tests/control-flow/for.vala
rename to tests/control-flow/for.test
index c435c04171c209944edc4f202ae2e7d57d433226..60f3c97d8a226d9b3be763bbb94128d9a3b319b2 100644 (file)
@@ -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 (file)
index 0cd5103..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-For Test: 1 2 3 4 5 6 7
-Switch statement: 1 2 3 4 5 6 7
similarity index 98%
rename from tests/control-flow/switch.vala
rename to tests/control-flow/switch.test
index 5e6450455013fa263cd223c3a23a6aef9f5d8f51..1ee8bb7356bfae8cc716a20bf60bfb2eac1e3772 100644 (file)
@@ -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 (file)
index 4d6380e..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Delegate Test: 1 2 3 4 5 6 7
-testing function pointers: 1 2 3
similarity index 99%
rename from tests/delegates.vala
rename to tests/delegates.test
index 6ff52c83d149e16ce41c1a8a99dee1024f84230b..504ff0824a61ff164f11f3ea253721a6ab731fa5 100644 (file)
@@ -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 (file)
index d39e190..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Enum Test: 1 2 3 4 5 6
similarity index 96%
rename from tests/enums.vala
rename to tests/enums.test
index aa5437a5b76a6ea2b82161de549860c485b9edb4..f687e4c13f779e29ec7f48b21d420ca901c23662 100644 (file)
@@ -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 (file)
index e884946..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Exception Test: 1 2 3 4 5 6 7 8 9 10 11
similarity index 98%
rename from tests/exceptions.vala
rename to tests/exceptions.test
index 95fa07c56516af4a978803ebed960a251fc10665..46956493032f63a3d62970b848a7345557fa9af6 100644 (file)
@@ -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 (file)
index af5626b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Hello, world!
diff --git a/tests/hello.vala b/tests/hello.vala
deleted file mode 100644 (file)
index ddc5603..0000000
+++ /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 (file)
index e644d9b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Lambda Test: 1 2 3 4
similarity index 96%
rename from tests/methods/lambda.vala
rename to tests/methods/lambda.test
index 5811d93d107b9b7657e9e430765f65b15b5c3cd3..e2f4ad1e6a4144ea7baf9c0215eb85c386a2e868 100644 (file)
@@ -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 (file)
index 5fd7a44..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Namespace Test
-Class in Namespace Test
similarity index 97%
rename from tests/namespaces.vala
rename to tests/namespaces.test
index 1469ec894f3fa5674e2fe1e25dda25154a409e88..748ae5d24891aa227986e64343d83db8acef7ff5 100644 (file)
@@ -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 (file)
index 7954105..0000000
+++ /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
-.
similarity index 99%
rename from tests/objects/classes.vala
rename to tests/objects/classes.test
index a89f475e66e627043991a11a8a7dc44e0dd1d5d9..edcbaca4881665a9997f4fffe9ace01acf0e7248 100644 (file)
@@ -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 (file)
index 2be916e..0000000
+++ /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
similarity index 99%
rename from tests/objects/fields.vala
rename to tests/objects/fields.test
index 0d091c75f61691c77b399867ab9821817c733c12..f347fbb1a83853ada60f365974ad842dcb966dc9 100644 (file)
@@ -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 (file)
index 388004f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Interface Test: 1 2 3 4 5 6 7
similarity index 97%
rename from tests/objects/interfaces.vala
rename to tests/objects/interfaces.test
index 7eb652e3fcf52e17c7f78fd98ecd282b0937bcd4..64d42794cd004f611889557f76af9600a19d4364 100644 (file)
@@ -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 (file)
index b32fe50..0000000
+++ /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
similarity index 99%
rename from tests/objects/methods.vala
rename to tests/objects/methods.test
index 33696ca52ac9be053c398eeac8836083d9452b80..0682ed67422ec7923f512de9aa04003fb6d584a6 100644 (file)
@@ -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 (file)
index ee2398d..0000000
+++ /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
similarity index 99%
rename from tests/objects/properties.vala
rename to tests/objects/properties.test
index e3571d089754dc544b665155e0eed9fda436445d..b8e6f332be60a6236f452f7f7337f712da8d5336 100644 (file)
@@ -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 (file)
index ec783ec..0000000
+++ /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
similarity index 99%
rename from tests/objects/signals.vala
rename to tests/objects/signals.test
index 52b4b25388e65ac2eeb6da01cf19729df2b6a095..ced2f3ae0ee8ee775a0525be18ca3c698521e445 100644 (file)
@@ -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 (file)
index 1769204..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Base Access Test: 1 2 3 4 5
similarity index 96%
rename from tests/objects/test-025.vala
rename to tests/objects/test-025.test
index 2d83913e7d82d85aae4c445b42f1e4d522aebee0..5f224ab0c10217c77c27bbedc3e26c5782449f35 100644 (file)
@@ -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 (file)
index b201cf1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Hidden Base Method Access Test: 1 2 3 4 5
similarity index 96%
rename from tests/objects/test-026.vala
rename to tests/objects/test-026.test
index 2c6ab84e4044a8fb58b5e524c3ef5bb847b33993..2a133f94e0c7bf0a4714723ae3f522b37490d06f 100644 (file)
@@ -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 (file)
index 4dcfda1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Construct Formal Parameter Test: 1 2 3 4 5
similarity index 96%
rename from tests/objects/test-029.vala
rename to tests/objects/test-029.test
index 966caf8985b8bbd211270a04defb7f2093fbc9ac..bb13e267386185bc1c285719024bf9cfed22281d 100644 (file)
@@ -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 (file)
index 5b6d300..0000000
+++ /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
similarity index 98%
rename from tests/objects/test-034.vala
rename to tests/objects/test-034.test
index 4f16b34810c8859d2e355b8ccace7146c9ceb7b4..f8394fd43846d78b9f676833dfb5d06f519a2442 100644 (file)
@@ -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 (file)
index e69de29..0000000
similarity index 97%
rename from tests/pointers.vala
rename to tests/pointers.test
index 2225487e3b1125b0f09984ea99b01a75ff90b066..75b43ff262d53fc133b7787432ad71f837d691c4 100644 (file)
@@ -1,3 +1,6 @@
+
+Program: test
+
 using GLib;
 
 struct SimpleStruct {
diff --git a/tests/structs.exp b/tests/structs.exp
deleted file mode 100644 (file)
index 8681243..0000000
+++ /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
-.
similarity index 99%
rename from tests/structs.vala
rename to tests/structs.test
index 2a5c06c476fb56da783ebbaf28056e574ec4470a..4b39feeb45bca5ef1addd7eecc8ab629759fb6be 100644 (file)
@@ -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 (file)
index 2524c56..0000000
+++ /dev/null
@@ -1 +0,0 @@
-List construction: 1 2 3 4
similarity index 96%
rename from tests/test-023.vala
rename to tests/test-023.test
index ac2387eb17b37f503a93892208ce93e35647ec92..b4f073dc165b19dafbe1eeb418a53d6b82089616 100644 (file)
@@ -1,3 +1,6 @@
+
+Program: test
+
 using GLib;
 
 class Maman.Foo : Object {
index 96a92092f4ac29b4ba06f0bc8ccc80df66bf7905..37c0cb89fcc892f79383a28ddd76935d9e4d6d26 100755 (executable)
@@ -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
+