From 8f19e523993924294020d9b76891f9844a3afaac Mon Sep 17 00:00:00 2001 From: Stefan Marr Date: Wed, 26 Jul 2023 10:11:37 +0100 Subject: [PATCH 1/3] Add CI tests for unittest benchmarks --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a94f2cf..19faaec8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -161,3 +161,12 @@ jobs: run: | cd som-vm ${{ matrix.som }} -cp ../Smalltalk:../TestSuite:../SomSom/src/compiler:../SomSom/src/interpreter:../SomSom/src/primitives:../SomSom/src/vm:../SomSom/src/vmobjects ../SomSom/tests/SomSomTests.som + + - name: Test Unit Test Benchmark + if: ${{ matrix.repo == 'JsSOM.git' }} + run: | + cd Examples/Benchmarks/TestSuite + ./duplicate-tests.sh + cd ../../../som-vm + ${{ matrix.som }} -cp ../Smalltalk:../Examples/Benchmarks/TestSuite ../Examples/Benchmarks/BenchmarkHarness.som --gc TestGC100 1 1 + ${{ matrix.som }} -cp ../Smalltalk:../Examples/Benchmarks/TestSuite ../Examples/Benchmarks/BenchmarkHarness.som Test100 1 1 From afd9c33fa2b0ace9568a93d2469e0e27f2420478 Mon Sep 17 00:00:00 2001 From: Stefan Marr Date: Wed, 26 Jul 2023 10:17:15 +0100 Subject: [PATCH 2/3] Fix duplicate-tests.sh - need bash, otherwise it breaks - make progress output more compact - work around incompatibility of sed -i on macos and Linux --- .../Benchmarks/TestSuite/duplicate-tests.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Examples/Benchmarks/TestSuite/duplicate-tests.sh b/Examples/Benchmarks/TestSuite/duplicate-tests.sh index 94c3e570..80544ca1 100755 --- a/Examples/Benchmarks/TestSuite/duplicate-tests.sh +++ b/Examples/Benchmarks/TestSuite/duplicate-tests.sh @@ -1,8 +1,15 @@ -#!/bin/sh +#!/bin/bash +UNAME="$(uname -s)" + echo "Currently, we can only do up to 10 classes, because otherwise, we have too many literals in a single method" for i in $(seq 1 100) do - echo $i + if [ $(($i % 20)) -eq "0" ] + then + echo ". $i" + else + echo -n "." + fi TESTS=("Array" "Block" "Boolean" "ClassLoading" "ClassStructure" "Closure" "Coercion" "CompilerReturn" "Dictionary" "DoesNotUnderstand" "Double" "Empty" "Global" @@ -13,7 +20,11 @@ do for name in ${TESTS[@]} do cp "${name}Test.som" "${name}${i}Test.som" - sed -i '' "s/${name}Test =/${name}${i}Test =/g" "${name}${i}Test.som" + if [ "${UNAME}" = "Darwin" ]; then + sed -i '' "s/${name}Test =/${name}${i}Test =/g" "${name}${i}Test.som" + else + sed -i'' "s/${name}Test =/${name}${i}Test =/g" "${name}${i}Test.som" + fi done # Create TestGC${i}.som From 0d98eaade8d80f9799d1e6a7b46d593b23745a30 Mon Sep 17 00:00:00 2001 From: Stefan Marr Date: Wed, 26 Jul 2023 10:24:42 +0100 Subject: [PATCH 3/3] =?UTF-8?q?JsSOM=20currently=20doesn=E2=80=99t=20give?= =?UTF-8?q?=20the=20correct=20results=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19faaec8..54bfae84 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -163,7 +163,7 @@ jobs: ${{ matrix.som }} -cp ../Smalltalk:../TestSuite:../SomSom/src/compiler:../SomSom/src/interpreter:../SomSom/src/primitives:../SomSom/src/vm:../SomSom/src/vmobjects ../SomSom/tests/SomSomTests.som - name: Test Unit Test Benchmark - if: ${{ matrix.repo == 'JsSOM.git' }} + if: ${{ matrix.repo == 'som-java.git' }} run: | cd Examples/Benchmarks/TestSuite ./duplicate-tests.sh