From 2d98f90eb17ae449c162b877b9fbadcbd54011b7 Mon Sep 17 00:00:00 2001 From: Patrik Date: Fri, 5 Sep 2025 12:29:18 +0200 Subject: [PATCH 1/2] 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/2] 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.