diff --git a/src/Calypso-SystemPlugins-Critic-Browser/ClyShowCritiqueDetailsCommand.class.st b/src/Calypso-SystemPlugins-Critic-Browser/ClyShowCritiqueDetailsCommand.class.st index e41c39ee3ac..b84a3c818a6 100644 --- a/src/Calypso-SystemPlugins-Critic-Browser/ClyShowCritiqueDetailsCommand.class.st +++ b/src/Calypso-SystemPlugins-Critic-Browser/ClyShowCritiqueDetailsCommand.class.st @@ -37,7 +37,7 @@ ClyShowCritiqueDetailsCommand >> execute [ self specUIManager title: critique title; - label: self critiqueDescription; + message: self critiqueDescription; acceptLabel: 'close'; extent: 500 @ 500; openDialog diff --git a/src/SUnit-Basic-CLI/HDTestReport.class.st b/src/SUnit-Basic-CLI/HDTestReport.class.st index 1b23f05d574..dd9cdb77841 100644 --- a/src/SUnit-Basic-CLI/HDTestReport.class.st +++ b/src/SUnit-Basic-CLI/HDTestReport.class.st @@ -38,23 +38,16 @@ HDTestReport class >> currentStageName: aStageName [ { #category : 'running' } HDTestReport class >> runClasses: aCollectionOfClasses named: packageName [ - | suite classes time result | + | suite classes result | suite := TestSuite named: packageName. ShuffleSeed ifNotNil: [ suite shuffleSeed: ShuffleSeed asInteger ]. - classes := (aCollectionOfClasses select: [ :class | - class isTestCase and: [ class isAbstract not ] ]) - asSortedCollection: [ :a :b | a name <= b name ]. + + classes := (aCollectionOfClasses select: [ :class | class isTestCase and: [ class isAbstract not ] ]) asSortedCollection: [ :a :b | a name <= b name ]. classes ifEmpty: [ ^ nil ]. + classes do: [ :class | suite addTests: class buildSuite tests ]. - time := DateAndTime now. - ('Beginning to run tests of ' , packageName , ' with random seed ' - , suite shuffleSeed asString , OSPlatform current lineEnding) - traceCr. result := self runSuite: suite. - ('Finished to run tests of ' , packageName , ' in ' - , (DateAndTime now - time) humanReadablePrintString - , OSPlatform current lineEnding) traceCr. - ^ result + ^ result ] { #category : 'running' } @@ -66,7 +59,9 @@ HDTestReport class >> runPackage: aString [ { #category : 'running' } HDTestReport class >> runSuite: aTestSuite [ - ^ self new runSuite: aTestSuite + ^ self new + suite: aTestSuite; + run ] { #category : 'running' } @@ -98,12 +93,6 @@ HDTestReport >> calculateNodeName [ ifAbsent: [ '' ] ] -{ #category : 'running' } -HDTestReport >> done [ - "just close the file" - [ progressStream close ] on: Error do: [] -] - { #category : 'private' } HDTestReport >> generateTestName: aTestCase [ @@ -138,11 +127,6 @@ HDTestReport >> initialize [ ] -{ #category : 'initialization' } -HDTestReport >> initializeOn: aTestSuite [ - suite := aTestSuite -] - { #category : 'private' } HDTestReport >> newLogDuring: aBlock [ @@ -252,16 +236,11 @@ HDTestReport >> reportTestCase: aTestCase runBlock: aBlock [ HDTestReport >> run [ [ - self setUp. - suiteTime := [ self runAll ] millisecondsToRun ] ensure: [ - self tearDown ] -] - -{ #category : 'running' } -HDTestReport >> runAll [ - CurrentExecutionEnvironment runTestsBy: [ - suite tests do: [ :each | each run: self ] - ] + | time | + self setUp. + time := DateAndTime now. + CurrentExecutionEnvironment runTestsBy: [ suite tests do: [ :each | each run: self ] ]. + suiteTime := DateAndTime now - time ] ensure: [ self tearDown ] ] { #category : 'running' } @@ -278,14 +257,6 @@ HDTestReport >> runCase: aTestCase [ ] ] -{ #category : 'running' } -HDTestReport >> runSuite: aTestSuite [ - ^ self - initializeOn: aTestSuite; - run; - done -] - { #category : 'running' } HDTestReport >> serializeError: error of: aTestCase [ @@ -318,10 +289,20 @@ HDTestReport >> serializeError: error of: aTestCase [ { #category : 'running' } HDTestReport >> setUp [ - | aFile | + | aFile logString | self openProgressStream. - progressStream nextPutAll: 'running suite: '; - nextPutAll: suite name ; crlf; flush. + logString := String streamContents: [ :aStream | + aStream + nextPutAll: 'Beginning to run tests of '; + nextPutAll: suite name; + nextPutAll: ' with random seed '; + print: suite shuffleSeed; + nextPutAll: OSPlatform current lineEnding ]. + "We print in the progress file but also in the stdout for the CI infos." + logString trace. + progressStream + nextPutAll: logString; + flush. aFile := File named: self suiteFileNameWithoutExtension , '.xml' . aFile delete. @@ -374,6 +355,12 @@ HDTestReport >> stageName: anObject [ stageName := anObject ] +{ #category : 'initialization' } +HDTestReport >> suite: aTestSuite [ + + suite := aTestSuite +] + { #category : 'accessing' } HDTestReport >> suiteErrors [ ^ suiteErrors @@ -408,6 +395,7 @@ HDTestReport >> suiteTotal [ { #category : 'running' } HDTestReport >> tearDown [ + | logString | suite resources do: [ :each | each reset ]. @@ -419,13 +407,19 @@ HDTestReport >> tearDown [ stream nextPutAll: ' failures="'; print: suiteFailures; nextPutAll: '" errors="'; print: suiteErrors; - nextPutAll: '" time="'; print: suiteTime / 1000.0; + nextPutAll: '" time="'; print: suiteTime asMilliSeconds / 1000.0; nextPutAll: '">'. stream close. - progressStream - nextPutAll: 'finished running suite: '; - nextPutAll: suite name; + logString := String streamContents: [ :aStream | + aStream + nextPutAll: 'Finished to run tests of '; + nextPutAll: suite name; + nextPutAll: ' in '. + suiteTime printHumanReadableOn: aStream ]. "We print in the progress file but also in the stdout for the CI infos." + logString traceCr. + progressStream + nextPutAll: logString; close ] diff --git a/src/SUnit-UI/CommandLineTestRunner.class.st b/src/SUnit-UI/CommandLineTestRunner.class.st index c449e7f520a..ce1f217dd30 100644 --- a/src/SUnit-UI/CommandLineTestRunner.class.st +++ b/src/SUnit-UI/CommandLineTestRunner.class.st @@ -25,10 +25,6 @@ CommandLineTestRunner >> createStdout [ ^ Stdio stdout ] -{ #category : 'running' } -CommandLineTestRunner >> done [ -] - { #category : 'helper' } CommandLineTestRunner >> increaseTestCount [ currentTest := currentTest + 1