diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index 26f7d04..9d7d1c2 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -9,7 +9,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} strategy: matrix: - smalltalk: [ Pharo64-6.1, Pharo64-7.0, Pharo64-8.0, Pharo64-9.0, Pharo64-10, Pharo64-11, Pharo64-12, Pharo64-13, Pharo64-alpha ] + smalltalk: [ Pharo64-7.0, Pharo64-8.0, Pharo64-9.0, Pharo64-10, Pharo64-11, Pharo64-12, Pharo64-13, Pharo64-alpha ] name: ${{ matrix.smalltalk }} steps: - uses: actions/checkout@v4 diff --git a/README.md b/README.md index ea17d93..81e5216 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ Thus, it should be safe to depend on a fixed major version and moving minor vers | Version | Compatible Pharo versions | |------------- |------------------------------| | 1.x.x | Pharo 61, 70, 80, 90, 10, 11, 12, 13, 14 | +| 2.x.x | Pharo 70, 80, 90, 10, 11, 12, 13, 14 | ## Contact diff --git a/src/TinyLogger-Tests/TinyAbstractLoggerTest.class.st b/src/TinyLogger-Tests/TinyAbstractLoggerTest.class.st index 5b9e490..a526589 100644 --- a/src/TinyLogger-Tests/TinyAbstractLoggerTest.class.st +++ b/src/TinyLogger-Tests/TinyAbstractLoggerTest.class.st @@ -27,12 +27,6 @@ TinyAbstractLoggerTest >> actualClass [ ^ self subclassResponsibility ] -{ #category : 'helpers' } -TinyAbstractLoggerTest >> skipInPharo6 [ - self flag: #pharo6. "There is a bug with stdout in Pharo 6 and a hack to manage it. But it breaks the tests so we skip the tests using Stdio streams. Remove that when compatibility with P6 will be dropped." - SystemVersion current major < 7 ifTrue: [ self skip ] -] - { #category : 'tests' } TinyAbstractLoggerTest >> testClearLog [ self subclassResponsibility diff --git a/src/TinyLogger-Tests/TinyLoggerTest.class.st b/src/TinyLogger-Tests/TinyLoggerTest.class.st index 95839d3..ce12ea9 100644 --- a/src/TinyLogger-Tests/TinyLoggerTest.class.st +++ b/src/TinyLogger-Tests/TinyLoggerTest.class.st @@ -52,6 +52,7 @@ TinyLoggerTest >> testAddFileLoggerNamed [ TinyLoggerTest >> testAddLogger [ logger removeAllLoggers. + self flag: #Pharo7. "When P7 compatibility will be dropped, use #assertEmpty: here and in other tests." self assert: logger loggers isEmpty. logger @@ -159,7 +160,6 @@ TinyLoggerTest >> testEnsureTranscriptLogger [ { #category : 'tests' } TinyLoggerTest >> testExecuteRecordedAs [ | contents stream bool | - self skipInPharo6. bool := false. logger removeAllLoggers; @@ -178,7 +178,6 @@ TinyLoggerTest >> testExecuteRecordedAs [ { #category : 'tests' } TinyLoggerTest >> testExecuteRecordedAs2 [ | contents stream | - self skipInPharo6. logger timestampFormatBlock: [ :s | s nextPutAll: 'No time' ]; removeAllLoggers; @@ -203,7 +202,6 @@ No time : End: This is a new test { #category : 'tests' } TinyLoggerTest >> testExecuteRecordedAsBlock [ | log | - self skipInPharo6. log := 'testFileForTinyLogger.log' asFileReference. [ logger execute: [ ] recordedAs: [ 'this is a test' ]. @@ -216,7 +214,6 @@ TinyLoggerTest >> testExecuteRecordedAsBlock [ { #category : 'tests' } TinyLoggerTest >> testExecuteRecordedAsBlock2 [ | log | - self skipInPharo6. log := 'testFileForTinyLogger.log' asFileReference. [ logger addFileLoggerNamed: log basename. @@ -233,7 +230,6 @@ TinyLoggerTest >> testExecuteRecordedAsBlock2 [ TinyLoggerTest >> testExecuteRecordedAsKeepRightIndentation [ | contents stream errorDetected | - self skipInPharo6. errorDetected := false. logger timestampFormatBlock: [ :s | s nextPutAll: 'No time' ]; @@ -262,7 +258,6 @@ No time : End: This is a new test { #category : 'tests' } TinyLoggerTest >> testExecuteRecordedAsReturnBlockContent [ | contents stream bool | - self skipInPharo6. bool := false. logger removeAllLoggers; @@ -302,7 +297,6 @@ TinyLoggerTest >> testHasLoggers [ TinyLoggerTest >> testIndentationString [ | contents stream bool | - self skipInPharo6. bool := false. logger removeAllLoggers; @@ -333,7 +327,6 @@ TinyLoggerTest >> testLoggers [ { #category : 'tests' } TinyLoggerTest >> testNestedExecuteRecordedAs [ | contents stream bool1 bool2 | - self skipInPharo6. bool1 := false. bool2 := false. logger @@ -359,7 +352,6 @@ TinyLoggerTest >> testNestedExecuteRecordedAs [ { #category : 'tests' } TinyLoggerTest >> testRecord [ | contents stream | - self skipInPharo6. logger removeAllLoggers; addStdoutLogger; @@ -378,7 +370,6 @@ TinyLoggerTest >> testRecord [ { #category : 'tests' } TinyLoggerTest >> testRecord2 [ | contents stream | - self skipInPharo6. logger removeAllLoggers; addStdoutLogger; @@ -554,13 +545,10 @@ TinyLoggerTest >> testTranscriptLoggers [ TinyLoggerTest >> testValueDuringRestoresOriginalLogger [ "Do not use assert/deny:identicalTo: for compatibility with Pharo 6" - self assert: TinyCurrentLogger value == logger. + self assert: TinyCurrentLogger value identicalTo: logger. - TinyCurrentLogger - value: TinyLogger new - during: [ self deny: TinyCurrentLogger value == logger ]. - - self assert: TinyCurrentLogger value == logger + TinyCurrentLogger value: TinyLogger new during: [ self deny: TinyCurrentLogger value identicalTo: logger ]. + self assert: TinyCurrentLogger value identicalTo: logger ] { #category : 'tests' } diff --git a/src/TinyLogger-Tests/TinyStdoutLoggerTest.class.st b/src/TinyLogger-Tests/TinyStdoutLoggerTest.class.st index 0e02865..bc1cf5a 100644 --- a/src/TinyLogger-Tests/TinyStdoutLoggerTest.class.st +++ b/src/TinyLogger-Tests/TinyStdoutLoggerTest.class.st @@ -23,7 +23,6 @@ TinyStdoutLoggerTest >> testClearLog [ TinyStdoutLoggerTest >> testIndentationString [ | stream | - self skipInPharo6. stream := '' writeStream. [ Stdio stub stdout willReturn: stream. @@ -37,7 +36,6 @@ TinyStdoutLoggerTest >> testIndentationString [ { #category : 'tests' } TinyStdoutLoggerTest >> testRecord [ | stream | - self skipInPharo6. stream := '' writeStream. [ Stdio stub stdout willReturn: stream. logger record: 'This is a test'. diff --git a/src/TinyLogger/TinyStdoutLogger.class.st b/src/TinyLogger/TinyStdoutLogger.class.st index 56c2680..001da50 100644 --- a/src/TinyLogger/TinyStdoutLogger.class.st +++ b/src/TinyLogger/TinyStdoutLogger.class.st @@ -14,9 +14,6 @@ Examples Class { #name : 'TinyStdoutLogger', #superclass : 'TinyLeafLogger', - #instVars : [ - 'streamClassProvider' - ], #category : 'TinyLogger-Core', #package : 'TinyLogger', #tag : 'Core' @@ -35,13 +32,6 @@ TinyStdoutLogger >> clearLog [ ] -{ #category : 'initialization' } -TinyStdoutLogger >> initialize [ - super initialize. - self flag: #pharo6. "This is needed because in Pharo 6.1 Stdio does not works well. When Pharo 7 will be the minimum supported, remove this hack." - streamClassProvider := SystemVersion current major < 7 ifTrue: [ FileStream ] ifFalse: [ Stdio ] -] - { #category : 'opening' } TinyStdoutLogger >> open [ @@ -51,7 +41,7 @@ TinyStdoutLogger >> open [ { #category : 'logging' } TinyStdoutLogger >> record: aString [ | stream | - stream := streamClassProvider stdout. + stream := Stdio stdout. self record: aString on: stream. "The flush is needed to send the record in the stdout."