From 053cf8c4d1f0bc92c6bb35ffc4f8305141488e15 Mon Sep 17 00:00:00 2001 From: Emilio Perez Date: Sun, 7 Sep 2025 23:15:50 +0100 Subject: [PATCH 1/5] Adjust regression tests to streaming table change (PR #63) - Appending to a table is no longer supported. - Polled attributes need to be considered in *CHANGES commands. - Consider new mode attribute. --- tests/transcript | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/tests/transcript b/tests/transcript index f3b0bbd6..14d503e7 100644 --- a/tests/transcript +++ b/tests/transcript @@ -231,14 +231,14 @@ < PCOMP2.TABLE.LENGTH? > OK =3 -< PCOMP2.TABLE<< +< PCOMP2.TABLE< < 1 2 3 4 5 6 7 8 < 9 < > OK < PCOMP2.TABLE.LENGTH? -> OK =12 +> OK =9 < SEQ2.TABLE< < 1 2 3 4 5 6 7 8 @@ -246,11 +246,6 @@ < > ERR Table write is not a whole number of rows -< SEQ2.TABLE< -< 1 2 3 4 5 6 7 8 -< -> OK - < SEQ2.TABLE OK -< SEQ2.TABLE<< -< 1 2 3 4 5 6 7 8 -< -> OK - < SEQ2.TABLE? > !3891817943 > !16055470 > !964615029 > !4046827 +> . + +< SEQ2.TABLE< +< 1 2 3 4 5 6 7 8 +< +> OK + +< SEQ2.TABLE? > !1 > !2 > !3 @@ -320,7 +318,7 @@ < PCOMP2.TABLE OK +# Polled attributes changes are cleared by reading them +< *CHANGES.ATTR? +> !PCOMP1.TABLE.QUEUED_LINES=0 +> !PCOMP2.TABLE.QUEUED_LINES=0 +> !PCOMP3.TABLE.QUEUED_LINES=0 +> !PCOMP4.TABLE.QUEUED_LINES=0 +> !PGEN1.TABLE.QUEUED_LINES=0 +> !PGEN2.TABLE.QUEUED_LINES=0 +> !SEQ1.TABLE.QUEUED_LINES=0 +> !SEQ2.TABLE.QUEUED_LINES=0 +> !SEQ3.TABLE.QUEUED_LINES=0 +> !SEQ4.TABLE.QUEUED_LINES=0 +> . + < *CHANGES.ATTR? > . @@ -516,6 +528,8 @@ > !ROW_WORDS > !LENGTH > !FIELDS +> !QUEUED_LINES +> !MODE > !INFO > . From b4a89fb68185dff9b866b8facde9576d5aaa47c5 Mon Sep 17 00:00:00 2001 From: Emilio Perez Date: Sun, 7 Sep 2025 23:17:39 +0100 Subject: [PATCH 2/5] Fix sim server hw_long_table_write (length should be number of words) --- server/sim_hardware.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/sim_hardware.c b/server/sim_hardware.c index 5053d7bd..4e98b877 100644 --- a/server/sim_hardware.c +++ b/server/sim_hardware.c @@ -250,15 +250,15 @@ error__t hw_long_table_write( { ASSERT_OK(0 <= block_id && block_id < (int) block_id_count); struct table_block *block = &block_id_table[block_id]; + size_t nbytes = length * sizeof(uint32_t); - memcpy(block->data, data, length); - - uint32_t words = (uint32_t) length / sizeof(uint32_t); + memcpy(block->data, data, nbytes); + ASSERT_OK(length == (uint32_t) length); WITH_MUTEX(mutex) handle_error( write_command_int('T', - block->block_base, block->number, 0, words) ?: - write_all(block->data, length)); + block->block_base, block->number, 0, (uint32_t) length) ?: + write_all(block->data, nbytes)); return ERROR_OK; } From 6d135e6a78800d7b3b969f399a2db593213d4095 Mon Sep 17 00:00:00 2001 From: Emilio Perez Date: Sun, 7 Sep 2025 23:20:26 +0100 Subject: [PATCH 3/5] Adapt regression tests to removal of .MIN (PR #55) --- tests/transcript | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/transcript b/tests/transcript index 14d503e7..b94a4cb1 100644 --- a/tests/transcript +++ b/tests/transcript @@ -516,10 +516,10 @@ > ERR Time setting out of range < PULSE1.DELAY.RAW=3 -> ERR Value too small +> OK < PULSE1.DELAY=2e-8 -> ERR Value too small +> OK # Table support < SEQ.TABLE.*? From 4f73373036013e0f2ac428b8c28727840a94c613 Mon Sep 17 00:00:00 2001 From: Emilio Perez Date: Sun, 7 Sep 2025 23:38:58 +0100 Subject: [PATCH 4/5] Add CI workflow to run regression tests --- .github/workflows/tests.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..2516bf1f --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,26 @@ +name: Tests CI + +on: + push: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + container: + image: ghcr.io/pandablocks/pandablocks-dev-container:latest + volumes: + - ${{ github.workspace }}/build:/build + + steps: + - name: Checkout Source + uses: actions/checkout@v2 + with: + path: PandABlocks-server + + - name: Run the server regression tests + run: | + cd PandABlocks-server + ln -s CONFIG.example CONFIG + make sim_server + make -C tests From 957ba01bbac97f0504822bcf8a4784d00e9f13c0 Mon Sep 17 00:00:00 2001 From: Emilio Perez Juarez Date: Thu, 11 Sep 2025 10:48:12 +0100 Subject: [PATCH 5/5] tests: add bad test data to split the polled attribute change to a new PR Pull request #71 --- tests/transcript | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/transcript b/tests/transcript index b94a4cb1..f367132e 100644 --- a/tests/transcript +++ b/tests/transcript @@ -476,7 +476,18 @@ > !SEQ4.TABLE.QUEUED_LINES=0 > . +# TODO: remove QUEUED_LINES entries when pull request #71 get merged < *CHANGES.ATTR? +> !PCOMP1.TABLE.QUEUED_LINES=0 +> !PCOMP2.TABLE.QUEUED_LINES=0 +> !PCOMP3.TABLE.QUEUED_LINES=0 +> !PCOMP4.TABLE.QUEUED_LINES=0 +> !PGEN1.TABLE.QUEUED_LINES=0 +> !PGEN2.TABLE.QUEUED_LINES=0 +> !SEQ1.TABLE.QUEUED_LINES=0 +> !SEQ2.TABLE.QUEUED_LINES=0 +> !SEQ3.TABLE.QUEUED_LINES=0 +> !SEQ4.TABLE.QUEUED_LINES=0 > . < INENC2.VAL.CAPTURE=Mean