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 the philosopher test for Renode #25

Merged
merged 4 commits into from
Oct 28, 2024
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
17 changes: 17 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
matrix:
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
env:
WGET_ARGS: "-q"
RENODE_VERSION: "1.15.3"
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -50,6 +53,19 @@ jobs:
rustup target add thumbv7m-none-eabi
rustup target add thumbv8m.main-none-eabi

# Note that Renode is only provided for x86_64 targets. This matches the github runners.
- name: Install Renode
shell: bash
run: |
set -e
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt-get -y update
wget ${WGET_ARGS} https://github.com/renode/renode/releases/download/v${RENODE_VERSION}/renode_${RENODE_VERSION}_amd64.deb
sudo apt-get install -y ./renode_${RENODE_VERSION}_amd64.deb
rm renode_${RENODE_VERSION}_amd64.deb
pip3 install -r /opt/renode/tests/requirements.txt --no-cache-dir

- name: Build firmware
working-directory: apptest
shell: bash
Expand All @@ -60,4 +76,5 @@ jobs:
df -h

west twister -M all -T samples -T tests -v --inline-logs --integration -j 4 \
--timeout-multiplier 2 \
$(cat etc/platforms.txt)
1 change: 1 addition & 0 deletions etc/platforms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
-p qemu_riscv32/qemu_virt_riscv32/smp
-p qemu_riscv64
-p qemu_riscv64/qemu_virt_riscv64/smp
-p m2gl025_miv
2 changes: 1 addition & 1 deletion samples/philosophers/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ common:
regex:
# Match the statistics, and make sure that each philosopher has at least 10 (two digits)
# meals.
- "^\\[\\d{2,}, \\d{2,}, \\d{2,}, \\d{2,}, \\d{2,}, \\d{2,}\\]"
- "c:\\[\\d{2,}, \\d{2,}, \\d{2,}, \\d{2,}, \\d{2,}, \\d{2,}\\]"
tags: rust
filter: CONFIG_RUST_SUPPORTED
tests:
Expand Down
2 changes: 1 addition & 1 deletion samples/philosophers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ impl Stats {
}

fn show(&self) {
printkln!("{:?}, e:{:?}, t:{:?}", self.count, self.eating, self.thinking);
printkln!("c:{:?}, e:{:?}, t:{:?}", self.count, self.eating, self.thinking);
}
}

Expand Down