Skip to content
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
26 changes: 26 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions server/sim_hardware.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
55 changes: 40 additions & 15 deletions tests/transcript
Original file line number Diff line number Diff line change
Expand Up @@ -231,26 +231,21 @@
< 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
< 9
<
> ERR Table write is not a whole number of rows

< SEQ2.TABLE<
< 1 2 3 4 5 6 7 8
<
> OK

< SEQ2.TABLE<B
< 1234567
<
Expand All @@ -266,16 +261,19 @@
<
> 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
Expand Down Expand Up @@ -320,7 +318,7 @@
< PCOMP2.TABLE<B
< 123456789AB=
<
< PCOMP2.TABLE<<
< PCOMP2.TABLE<
< 1 2 3 4 5 6 7 8
< 9
<
Expand Down Expand Up @@ -464,7 +462,32 @@
< *CHANGES.ATTR=
> 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
> .

# 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
Expand Down Expand Up @@ -504,10 +527,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.*?
Expand All @@ -516,6 +539,8 @@
> !ROW_WORDS
> !LENGTH
> !FIELDS
> !QUEUED_LINES
> !MODE
> !INFO
> .

Expand Down