From 2d98f90eb17ae449c162b877b9fbadcbd54011b7 Mon Sep 17 00:00:00 2001 From: Patrik Date: Fri, 5 Sep 2025 12:29:18 +0200 Subject: [PATCH 1/4] Adding platform identification --- .../GRPlatform.class/instance/isGemStone.st | 4 ++++ .../GRPlatform.class/instance/isPharo.st | 4 ++++ .../GRPlatform.class/instance/isSmalltalkX.st | 4 ++++ .../GRPlatform.class/instance/isSqueak.st | 4 ++++ .../GRPlatform.class/instance/isVAST.st | 4 ++++ .../GRGemStonePlatform.class/instance/isGemStone.st | 4 ++++ .../GRPharoPlatform.class/instance/isPharo.st | 4 ++++ .../GRPharoPlatform.class/instance/isPharo.st | 4 ++++ .../GRPharoPlatform.class/instance/isPharo.st | 4 ++++ .../GRPharoPlatform.class/instance/isPharo.st | 4 ++++ .../instance/testIsGemStone.st | 7 +++++++ .../instance/testIsGemStone.st | 7 +++++++ .../GRPharoPlatformTest.class/instance/testIsPharo.st | 7 +++++++ 13 files changed, 61 insertions(+) create mode 100644 repository/Grease-Core.package/GRPlatform.class/instance/isGemStone.st create mode 100644 repository/Grease-Core.package/GRPlatform.class/instance/isPharo.st create mode 100644 repository/Grease-Core.package/GRPlatform.class/instance/isSmalltalkX.st create mode 100644 repository/Grease-Core.package/GRPlatform.class/instance/isSqueak.st create mode 100644 repository/Grease-Core.package/GRPlatform.class/instance/isVAST.st create mode 100644 repository/Grease-GemStone-Core.package/GRGemStonePlatform.class/instance/isGemStone.st create mode 100644 repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/isPharo.st create mode 100644 repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/isPharo.st create mode 100644 repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/isPharo.st create mode 100644 repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/isPharo.st create mode 100644 repository/Grease-Tests-GemStone-Core.package/GRGemStonePlatformTest.class/instance/testIsGemStone.st create mode 100644 repository/Grease-Tests-GemStone32-Core.package/GRGemStonePlatformTest.class/instance/testIsGemStone.st create mode 100644 repository/Grease-Tests-Pharo-Core.package/GRPharoPlatformTest.class/instance/testIsPharo.st diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/isGemStone.st b/repository/Grease-Core.package/GRPlatform.class/instance/isGemStone.st new file mode 100644 index 00000000..3a57672e --- /dev/null +++ b/repository/Grease-Core.package/GRPlatform.class/instance/isGemStone.st @@ -0,0 +1,4 @@ +testing +isGemStone + + ^ false \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/isPharo.st b/repository/Grease-Core.package/GRPlatform.class/instance/isPharo.st new file mode 100644 index 00000000..b2f9f340 --- /dev/null +++ b/repository/Grease-Core.package/GRPlatform.class/instance/isPharo.st @@ -0,0 +1,4 @@ +testing +isPharo + + ^ false \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/isSmalltalkX.st b/repository/Grease-Core.package/GRPlatform.class/instance/isSmalltalkX.st new file mode 100644 index 00000000..8605e96f --- /dev/null +++ b/repository/Grease-Core.package/GRPlatform.class/instance/isSmalltalkX.st @@ -0,0 +1,4 @@ +testing +isSmalltalkX + + ^ false \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/isSqueak.st b/repository/Grease-Core.package/GRPlatform.class/instance/isSqueak.st new file mode 100644 index 00000000..34e2f234 --- /dev/null +++ b/repository/Grease-Core.package/GRPlatform.class/instance/isSqueak.st @@ -0,0 +1,4 @@ +testing +isSqueak + + ^ false \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/isVAST.st b/repository/Grease-Core.package/GRPlatform.class/instance/isVAST.st new file mode 100644 index 00000000..8e022384 --- /dev/null +++ b/repository/Grease-Core.package/GRPlatform.class/instance/isVAST.st @@ -0,0 +1,4 @@ +testing +isVAST + + ^ false \ No newline at end of file diff --git a/repository/Grease-GemStone-Core.package/GRGemStonePlatform.class/instance/isGemStone.st b/repository/Grease-GemStone-Core.package/GRGemStonePlatform.class/instance/isGemStone.st new file mode 100644 index 00000000..e947f21e --- /dev/null +++ b/repository/Grease-GemStone-Core.package/GRGemStonePlatform.class/instance/isGemStone.st @@ -0,0 +1,4 @@ +testing +isGemStone + + ^ true \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/isPharo.st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/isPharo.st new file mode 100644 index 00000000..17945cf1 --- /dev/null +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/isPharo.st @@ -0,0 +1,4 @@ +testing +isPharo + + ^ true \ No newline at end of file diff --git a/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/isPharo.st b/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/isPharo.st new file mode 100644 index 00000000..17945cf1 --- /dev/null +++ b/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/isPharo.st @@ -0,0 +1,4 @@ +testing +isPharo + + ^ true \ No newline at end of file diff --git a/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/isPharo.st b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/isPharo.st new file mode 100644 index 00000000..17945cf1 --- /dev/null +++ b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/isPharo.st @@ -0,0 +1,4 @@ +testing +isPharo + + ^ true \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/isPharo.st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/isPharo.st new file mode 100644 index 00000000..17945cf1 --- /dev/null +++ b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/isPharo.st @@ -0,0 +1,4 @@ +testing +isPharo + + ^ true \ No newline at end of file diff --git a/repository/Grease-Tests-GemStone-Core.package/GRGemStonePlatformTest.class/instance/testIsGemStone.st b/repository/Grease-Tests-GemStone-Core.package/GRGemStonePlatformTest.class/instance/testIsGemStone.st new file mode 100644 index 00000000..c3aa2463 --- /dev/null +++ b/repository/Grease-Tests-GemStone-Core.package/GRGemStonePlatformTest.class/instance/testIsGemStone.st @@ -0,0 +1,7 @@ +*Grease-Tests-Pharo-Core +testIsGemStone + self assert: GRPlatform current isGemStone. + self deny: GRPlatform current isPharo. + self deny: GRPlatform current isSqueak. + self deny: GRPlatform current isVAST. + self deny: GRPlatform current isSmalltalkX diff --git a/repository/Grease-Tests-GemStone32-Core.package/GRGemStonePlatformTest.class/instance/testIsGemStone.st b/repository/Grease-Tests-GemStone32-Core.package/GRGemStonePlatformTest.class/instance/testIsGemStone.st new file mode 100644 index 00000000..c3aa2463 --- /dev/null +++ b/repository/Grease-Tests-GemStone32-Core.package/GRGemStonePlatformTest.class/instance/testIsGemStone.st @@ -0,0 +1,7 @@ +*Grease-Tests-Pharo-Core +testIsGemStone + self assert: GRPlatform current isGemStone. + self deny: GRPlatform current isPharo. + self deny: GRPlatform current isSqueak. + self deny: GRPlatform current isVAST. + self deny: GRPlatform current isSmalltalkX diff --git a/repository/Grease-Tests-Pharo-Core.package/GRPharoPlatformTest.class/instance/testIsPharo.st b/repository/Grease-Tests-Pharo-Core.package/GRPharoPlatformTest.class/instance/testIsPharo.st new file mode 100644 index 00000000..da5e9af5 --- /dev/null +++ b/repository/Grease-Tests-Pharo-Core.package/GRPharoPlatformTest.class/instance/testIsPharo.st @@ -0,0 +1,7 @@ +*Grease-Tests-Pharo-Core +testIsPharo + self assert: GRPlatform current isPharo. + self deny: GRPlatform current isGemStone. + self deny: GRPlatform current isSqueak. + self deny: GRPlatform current isVAST. + self deny: GRPlatform current isSmalltalkX \ No newline at end of file From 3cc491aaca9ac463c2c086c4ca17df4577e7f090 Mon Sep 17 00:00:00 2001 From: Johan Brichau Date: Thu, 11 Dec 2025 14:24:24 +0100 Subject: [PATCH 2/4] Fix test on Windows platforms (make it cross-platform) --- .../GRPlatformTest.class/instance/testSourceCodeStringOf.st | 5 +++-- .../GRPharoPlatformTest.class/instance/testIsPharo.st | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testSourceCodeStringOf.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testSourceCodeStringOf.st index 64a5c334..13d1e453 100644 --- a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testSourceCodeStringOf.st +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testSourceCodeStringOf.st @@ -5,7 +5,8 @@ testSourceCodeStringOf sourceCodeString := GRPlatform current sourceCodeStringOf: GRPlatform >> #sourceCodeStringOf:. self assert: sourceCodeString - equals: 'sourceCodeStringOf: aCompiledMethod + equals: (GRPlatform current convertToSmalltalkNewlines: +'sourceCodeStringOf: aCompiledMethod "Return a String with the source code for a compiled method." - self subclassResponsibility' \ No newline at end of file + self subclassResponsibility') \ No newline at end of file diff --git a/repository/Grease-Tests-Pharo-Core.package/GRPharoPlatformTest.class/instance/testIsPharo.st b/repository/Grease-Tests-Pharo-Core.package/GRPharoPlatformTest.class/instance/testIsPharo.st index da5e9af5..1677c4d6 100644 --- a/repository/Grease-Tests-Pharo-Core.package/GRPharoPlatformTest.class/instance/testIsPharo.st +++ b/repository/Grease-Tests-Pharo-Core.package/GRPharoPlatformTest.class/instance/testIsPharo.st @@ -1,4 +1,4 @@ -*Grease-Tests-Pharo-Core +tests testIsPharo self assert: GRPlatform current isPharo. self deny: GRPlatform current isGemStone. From 80e5889b1d44a2b054b7a05162819a9ffd3a81cf Mon Sep 17 00:00:00 2001 From: Patrik Date: Wed, 8 Apr 2026 16:50:03 +0200 Subject: [PATCH 3/4] Class shouldn't have category starting with * that belongs to extension --- .../GRGemStonePlatform.class/instance/doTransaction..st | 2 +- .../GRGemStonePlatform.class/instance/thisContext.st | 2 +- .../GRGemStonePlatformTest.class/instance/testIsGemStone.st | 2 +- .../GRGemStonePlatformTest.class/instance/testIsGemStone.st | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/repository/Grease-GemStone-Core.package/GRGemStonePlatform.class/instance/doTransaction..st b/repository/Grease-GemStone-Core.package/GRGemStonePlatform.class/instance/doTransaction..st index bef36fcb..1ca22e12 100644 --- a/repository/Grease-GemStone-Core.package/GRGemStonePlatform.class/instance/doTransaction..st +++ b/repository/Grease-GemStone-Core.package/GRGemStonePlatform.class/instance/doTransaction..st @@ -1,4 +1,4 @@ -*grease-gemstone-core +transactions doTransaction: aBlock "Evaluate aBlock in a transaction. Return true if the transaction succeeds and false if the transaction fails. diff --git a/repository/Grease-GemStone-Core.package/GRGemStonePlatform.class/instance/thisContext.st b/repository/Grease-GemStone-Core.package/GRGemStonePlatform.class/instance/thisContext.st index 50e2a5b0..4de9489b 100644 --- a/repository/Grease-GemStone-Core.package/GRGemStonePlatform.class/instance/thisContext.st +++ b/repository/Grease-GemStone-Core.package/GRGemStonePlatform.class/instance/thisContext.st @@ -1,3 +1,3 @@ -*grease-gemstone-core +processes thisContext ^ GsContext fromLevel: 3 \ No newline at end of file diff --git a/repository/Grease-Tests-GemStone-Core.package/GRGemStonePlatformTest.class/instance/testIsGemStone.st b/repository/Grease-Tests-GemStone-Core.package/GRGemStonePlatformTest.class/instance/testIsGemStone.st index c3aa2463..e9fce035 100644 --- a/repository/Grease-Tests-GemStone-Core.package/GRGemStonePlatformTest.class/instance/testIsGemStone.st +++ b/repository/Grease-Tests-GemStone-Core.package/GRGemStonePlatformTest.class/instance/testIsGemStone.st @@ -1,4 +1,4 @@ -*Grease-Tests-Pharo-Core +tests testIsGemStone self assert: GRPlatform current isGemStone. self deny: GRPlatform current isPharo. diff --git a/repository/Grease-Tests-GemStone32-Core.package/GRGemStonePlatformTest.class/instance/testIsGemStone.st b/repository/Grease-Tests-GemStone32-Core.package/GRGemStonePlatformTest.class/instance/testIsGemStone.st index c3aa2463..e9fce035 100644 --- a/repository/Grease-Tests-GemStone32-Core.package/GRGemStonePlatformTest.class/instance/testIsGemStone.st +++ b/repository/Grease-Tests-GemStone32-Core.package/GRGemStonePlatformTest.class/instance/testIsGemStone.st @@ -1,4 +1,4 @@ -*Grease-Tests-Pharo-Core +tests testIsGemStone self assert: GRPlatform current isGemStone. self deny: GRPlatform current isPharo. From abe61d4db2d35eb255fb732c07f233540ace4a21 Mon Sep 17 00:00:00 2001 From: Patrik Date: Wed, 8 Apr 2026 14:40:36 +0000 Subject: [PATCH 4/4] Adding assert(s) alias for GemStone to allow running Pharo tests on GS --- .../TestAsserter.extension/instance/assert.identicalTo..st | 4 ++++ .../TestAsserter.extension/instance/deny.identicalTo..st | 5 +++++ .../TestAsserter.extension/properties.json | 2 ++ 3 files changed, 11 insertions(+) create mode 100644 repository/Grease-GemStone-Core.package/TestAsserter.extension/instance/assert.identicalTo..st create mode 100644 repository/Grease-GemStone-Core.package/TestAsserter.extension/instance/deny.identicalTo..st create mode 100644 repository/Grease-GemStone-Core.package/TestAsserter.extension/properties.json diff --git a/repository/Grease-GemStone-Core.package/TestAsserter.extension/instance/assert.identicalTo..st b/repository/Grease-GemStone-Core.package/TestAsserter.extension/instance/assert.identicalTo..st new file mode 100644 index 00000000..c35dccec --- /dev/null +++ b/repository/Grease-GemStone-Core.package/TestAsserter.extension/instance/assert.identicalTo..st @@ -0,0 +1,4 @@ +*grease-gemstone-core +assert: anObject identicalTo: otherObj + + self assert: anObject identical: otherObj \ No newline at end of file diff --git a/repository/Grease-GemStone-Core.package/TestAsserter.extension/instance/deny.identicalTo..st b/repository/Grease-GemStone-Core.package/TestAsserter.extension/instance/deny.identicalTo..st new file mode 100644 index 00000000..e516bae0 --- /dev/null +++ b/repository/Grease-GemStone-Core.package/TestAsserter.extension/instance/deny.identicalTo..st @@ -0,0 +1,5 @@ +*grease-gemstone-core +deny: anObject identicalTo: anotherObject + self + deny: anObject == anotherObject + description: anObject printString, ' is *not* identical to ', anotherObject printString. \ No newline at end of file diff --git a/repository/Grease-GemStone-Core.package/TestAsserter.extension/properties.json b/repository/Grease-GemStone-Core.package/TestAsserter.extension/properties.json new file mode 100644 index 00000000..10c0c4d0 --- /dev/null +++ b/repository/Grease-GemStone-Core.package/TestAsserter.extension/properties.json @@ -0,0 +1,2 @@ +{ + "name" : "TestAsserter" }