Browse Source

Added TestCase>>isAbstract

Nicolas Petton 12 years ago
parent
commit
44bc2d4bbb
6 changed files with 316 additions and 285 deletions
  1. 112 112
      js/IDE.deploy.js
  2. 112 112
      js/IDE.js
  3. 41 30
      js/SUnit.deploy.js
  4. 46 30
      js/SUnit.js
  5. 1 1
      st/IDE.st
  6. 4 0
      st/SUnit.st

File diff suppressed because it is too large
+ 112 - 112
js/IDE.deploy.js


File diff suppressed because it is too large
+ 112 - 112
js/IDE.js


+ 41 - 30
js/SUnit.deploy.js

@@ -4,7 +4,7 @@ smalltalk.addMethod(
 "_assert_",
 smalltalk.method({
 selector: "assert:",
-fn: function (aBoolean){
+fn: function (aBoolean) {
 var self=this;
 smalltalk.send(self, "_assert_description_", [aBoolean, "Assertion failed"]);
 return self;}
@@ -15,7 +15,7 @@ smalltalk.addMethod(
 "_assert_description_",
 smalltalk.method({
 selector: "assert:description:",
-fn: function (aBoolean, aString){
+fn: function (aBoolean, aString) {
 var self=this;
 ((($receiver = aBoolean).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_signalFailure_", [aString]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_signalFailure_", [aString]);})]));
 return self;}
@@ -26,7 +26,7 @@ smalltalk.addMethod(
 "_assert_equals_",
 smalltalk.method({
 selector: "assert:equals:",
-fn: function (expected, actual){
+fn: function (expected, actual) {
 var self=this;
 return smalltalk.send(self, "_assert_description_", [smalltalk.send(expected, "__eq", [actual]), smalltalk.send(smalltalk.send(smalltalk.send("Expected: ", "__comma", [smalltalk.send(expected, "_asString", [])]), "__comma", [" but was: "]), "__comma", [smalltalk.send(actual, "_asString", [])])]);
 return self;}
@@ -37,7 +37,7 @@ smalltalk.addMethod(
 "_deny_",
 smalltalk.method({
 selector: "deny:",
-fn: function (aBoolean){
+fn: function (aBoolean) {
 var self=this;
 smalltalk.send(self, "_assert_", [smalltalk.send(aBoolean, "_not", [])]);
 return self;}
@@ -48,7 +48,7 @@ smalltalk.addMethod(
 "_performTestFor_",
 smalltalk.method({
 selector: "performTestFor:",
-fn: function (aResult){
+fn: function (aResult) {
 var self=this;
 smalltalk.send((function(){return smalltalk.send((function(){return smalltalk.send(self, "_perform_", [smalltalk.send(self, "_selector", [])]);}), "_on_do_", [(smalltalk.TestFailure || TestFailure), (function(ex){return smalltalk.send(aResult, "_addFailure_", [self]);})]);}), "_on_do_", [(smalltalk.Error || Error), (function(ex){return smalltalk.send(aResult, "_addError_", [self]);})]);
 return self;}
@@ -59,7 +59,7 @@ smalltalk.addMethod(
 "_runCaseFor_",
 smalltalk.method({
 selector: "runCaseFor:",
-fn: function (aTestResult){
+fn: function (aTestResult) {
 var self=this;
 smalltalk.send(self, "_setUp", []);
 smalltalk.send(aTestResult, "_increaseRuns", []);
@@ -73,7 +73,7 @@ smalltalk.addMethod(
 "_selector",
 smalltalk.method({
 selector: "selector",
-fn: function (){
+fn: function () {
 var self=this;
 return self['@testSelector'];
 return self;}
@@ -84,7 +84,7 @@ smalltalk.addMethod(
 "_setTestSelector_",
 smalltalk.method({
 selector: "setTestSelector:",
-fn: function (aSelector){
+fn: function (aSelector) {
 var self=this;
 (self['@testSelector']=aSelector);
 return self;}
@@ -95,7 +95,7 @@ smalltalk.addMethod(
 "_setUp",
 smalltalk.method({
 selector: "setUp",
-fn: function (){
+fn: function () {
 var self=this;
 
 return self;}
@@ -106,7 +106,7 @@ smalltalk.addMethod(
 "_should_",
 smalltalk.method({
 selector: "should:",
-fn: function (aBlock){
+fn: function (aBlock) {
 var self=this;
 smalltalk.send(self, "_assert_", [smalltalk.send(aBlock, "_value", [])]);
 return self;}
@@ -117,7 +117,7 @@ smalltalk.addMethod(
 "_should_raise_",
 smalltalk.method({
 selector: "should:raise:",
-fn: function (aBlock, anExceptionClass){
+fn: function (aBlock, anExceptionClass) {
 var self=this;
 smalltalk.send(self, "_assert_", [smalltalk.send((function(){smalltalk.send(aBlock, "_value", []);return false;}), "_on_do_", [anExceptionClass, (function(ex){return true;})])]);
 return self;}
@@ -128,7 +128,7 @@ smalltalk.addMethod(
 "_signalFailure_",
 smalltalk.method({
 selector: "signalFailure:",
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send((smalltalk.TestFailure || TestFailure), "_new", []));
 return self;}
@@ -139,7 +139,7 @@ smalltalk.addMethod(
 "_tearDown",
 smalltalk.method({
 selector: "tearDown",
-fn: function (){
+fn: function () {
 var self=this;
 
 return self;}
@@ -151,7 +151,7 @@ smalltalk.addMethod(
 "_allTestSelectors",
 smalltalk.method({
 selector: "allTestSelectors",
-fn: function (){
+fn: function () {
 var self=this;
 var selectors=nil;
 (selectors=smalltalk.send(self, "_testSelectors", []));
@@ -165,18 +165,29 @@ smalltalk.addMethod(
 "_buildSuite",
 smalltalk.method({
 selector: "buildSuite",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(smalltalk.send(self, "_allTestSelectors", []), "_collect_", [(function(each){return smalltalk.send(self, "_selector_", [each]);})]);
 return self;}
 }),
 smalltalk.TestCase.klass);
 
+smalltalk.addMethod(
+"_isAbstract",
+smalltalk.method({
+selector: "isAbstract",
+fn: function () {
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_name", []), "__eq", ["TestCase"]);
+return self;}
+}),
+smalltalk.TestCase.klass);
+
 smalltalk.addMethod(
 "_lookupHierarchyRoot",
 smalltalk.method({
 selector: "lookupHierarchyRoot",
-fn: function (){
+fn: function () {
 var self=this;
 return (smalltalk.TestCase || TestCase);
 return self;}
@@ -187,7 +198,7 @@ smalltalk.addMethod(
 "_selector_",
 smalltalk.method({
 selector: "selector:",
-fn: function (aSelector){
+fn: function (aSelector) {
 var self=this;
 return (function($rec){smalltalk.send($rec, "_setTestSelector_", [aSelector]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
 return self;}
@@ -198,7 +209,7 @@ smalltalk.addMethod(
 "_shouldInheritSelectors",
 smalltalk.method({
 selector: "shouldInheritSelectors",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(self, "_~_eq", [smalltalk.send(self, "_lookupHierarchyRoot", [])]);
 return self;}
@@ -209,7 +220,7 @@ smalltalk.addMethod(
 "_testSelectors",
 smalltalk.method({
 selector: "testSelectors",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_keys", []), "_select_", [(function(each){return smalltalk.send(each, "_match_", ["^test"]);})]);
 return self;}
@@ -225,7 +236,7 @@ smalltalk.addMethod(
 "_addError_",
 smalltalk.method({
 selector: "addError:",
-fn: function (anError){
+fn: function (anError) {
 var self=this;
 smalltalk.send(smalltalk.send(self, "_errors", []), "_add_", [anError]);
 return self;}
@@ -236,7 +247,7 @@ smalltalk.addMethod(
 "_addFailure_",
 smalltalk.method({
 selector: "addFailure:",
-fn: function (aFailure){
+fn: function (aFailure) {
 var self=this;
 smalltalk.send(smalltalk.send(self, "_failures", []), "_add_", [aFailure]);
 return self;}
@@ -247,7 +258,7 @@ smalltalk.addMethod(
 "_errors",
 smalltalk.method({
 selector: "errors",
-fn: function (){
+fn: function () {
 var self=this;
 return self['@errors'];
 return self;}
@@ -258,7 +269,7 @@ smalltalk.addMethod(
 "_failures",
 smalltalk.method({
 selector: "failures",
-fn: function (){
+fn: function () {
 var self=this;
 return self['@failures'];
 return self;}
@@ -269,7 +280,7 @@ smalltalk.addMethod(
 "_increaseRuns",
 smalltalk.method({
 selector: "increaseRuns",
-fn: function (){
+fn: function () {
 var self=this;
 (self['@runs']=((($receiver = self['@runs']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));
 return self;}
@@ -280,7 +291,7 @@ smalltalk.addMethod(
 "_initialize",
 smalltalk.method({
 selector: "initialize",
-fn: function (){
+fn: function () {
 var self=this;
 smalltalk.send(self, "_initialize", [], smalltalk.TestResult.superclass || nil);
 (self['@timestamp']=smalltalk.send((smalltalk.Date || Date), "_now", []));
@@ -296,7 +307,7 @@ smalltalk.addMethod(
 "_runs",
 smalltalk.method({
 selector: "runs",
-fn: function (){
+fn: function () {
 var self=this;
 return self['@runs'];
 return self;}
@@ -307,7 +318,7 @@ smalltalk.addMethod(
 "_status",
 smalltalk.method({
 selector: "status",
-fn: function (){
+fn: function () {
 var self=this;
 return ((($receiver = smalltalk.send(smalltalk.send(self, "_errors", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "success";})() : (function(){return "failure";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]));})() : (function(){return "error";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "success";})() : (function(){return "failure";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]));}), (function(){return "error";})]));
 return self;}
@@ -318,7 +329,7 @@ smalltalk.addMethod(
 "_timestamp",
 smalltalk.method({
 selector: "timestamp",
-fn: function (){
+fn: function () {
 var self=this;
 return self['@timestamp'];
 return self;}
@@ -329,7 +340,7 @@ smalltalk.addMethod(
 "_total",
 smalltalk.method({
 selector: "total",
-fn: function (){
+fn: function () {
 var self=this;
 return self['@total'];
 return self;}
@@ -340,7 +351,7 @@ smalltalk.addMethod(
 "_total_",
 smalltalk.method({
 selector: "total:",
-fn: function (aNumber){
+fn: function (aNumber) {
 var self=this;
 (self['@total']=aNumber);
 return self;}

+ 46 - 30
js/SUnit.js

@@ -5,7 +5,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "assert:",
 category: 'testing',
-fn: function (aBoolean){
+fn: function (aBoolean) {
 var self=this;
 smalltalk.send(self, "_assert_description_", [aBoolean, "Assertion failed"]);
 return self;},
@@ -21,7 +21,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "assert:description:",
 category: 'testing',
-fn: function (aBoolean, aString){
+fn: function (aBoolean, aString) {
 var self=this;
 ((($receiver = aBoolean).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_signalFailure_", [aString]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_signalFailure_", [aString]);})]));
 return self;},
@@ -37,7 +37,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "assert:equals:",
 category: 'testing',
-fn: function (expected, actual){
+fn: function (expected, actual) {
 var self=this;
 return smalltalk.send(self, "_assert_description_", [smalltalk.send(expected, "__eq", [actual]), smalltalk.send(smalltalk.send(smalltalk.send("Expected: ", "__comma", [smalltalk.send(expected, "_asString", [])]), "__comma", [" but was: "]), "__comma", [smalltalk.send(actual, "_asString", [])])]);
 return self;},
@@ -53,7 +53,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "deny:",
 category: 'testing',
-fn: function (aBoolean){
+fn: function (aBoolean) {
 var self=this;
 smalltalk.send(self, "_assert_", [smalltalk.send(aBoolean, "_not", [])]);
 return self;},
@@ -69,7 +69,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "performTestFor:",
 category: 'running',
-fn: function (aResult){
+fn: function (aResult) {
 var self=this;
 smalltalk.send((function(){return smalltalk.send((function(){return smalltalk.send(self, "_perform_", [smalltalk.send(self, "_selector", [])]);}), "_on_do_", [(smalltalk.TestFailure || TestFailure), (function(ex){return smalltalk.send(aResult, "_addFailure_", [self]);})]);}), "_on_do_", [(smalltalk.Error || Error), (function(ex){return smalltalk.send(aResult, "_addError_", [self]);})]);
 return self;},
@@ -85,7 +85,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "runCaseFor:",
 category: 'running',
-fn: function (aTestResult){
+fn: function (aTestResult) {
 var self=this;
 smalltalk.send(self, "_setUp", []);
 smalltalk.send(aTestResult, "_increaseRuns", []);
@@ -104,7 +104,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "selector",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self['@testSelector'];
 return self;},
@@ -120,7 +120,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "setTestSelector:",
 category: 'accessing',
-fn: function (aSelector){
+fn: function (aSelector) {
 var self=this;
 (self['@testSelector']=aSelector);
 return self;},
@@ -136,7 +136,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "setUp",
 category: 'running',
-fn: function (){
+fn: function () {
 var self=this;
 
 return self;},
@@ -152,7 +152,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "should:",
 category: 'testing',
-fn: function (aBlock){
+fn: function (aBlock) {
 var self=this;
 smalltalk.send(self, "_assert_", [smalltalk.send(aBlock, "_value", [])]);
 return self;},
@@ -168,7 +168,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "should:raise:",
 category: 'testing',
-fn: function (aBlock, anExceptionClass){
+fn: function (aBlock, anExceptionClass) {
 var self=this;
 smalltalk.send(self, "_assert_", [smalltalk.send((function(){smalltalk.send(aBlock, "_value", []);return false;}), "_on_do_", [anExceptionClass, (function(ex){return true;})])]);
 return self;},
@@ -184,7 +184,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "signalFailure:",
 category: 'private',
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send((smalltalk.TestFailure || TestFailure), "_new", []));
 return self;},
@@ -200,7 +200,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "tearDown",
 category: 'running',
-fn: function (){
+fn: function () {
 var self=this;
 
 return self;},
@@ -217,7 +217,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "allTestSelectors",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 var selectors=nil;
 (selectors=smalltalk.send(self, "_testSelectors", []));
@@ -236,7 +236,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "buildSuite",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(smalltalk.send(self, "_allTestSelectors", []), "_collect_", [(function(each){return smalltalk.send(self, "_selector_", [each]);})]);
 return self;},
@@ -247,12 +247,28 @@ referencedClasses: []
 }),
 smalltalk.TestCase.klass);
 
+smalltalk.addMethod(
+"_isAbstract",
+smalltalk.method({
+selector: "isAbstract",
+category: 'testing',
+fn: function () {
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_name", []), "__eq", ["TestCase"]);
+return self;},
+args: [],
+source: "isAbstract\x0a\x09^ self name = 'TestCase'",
+messageSends: ["=", "name"],
+referencedClasses: []
+}),
+smalltalk.TestCase.klass);
+
 smalltalk.addMethod(
 "_lookupHierarchyRoot",
 smalltalk.method({
 selector: "lookupHierarchyRoot",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return (smalltalk.TestCase || TestCase);
 return self;},
@@ -268,7 +284,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "selector:",
 category: 'accessing',
-fn: function (aSelector){
+fn: function (aSelector) {
 var self=this;
 return (function($rec){smalltalk.send($rec, "_setTestSelector_", [aSelector]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
 return self;},
@@ -284,7 +300,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "shouldInheritSelectors",
 category: 'testing',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(self, "_~_eq", [smalltalk.send(self, "_lookupHierarchyRoot", [])]);
 return self;},
@@ -300,7 +316,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "testSelectors",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_keys", []), "_select_", [(function(each){return smalltalk.send(each, "_match_", ["^test"]);})]);
 return self;},
@@ -321,7 +337,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "addError:",
 category: 'accessing',
-fn: function (anError){
+fn: function (anError) {
 var self=this;
 smalltalk.send(smalltalk.send(self, "_errors", []), "_add_", [anError]);
 return self;},
@@ -337,7 +353,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "addFailure:",
 category: 'accessing',
-fn: function (aFailure){
+fn: function (aFailure) {
 var self=this;
 smalltalk.send(smalltalk.send(self, "_failures", []), "_add_", [aFailure]);
 return self;},
@@ -353,7 +369,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "errors",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self['@errors'];
 return self;},
@@ -369,7 +385,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "failures",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self['@failures'];
 return self;},
@@ -385,7 +401,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "increaseRuns",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 (self['@runs']=((($receiver = self['@runs']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));
 return self;},
@@ -401,7 +417,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "initialize",
 category: 'initialization',
-fn: function (){
+fn: function () {
 var self=this;
 smalltalk.send(self, "_initialize", [], smalltalk.TestResult.superclass || nil);
 (self['@timestamp']=smalltalk.send((smalltalk.Date || Date), "_now", []));
@@ -422,7 +438,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "runs",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self['@runs'];
 return self;},
@@ -438,7 +454,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "status",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return ((($receiver = smalltalk.send(smalltalk.send(self, "_errors", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "success";})() : (function(){return "failure";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]));})() : (function(){return "error";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "success";})() : (function(){return "failure";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]));}), (function(){return "error";})]));
 return self;},
@@ -454,7 +470,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "timestamp",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self['@timestamp'];
 return self;},
@@ -470,7 +486,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "total",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self['@total'];
 return self;},
@@ -486,7 +502,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "total:",
 category: 'accessing',
-fn: function (aNumber){
+fn: function (aNumber) {
 var self=this;
 (self['@total']=aNumber);
 return self;},

+ 1 - 1
st/IDE.st

@@ -1985,7 +1985,7 @@ TabWidget subclass: #TestRunner
 !TestRunner methodsFor: 'accessing'!
 
 allClasses
-	^TestCase allSubclasses
+	^TestCase allSubclasses select: [ :each | each isAbstract not ]
 !
 
 classes

+ 4 - 0
st/SUnit.st

@@ -100,6 +100,10 @@ testSelectors
 
 !TestCase class methodsFor: 'testing'!
 
+isAbstract
+	^ self name = 'TestCase'
+!
+
 shouldInheritSelectors
 	^self ~= self lookupHierarchyRoot
 ! !

Some files were not shown because too many files changed in this diff