[Gd-chatter] r11724 - trunk/libraries/programming-tools/testworks-specs
housel at gwydiondylan.org
housel at gwydiondylan.org
Sat Mar 1 19:07:01 CET 2008
Author: housel
Date: Sat Mar 1 19:07:00 2008
New Revision: 11724
Modified:
trunk/libraries/programming-tools/testworks-specs/class-specs.dylan
trunk/libraries/programming-tools/testworks-specs/function-specs.dylan
trunk/libraries/programming-tools/testworks-specs/macro-specs.dylan
trunk/libraries/programming-tools/testworks-specs/protocol-specs.dylan
trunk/libraries/programming-tools/testworks-specs/variable-specs.dylan
Log:
Bug: 7373
Adopt testworks-specs so that it properly marks definition tests
when they are unimplmented.
* testworks-specs/protocol-specs.dylan
(protocol-spec-suite-definer): Mark the generated
*-protocol-classes-test, *-protocol-functions-test,
*-protocol-variables-test, *-protocol-constants-test, and
*-protocol-macros-test tests as allow-empty: #t, since the
specification might not contain definitions of all types.
* testworks-specs/macro-specs.dylan (check-protocol-macro):
Clarify test-unit title.
* testworks-specs/class-specs.dylan (check-protocol-class): Split
the test unit into automatic and user-supplied portions and
clarify the test-unit title.
* testworks-specs/function-specs.dylan (check-protocol-function):
Split the test unit into automatic and user-supplied portions
and clarify the test-unit title.
* testworks-specs/variable-specs.dylan
(check-protocol-function, check-protocol-constant): Split the
test unit into automatic and user-supplied portions and clarify
the test-unit title.
Modified: trunk/libraries/programming-tools/testworks-specs/class-specs.dylan
==============================================================================
--- trunk/libraries/programming-tools/testworks-specs/class-specs.dylan (original)
+++ trunk/libraries/programming-tools/testworks-specs/class-specs.dylan Sat Mar 1 19:07:00 2008
@@ -130,11 +130,13 @@
(protocol-spec :: <protocol-spec>, class-spec :: <class-spec>) => ()
let title = spec-title(class-spec);
let class = class-spec-class(class-spec);
- with-test-unit (format-to-string("%s tests", title))
+ with-test-unit (format-to-string("class %s specification", title))
check-instance?(format-to-string("Variable %s is a class", title),
<class>, class);
check-true(format-to-string("Variable %s has the correct superclasses", title),
protocol-class-has-correct-superclasses?(protocol-spec, class));
+ end;
+ with-test-unit (format-to-string("class-test %s", title))
check-protocol-class-instantiation(protocol-spec, class-spec);
test-protocol-definition
(protocol-spec, spec-name(protocol-spec), spec-name(class-spec))
Modified: trunk/libraries/programming-tools/testworks-specs/function-specs.dylan
==============================================================================
--- trunk/libraries/programming-tools/testworks-specs/function-specs.dylan (original)
+++ trunk/libraries/programming-tools/testworks-specs/function-specs.dylan Sat Mar 1 19:07:00 2008
@@ -108,10 +108,12 @@
=> ()
let title = spec-title(function-spec);
let function = function-spec-function(function-spec);
- with-test-unit (format-to-string("%s tests", title))
+ with-test-unit (format-to-string("%s specification", title))
let (type, type-name) = protocol-function-type(protocol-spec, function);
check-instance?(protocol-function-check-name(title, type-name),
type, function);
+ end;
+ with-test-unit (format-to-string("function-test %s", title))
test-protocol-definition
(protocol-spec, spec-name(protocol-spec), spec-name(function-spec))
end
Modified: trunk/libraries/programming-tools/testworks-specs/macro-specs.dylan
==============================================================================
--- trunk/libraries/programming-tools/testworks-specs/macro-specs.dylan (original)
+++ trunk/libraries/programming-tools/testworks-specs/macro-specs.dylan Sat Mar 1 19:07:00 2008
@@ -37,7 +37,7 @@
define method check-protocol-macro
(protocol-spec :: <protocol-spec>, macro-spec :: <macro-spec>) => ()
let title = spec-title(macro-spec);
- with-test-unit (format-to-string("%s tests", title))
+ with-test-unit (format-to-string("macro-test %s", title))
test-protocol-definition
(protocol-spec, spec-name(protocol-spec), spec-name(macro-spec))
end
Modified: trunk/libraries/programming-tools/testworks-specs/protocol-specs.dylan
==============================================================================
--- trunk/libraries/programming-tools/testworks-specs/protocol-specs.dylan (original)
+++ trunk/libraries/programming-tools/testworks-specs/protocol-specs.dylan Sat Mar 1 19:07:00 2008
@@ -262,19 +262,19 @@
define macro protocol-spec-suite-definer
{ define protocol-spec-suite ?protocol-name:name => ?spec:name end }
- => { define test ?protocol-name ## "-protocol-classes-test" ()
+ => { define test ?protocol-name ## "-protocol-classes-test" (allow-empty: #t)
check-protocol-classes(?spec)
end;
- define test ?protocol-name ## "-protocol-functions-test" ()
+ define test ?protocol-name ## "-protocol-functions-test" (allow-empty: #t)
check-protocol-functions(?spec)
end;
- define test ?protocol-name ## "-protocol-variables-test" ()
+ define test ?protocol-name ## "-protocol-variables-test" (allow-empty: #t)
check-protocol-variables(?spec)
end;
- define test ?protocol-name ## "-protocol-constants-test" ()
+ define test ?protocol-name ## "-protocol-constants-test" (allow-empty: #t)
check-protocol-constants(?spec)
end;
- define test ?protocol-name ## "-protocol-macros-test" ()
+ define test ?protocol-name ## "-protocol-macros-test" (allow-empty: #t)
check-protocol-macros(?spec)
end;
define suite ?protocol-name ## "-protocol-test-suite" ()
Modified: trunk/libraries/programming-tools/testworks-specs/variable-specs.dylan
==============================================================================
--- trunk/libraries/programming-tools/testworks-specs/variable-specs.dylan (original)
+++ trunk/libraries/programming-tools/testworks-specs/variable-specs.dylan Sat Mar 1 19:07:00 2008
@@ -73,7 +73,7 @@
define function check-protocol-variable
(protocol-spec :: <protocol-spec>, variable-spec :: <variable-spec>) => ()
let title = spec-title(variable-spec);
- with-test-unit (format-to-string("%s tests", title))
+ with-test-unit (format-to-string("%s specification", title))
check-instance?(format-to-string("Variable %s has the correct type", title),
variable-spec-type(variable-spec),
variable-spec-getter(variable-spec)());
@@ -81,7 +81,9 @@
begin
let value = variable-spec-getter(variable-spec)();
variable-spec-setter(variable-spec)(value) = value
- end);
+ end);
+ end;
+ with-test-unit (format-to-string("variable-test %s", title))
test-protocol-definition
(protocol-spec, spec-name(protocol-spec), spec-name(variable-spec))
end
@@ -97,10 +99,12 @@
define function check-protocol-constant
(protocol-spec :: <protocol-spec>, constant :: <constant-spec>) => ()
let title = spec-title(constant);
- with-test-unit (format-to-string("%s tests", title))
+ with-test-unit (format-to-string("%s specification", title))
check-instance?(format-to-string("Constant %s has the correct type", title),
variable-spec-type(constant),
variable-spec-getter(constant)());
+ end;
+ with-test-unit (format-to-string("constant-test %s", title))
test-protocol-definition
(protocol-spec, spec-name(protocol-spec), spec-name(constant))
end
More information about the chatter
mailing list