Skip to content

Commit

Permalink
update stm32 project, validate json output
Browse files Browse the repository at this point in the history
  • Loading branch information
t-moe committed Dec 4, 2024
1 parent 430e5e5 commit cca953c
Show file tree
Hide file tree
Showing 9 changed files with 225 additions and 73 deletions.
42 changes: 38 additions & 4 deletions .github/test-projects/step-executor.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
#!/bin/sh
set -e
set -x
#!/bin/bash

/home/probe-rs-runner/probe-rs run "$TARGET" $TARGET_CONFIG
touch stdout
touch stderr

/home/probe-rs-runner/probe-rs run --disable-progressbars "$TARGET" $TARGET_CONFIG --format=json 2> stderr | jq -c 'del(.exec_time)' >stdout

# Remove all timestamps, and lines starting with /home/ from stderr. Also remove the first "Finished in 0.xx s" line
cat stderr | grep -v "Finished in " | sed -E 's/^[0-9]{1,2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}://' | sed '/^[[:space:]]*\/home\//d' > stderr_cleaned

echo "Stdout" >&2
echo "------------------------------------------------" >&2
cat stdout >&2
echo "Stderr" >&2
echo "------------------------------------------------" >&2
cat stderr_cleaned >&2

res=0

# Output markers around diff to render it nicely in markdown
echo "Test Results diff:"
echo "\`\`\`diff"
if ! diff stdout expected_test_results.txt; then
res=1
fi


echo "\`\`\`"

echo "Stderr diff:"
echo "\`\`\`diff"
#if !diff stderr expected_stderr.txt; then
# res=1
#fi
cat stderr_cleaned
echo "\`\`\`"

rm -f stdout stderr stderr_cleaned

#exit $res
exit 1
171 changes: 120 additions & 51 deletions .github/test-projects/stm32/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions .github/test-projects/stm32/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ cortex-m = { version = "0.7.7", features = ["inline-asm", "critical-section-sing
cortex-m-rt = "0.7.3"
panic-probe = "0.3"
rtt-target = { version = "0.6.1", features = ["log"] }

embassy-stm32 = { git = "https://github.com/embassy-rs/embassy", rev = "ed3da1721a4f704d3f2a8a1cf84d9fc051c71945", features = ["time-driver-any", "memory-x", "unstable-pac", "exti"] }
embassy-executor = { version = "0.6.3", features = ["arch-cortex-m", "executor-thread", "integrated-timers"] }
embassy-stm32 = { version = "0.1.0", features = ["time-driver-any", "memory-x", "unstable-pac", "exti"] }
embassy-time = "0.3.2"
log = "0.4.22"

[dev-dependencies]
embedded-test = { version = "0.5.0" }
embedded-test = { path = "../../..", features = ["embassy", "log"] }

[[test]]
name = "example_test"
Expand Down
Loading

0 comments on commit cca953c

Please sign in to comment.