Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #listAtCategoryNamed: has been deprecated in Pharo 12 #606

Merged
merged 7 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions pharo/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ pharo::get_image_url() {
local smalltalk_name=$1

case "${smalltalk_name}" in
"Pharo64-alpha")
"Pharo64-alpha"|"Pharo-alpha")
echo "get.pharo.org/64/alpha"
;;
"Pharo64-stable")
"Pharo64-stable"|"Pharo-stable")
echo "get.pharo.org/64/stable"
;;
"Pharo64-12")
Expand All @@ -45,12 +45,15 @@ pharo::get_image_url() {
"Pharo64-6.0")
echo "get.pharo.org/64/60"
;;
"Pharo32-alpha"|"Pharo-alpha")
"Pharo32-alpha")
echo "get.pharo.org/alpha"
;;
"Pharo32-stable"|"Pharo-stable")
"Pharo32-stable")
echo "get.pharo.org/stable"
;;
"Pharo32-12")
echo "get.pharo.org/32/120"
;;
"Pharo32-11")
echo "get.pharo.org/32/110"
;;
Expand Down Expand Up @@ -142,14 +145,16 @@ moose::get_image_url() {
################################################################################
pharo::get_vm_url() {
local smalltalk_name=$1
local stable_version=11
local alpha_version=12

case "${smalltalk_name}" in
# NOTE: vmLatestXX should be updated every time new Pharo is released
"Pharo64-alpha")
echo "get.pharo.org/64/vmLatest110"
"Pharo64-alpha"|"Pharo-alpha")
echo "get.pharo.org/64/vmLatest${alpha_version}0"
;;
"Pharo64-stable")
echo "get.pharo.org/64/vm100"
"Pharo64-stable"|"Pharo-stable")
echo "get.pharo.org/64/vm${stable_version}0"
;;
"Pharo64-12")
echo "get.pharo.org/64/vm120"
Expand All @@ -175,11 +180,14 @@ pharo::get_vm_url() {
"Pharo64-6.0")
echo "get.pharo.org/64/vm60"
;;
"Pharo32-alpha"|"Pharo-alpha")
echo "get.pharo.org/vmLatest110"
"Pharo32-alpha")
echo "get.pharo.org/vmLatest${alpha_version}0"
;;
"Pharo-stable"|"Pharo32-stable")
echo "get.pharo.org/vm100"
"Pharo32-stable")
echo "get.pharo.org/vm${stable_version}0"
;;
"Pharo32-12")
echo "get.pharo.org/vm120"
;;
"Pharo32-11")
echo "get.pharo.org/vm110"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ addLoadedClassesFrom: aDefinitionsCollection
| mcOrganization classes |
mcOrganization := aDefinitionsCollection detect: [ :def | def isOrganizationDefinition ].
mcOrganization ifNil: [ self error: 'Could not find MCOrganizationDefinition' ].
classes := SmalltalkCI classesWithCategoryNames: mcOrganization categories.
self loadedClasses addAll: classes
classes := SmalltalkCI platformClass classesWithCategoryNames: mcOrganization categories.
self loadedClasses addAll: classes
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ testing
testAddLoadedClassesFrom
| mcOrganization |
self assert: true equals: (self spec loadedClasses isEmpty).

mcOrganization := MCOrganizationDefinition categories: #('SmalltalkCI-Core' 'SmalltalkCI-Tests').

self spec addLoadedClassesFrom: {mcOrganization}.
self deny: (self spec loadedClasses isEmpty).
self assert: (self spec loadedClasses includes: SmalltalkCI).
self assert: (self spec loadedClasses includes: SmalltalkCITest).
self assert: (self spec loadedClasses includes: SmalltalkCITest)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "SCIMonticelloLoadSpecTest",
"category" : "SmalltalkCI-GemStone-Tests",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "SCIGemStoneMonticelloLoadSpecTest",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class organization
classesInCategory: aCategory
^ (Smalltalk organization tagForCategory: aCategory)
ifNotNil: [ :tag |
tag classNames collect: [ :className | Smalltalk at: className ] ]
ifNil: [ #() ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
testing
testAddLoadedClassesFrom
| mcOrganization |
self assert: true equals: (self spec loadedClasses isEmpty).

mcOrganization := (MCOrganizationDefinition canUnderstand: #categories:)
ifTrue: [
"Squeak, Pharo < 12"
MCOrganizationDefinition categories: #('SmalltalkCI-Core' 'SmalltalkCI-Tests') ]
ifFalse: [
MCOrganizationDefinition
packageName: 'SmalltalkCI'
tagNames: #(Core Tests) ].

self spec addLoadedClassesFrom: {mcOrganization}.
self deny: (self spec loadedClasses isEmpty).
self assert: (self spec loadedClasses includes: SmalltalkCI)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "SCIMonticelloLoadSpecTest",
"category" : "SmalltalkCI-Pharo-Tests",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "SCIPharoMonticelloLoadSpecTest",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
testing
testAddLoadedClassesFrom
| mcOrganization |
self assert: true equals: (self spec loadedClasses isEmpty).

mcOrganization := MCOrganizationDefinition categories: #('SmalltalkCI-Core' 'SmalltalkCI-Tests').

self spec addLoadedClassesFrom: {mcOrganization}.
self deny: (self spec loadedClasses isEmpty).
self assert: (self spec loadedClasses includes: SmalltalkCI).
self assert: (self spec loadedClasses includes: SmalltalkCITest)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "SCIMonticelloLoadSpecTest",
"category" : "SmalltalkCI-Squeak-Tests",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "SCISqueakMonticelloLoadSpecTest",
"type" : "normal"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
},
"instance" : {
"setUp" : "fn 6/9/2016 09:53",
"testAddLoadedClassesFrom" : "fn 6/22/2016 10:50",
"testIsComplete" : "fn 6/9/2016 10:00",
"testRepository" : "fn 6/9/2016 15:23",
"testSimple" : "ct 5/15/2021 18:17" } }
20 changes: 16 additions & 4 deletions tests/pharo_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ test_get_image_url() {
image_url="$(pharo::get_image_url "Pharo32-stable")"
assertEquals "get.pharo.org/stable" "${image_url}"

image_url="$(pharo::get_image_url "Pharo64-alpha")"
assertEquals "get.pharo.org/64/alpha" "${image_url}"

image_url="$(pharo::get_image_url "Pharo64-stable")"
assertEquals "get.pharo.org/64/stable" "${image_url}"

image_url="$(pharo::get_image_url "Pharo64-12")"
assertEquals "get.pharo.org/64/120" "${image_url}"

image_url="$(pharo::get_image_url "Pharo64-11")"
assertEquals "get.pharo.org/64/110" "${image_url}"

Expand Down Expand Up @@ -54,16 +63,19 @@ test_get_vm_url() {
local vm_url

vm_url="$(pharo::get_vm_url "Pharo32-alpha")"
assertEquals "get.pharo.org/vmLatest110" "${vm_url}"
assertEquals "get.pharo.org/vmLatest120" "${vm_url}"

vm_url="$(pharo::get_vm_url "Pharo64-alpha")"
assertEquals "get.pharo.org/64/vmLatest110" "${vm_url}"
assertEquals "get.pharo.org/64/vmLatest120" "${vm_url}"

vm_url="$(pharo::get_vm_url "Pharo32-stable")"
assertEquals "get.pharo.org/vm100" "${vm_url}"
assertEquals "get.pharo.org/vm110" "${vm_url}"

vm_url="$(pharo::get_vm_url "Pharo64-stable")"
assertEquals "get.pharo.org/64/vm100" "${vm_url}"
assertEquals "get.pharo.org/64/vm110" "${vm_url}"

vm_url="$(pharo::get_vm_url "Pharo32-12")"
assertEquals "get.pharo.org/vm120" "${vm_url}"

vm_url="$(pharo::get_vm_url "Pharo32-11")"
assertEquals "get.pharo.org/vm110" "${vm_url}"
Expand Down