Skip to content

Commit e29e2e3

Browse files
authored
Enable Testing on SOM++ and make Test benchmark work on all SOMs (#130)
2 parents 7bf0413 + 8e1c34c commit e29e2e3

25 files changed

+94
-353
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ jobs:
1010
fail-fast: false # we want all jobs to run, because they may fail independently
1111
matrix:
1212
include:
13-
# - name: SOM++
14-
# repo: SOMpp.git
15-
# apt: libcppunit-dev
16-
# build: "cmake . && make SOM++"
17-
# som: "./som.sh"
18-
# not-up-to-date: true
13+
- name: SOM++
14+
repo: SOMpp.git
15+
apt: libcppunit-dev
16+
build: "cmake . && make SOM++"
17+
som: "./SOM++"
18+
not-up-to-date: false
1919

2020
# - name: CSOM
2121
# repo: CSOM.git
@@ -30,7 +30,7 @@ jobs:
3030
repo: JsSOM.git
3131
build: ""
3232
som: "./som.sh"
33-
not-up-to-date: true
33+
not-up-to-date: false
3434

3535
- name: PySOM
3636
repo: PySOM.git
@@ -185,8 +185,7 @@ jobs:
185185
${{ matrix.som }} -cp ../Smalltalk:../Examples/Benchmarks/TestSuite ../Examples/Benchmarks/BenchmarkHarness.som Test100 1 1
186186
187187
- name: Test All Benchmark
188-
# ignore VMs that give slighly different results for tests
189-
if: ${{ matrix.repo != 'som-rs.git' && matrix.som != 'spec' && matrix.repo != 'JsSOM.git' && matrix.repo != 'PySOM.git' }}
188+
if: ${{ matrix.som != 'spec' }}
190189
run: |
191190
cd som-vm
192191
${{ matrix.som }} -cp ../Smalltalk:../Examples/Benchmarks/TestSuite:../Examples/Benchmarks/Richards:../Examples/Benchmarks/DeltaBlue:../Examples/Benchmarks/NBody:../Examples/Benchmarks/Json:../Examples/Benchmarks/GraphSearch:../Examples/Benchmarks/LanguageFeatures ../Examples/Benchmarks/BenchmarkHarness.som All 1 1

Examples/Benchmarks/TestSuite/ClassStructure2Test.som

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,7 @@ ClassStructure2Test = TestCase (
2525
"This is a little fragile.
2626
Index needs to be adapted with changing Class definition."
2727
m := Object methods at: 1.
28-
"self expect: #class equals: m signature."
29-
30-
self optional: #invokableTypes assert: Primitive equals: m class. "Class>>#name should be a primitive."
31-
3228
m := Object methods at: 7.
33-
"self expect: #asString equals: m signature."
34-
35-
self optional: #invokableTypes assert: Method equals: m class. "Class>>#asString should be a normal method."
3629
)
3730

3831
testAccessToInstanceFields = (

Examples/Benchmarks/TestSuite/ClassStructure3Test.som

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,7 @@ ClassStructure3Test = TestCase (
2525
"This is a little fragile.
2626
Index needs to be adapted with changing Class definition."
2727
m := Object methods at: 1.
28-
"self expect: #class equals: m signature."
29-
30-
self optional: #invokableTypes assert: Primitive equals: m class. "Class>>#name should be a primitive."
31-
3228
m := Object methods at: 7.
33-
"self expect: #asString equals: m signature."
34-
35-
self optional: #invokableTypes assert: Method equals: m class. "Class>>#asString should be a normal method."
3629
)
3730

3831
testAccessToInstanceFields = (

Examples/Benchmarks/TestSuite/ClassStructure4Test.som

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,7 @@ ClassStructure4Test = TestCase (
2525
"This is a little fragile.
2626
Index needs to be adapted with changing Class definition."
2727
m := Object methods at: 1.
28-
"self expect: #class equals: m signature."
29-
30-
self optional: #invokableTypes assert: Primitive equals: m class. "Class>>#name should be a primitive."
31-
3228
m := Object methods at: 7.
33-
"self expect: #asString equals: m signature."
34-
35-
self optional: #invokableTypes assert: Method equals: m class. "Class>>#asString should be a normal method."
3629
)
3730

3831
testAccessToInstanceFields = (

Examples/Benchmarks/TestSuite/ClassStructure5Test.som

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,7 @@ ClassStructure5Test = TestCase (
2525
"This is a little fragile.
2626
Index needs to be adapted with changing Class definition."
2727
m := Object methods at: 1.
28-
"self expect: #class equals: m signature."
29-
30-
self optional: #invokableTypes assert: Primitive equals: m class. "Class>>#name should be a primitive."
31-
3228
m := Object methods at: 7.
33-
"self expect: #asString equals: m signature."
34-
35-
self optional: #invokableTypes assert: Method equals: m class. "Class>>#asString should be a normal method."
3629
)
3730

3831
testAccessToInstanceFields = (

Examples/Benchmarks/TestSuite/ClassStructureTest.som

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,7 @@ ClassStructureTest = TestCase (
2525
"This is a little fragile.
2626
Index needs to be adapted with changing Class definition."
2727
m := Object methods at: 1.
28-
"self expect: #class equals: m signature."
29-
30-
self optional: #invokableTypes assert: Primitive equals: m class. "Class>>#name should be a primitive."
31-
3228
m := Object methods at: 7.
33-
"self expect: #asString equals: m signature."
34-
35-
self optional: #invokableTypes assert: Method equals: m class. "Class>>#asString should be a normal method."
3629
)
3730

3831
testAccessToInstanceFields = (

Examples/Benchmarks/TestSuite/Integer2Test.som

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,8 @@ Integer2Test = TestCase (
3838
"Sometimes it can be hard to implement efficiently, but it SHOULD really
3939
be true for all values of integers."
4040
a := 1 << 30. b := 1 << 30.
41-
self optional: #integerIdentity assert: a is: b.
42-
4341
a := 1 << 32. b := 1 << 32.
44-
self optional: #integerIdentity assert: a is: b.
45-
4642
a := 1 << 60. b := 1 << 60.
47-
self optional: #integerIdentity assert: a is: b.
4843
)
4944

5045
testClassAndValueRanges = (
@@ -74,7 +69,6 @@ Integer2Test = TestCase (
7469
i := 1 << 70.
7570
self assert: Integer equals: i class.
7671
self assert: i > 0 description: 'should not overflow'.
77-
self optional: #bigIntShifts assert: '1180591620717411303424' equals: i asString.
7872

7973
i := -1 << 30.
8074
self assert: Integer equals: i class.
@@ -94,7 +88,6 @@ Integer2Test = TestCase (
9488
i := -1 << 70.
9589
self assert: Integer equals: i class.
9690
self assert: i < 0 description: 'should not underflow'.
97-
self optional: #bigIntShifts assert: '-1180591620717411303424' equals: i asString.
9891
)
9992

10093
testStringConversion = (
@@ -107,18 +100,16 @@ Integer2Test = TestCase (
107100
self assert: 42 equals: '42' asInteger.
108101
self assert: -2 equals: '-2' asInteger.
109102
)
110-
103+
111104
testIntegerLiterals = (
112105
"Make sure the parser reads literals correctly. So, check some basic properties"
113106
self assert: 2 / 2 equals: 1.
114107
self assert: 50 + 50 equals: 100.
115108
self assert: 92233720368 * 100000000 + 54775807 equals: 9223372036854775807.
116-
self assert: 92233720368 * 100000000 + 54775807 * 100 equals: 922337203685477580700.
117109
self assert: 50 - 100 equals: -50.
118110
self assert: 21474 * -100000 - 83648 equals: -2147483648.
119-
self assert: 92233720368 * 100000000 + 54775807 * -100 equals: -922337203685477580700.
120111
)
121-
112+
122113
testFromString = (
123114
self assert: 1 equals: (Integer fromString: '1').
124115
self assert: 100 equals: (Integer fromString: '100').
@@ -282,22 +273,14 @@ Integer2Test = TestCase (
282273
self assert: 0 equals: 1 >>> 1.
283274
self assert: 512 equals: 1024 >>> 1.
284275
self assert: 127 equals: 1023 >>> 3.
285-
286-
"not sure whether we should really insist on this"
287-
self optional: #toBeSpecified assert: 9223372036854775807 equals: -1 >>> 1.
288-
self optional: #toBeSpecified assert: 9223372036854775296 equals: -1024 >>> 1.
289276
)
290277

291278
testMin = (
292279
"We need to test numbers that are 64bit or less, larger than 64bit,
293280
positive, and negative"
294281
| big small |
295-
big := #(1 100 9223372036854775807 922337203685477580700
296-
-50 -2147483648 922337203685477580700 -922337203685477580700
297-
922337203685477580700).
298-
small := #(0 52 9223372036854775296 922337203685477529600
299-
-51 -2147483650 1 -922337203685477580701
300-
-922337203685477580701).
282+
big := #(1 100 -50 -2147483648).
283+
small := #(0 52 -51 -2147483650).
301284

302285
big doIndexes: [:i |
303286
self assert: (small at: i) equals: ((big at: i) min: (small at: i)).
@@ -308,12 +291,8 @@ Integer2Test = TestCase (
308291
"We need to test numbers that are 64bit or less, larger than 64bit,
309292
positive, and negative"
310293
| big small |
311-
big := #(1 100 9223372036854775807 922337203685477580700
312-
-50 -2147483648 922337203685477580700 -922337203685477580700
313-
922337203685477580700).
314-
small := #(0 52 9223372036854775296 922337203685477529600
315-
-51 -2147483650 1 -922337203685477580701
316-
-922337203685477580701).
294+
big := #(1 100 -50 -2147483648).
295+
small := #(0 52 -51 -2147483650).
317296
big doIndexes: [:i |
318297
self assert: (big at: i) equals: ((big at: i) max: (small at: i)).
319298
self assert: (big at: i) equals: ((small at: i) max: (big at: i)) ]

Examples/Benchmarks/TestSuite/Integer3Test.som

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,8 @@ Integer3Test = TestCase (
3838
"Sometimes it can be hard to implement efficiently, but it SHOULD really
3939
be true for all values of integers."
4040
a := 1 << 30. b := 1 << 30.
41-
self optional: #integerIdentity assert: a is: b.
42-
4341
a := 1 << 32. b := 1 << 32.
44-
self optional: #integerIdentity assert: a is: b.
45-
4642
a := 1 << 60. b := 1 << 60.
47-
self optional: #integerIdentity assert: a is: b.
4843
)
4944

5045
testClassAndValueRanges = (
@@ -74,7 +69,6 @@ Integer3Test = TestCase (
7469
i := 1 << 70.
7570
self assert: Integer equals: i class.
7671
self assert: i > 0 description: 'should not overflow'.
77-
self optional: #bigIntShifts assert: '1180591620717411303424' equals: i asString.
7872

7973
i := -1 << 30.
8074
self assert: Integer equals: i class.
@@ -94,7 +88,6 @@ Integer3Test = TestCase (
9488
i := -1 << 70.
9589
self assert: Integer equals: i class.
9690
self assert: i < 0 description: 'should not underflow'.
97-
self optional: #bigIntShifts assert: '-1180591620717411303424' equals: i asString.
9891
)
9992

10093
testStringConversion = (
@@ -107,18 +100,16 @@ Integer3Test = TestCase (
107100
self assert: 42 equals: '42' asInteger.
108101
self assert: -2 equals: '-2' asInteger.
109102
)
110-
103+
111104
testIntegerLiterals = (
112105
"Make sure the parser reads literals correctly. So, check some basic properties"
113106
self assert: 2 / 2 equals: 1.
114107
self assert: 50 + 50 equals: 100.
115108
self assert: 92233720368 * 100000000 + 54775807 equals: 9223372036854775807.
116-
self assert: 92233720368 * 100000000 + 54775807 * 100 equals: 922337203685477580700.
117109
self assert: 50 - 100 equals: -50.
118110
self assert: 21474 * -100000 - 83648 equals: -2147483648.
119-
self assert: 92233720368 * 100000000 + 54775807 * -100 equals: -922337203685477580700.
120111
)
121-
112+
122113
testFromString = (
123114
self assert: 1 equals: (Integer fromString: '1').
124115
self assert: 100 equals: (Integer fromString: '100').
@@ -282,22 +273,14 @@ Integer3Test = TestCase (
282273
self assert: 0 equals: 1 >>> 1.
283274
self assert: 512 equals: 1024 >>> 1.
284275
self assert: 127 equals: 1023 >>> 3.
285-
286-
"not sure whether we should really insist on this"
287-
self optional: #toBeSpecified assert: 9223372036854775807 equals: -1 >>> 1.
288-
self optional: #toBeSpecified assert: 9223372036854775296 equals: -1024 >>> 1.
289276
)
290277

291278
testMin = (
292279
"We need to test numbers that are 64bit or less, larger than 64bit,
293280
positive, and negative"
294281
| big small |
295-
big := #(1 100 9223372036854775807 922337203685477580700
296-
-50 -2147483648 922337203685477580700 -922337203685477580700
297-
922337203685477580700).
298-
small := #(0 52 9223372036854775296 922337203685477529600
299-
-51 -2147483650 1 -922337203685477580701
300-
-922337203685477580701).
282+
big := #(1 100 -50 -2147483648).
283+
small := #(0 52 -51 -2147483650).
301284

302285
big doIndexes: [:i |
303286
self assert: (small at: i) equals: ((big at: i) min: (small at: i)).
@@ -308,12 +291,8 @@ Integer3Test = TestCase (
308291
"We need to test numbers that are 64bit or less, larger than 64bit,
309292
positive, and negative"
310293
| big small |
311-
big := #(1 100 9223372036854775807 922337203685477580700
312-
-50 -2147483648 922337203685477580700 -922337203685477580700
313-
922337203685477580700).
314-
small := #(0 52 9223372036854775296 922337203685477529600
315-
-51 -2147483650 1 -922337203685477580701
316-
-922337203685477580701).
294+
big := #(1 100 -50 -2147483648).
295+
small := #(0 52 -51 -2147483650).
317296
big doIndexes: [:i |
318297
self assert: (big at: i) equals: ((big at: i) max: (small at: i)).
319298
self assert: (big at: i) equals: ((small at: i) max: (big at: i)) ]

Examples/Benchmarks/TestSuite/Integer4Test.som

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,8 @@ Integer4Test = TestCase (
3838
"Sometimes it can be hard to implement efficiently, but it SHOULD really
3939
be true for all values of integers."
4040
a := 1 << 30. b := 1 << 30.
41-
self optional: #integerIdentity assert: a is: b.
42-
4341
a := 1 << 32. b := 1 << 32.
44-
self optional: #integerIdentity assert: a is: b.
45-
4642
a := 1 << 60. b := 1 << 60.
47-
self optional: #integerIdentity assert: a is: b.
4843
)
4944

5045
testClassAndValueRanges = (
@@ -74,7 +69,6 @@ Integer4Test = TestCase (
7469
i := 1 << 70.
7570
self assert: Integer equals: i class.
7671
self assert: i > 0 description: 'should not overflow'.
77-
self optional: #bigIntShifts assert: '1180591620717411303424' equals: i asString.
7872

7973
i := -1 << 30.
8074
self assert: Integer equals: i class.
@@ -94,7 +88,6 @@ Integer4Test = TestCase (
9488
i := -1 << 70.
9589
self assert: Integer equals: i class.
9690
self assert: i < 0 description: 'should not underflow'.
97-
self optional: #bigIntShifts assert: '-1180591620717411303424' equals: i asString.
9891
)
9992

10093
testStringConversion = (
@@ -107,18 +100,16 @@ Integer4Test = TestCase (
107100
self assert: 42 equals: '42' asInteger.
108101
self assert: -2 equals: '-2' asInteger.
109102
)
110-
103+
111104
testIntegerLiterals = (
112105
"Make sure the parser reads literals correctly. So, check some basic properties"
113106
self assert: 2 / 2 equals: 1.
114107
self assert: 50 + 50 equals: 100.
115108
self assert: 92233720368 * 100000000 + 54775807 equals: 9223372036854775807.
116-
self assert: 92233720368 * 100000000 + 54775807 * 100 equals: 922337203685477580700.
117109
self assert: 50 - 100 equals: -50.
118110
self assert: 21474 * -100000 - 83648 equals: -2147483648.
119-
self assert: 92233720368 * 100000000 + 54775807 * -100 equals: -922337203685477580700.
120111
)
121-
112+
122113
testFromString = (
123114
self assert: 1 equals: (Integer fromString: '1').
124115
self assert: 100 equals: (Integer fromString: '100').
@@ -282,22 +273,14 @@ Integer4Test = TestCase (
282273
self assert: 0 equals: 1 >>> 1.
283274
self assert: 512 equals: 1024 >>> 1.
284275
self assert: 127 equals: 1023 >>> 3.
285-
286-
"not sure whether we should really insist on this"
287-
self optional: #toBeSpecified assert: 9223372036854775807 equals: -1 >>> 1.
288-
self optional: #toBeSpecified assert: 9223372036854775296 equals: -1024 >>> 1.
289276
)
290277

291278
testMin = (
292279
"We need to test numbers that are 64bit or less, larger than 64bit,
293280
positive, and negative"
294281
| big small |
295-
big := #(1 100 9223372036854775807 922337203685477580700
296-
-50 -2147483648 922337203685477580700 -922337203685477580700
297-
922337203685477580700).
298-
small := #(0 52 9223372036854775296 922337203685477529600
299-
-51 -2147483650 1 -922337203685477580701
300-
-922337203685477580701).
282+
big := #(1 100 -50 -2147483648).
283+
small := #(0 52 -51 -2147483650).
301284

302285
big doIndexes: [:i |
303286
self assert: (small at: i) equals: ((big at: i) min: (small at: i)).
@@ -308,12 +291,8 @@ Integer4Test = TestCase (
308291
"We need to test numbers that are 64bit or less, larger than 64bit,
309292
positive, and negative"
310293
| big small |
311-
big := #(1 100 9223372036854775807 922337203685477580700
312-
-50 -2147483648 922337203685477580700 -922337203685477580700
313-
922337203685477580700).
314-
small := #(0 52 9223372036854775296 922337203685477529600
315-
-51 -2147483650 1 -922337203685477580701
316-
-922337203685477580701).
294+
big := #(1 100 -50 -2147483648).
295+
small := #(0 52 -51 -2147483650).
317296
big doIndexes: [:i |
318297
self assert: (big at: i) equals: ((big at: i) max: (small at: i)).
319298
self assert: (big at: i) equals: ((small at: i) max: (big at: i)) ]

0 commit comments

Comments
 (0)