-
Notifications
You must be signed in to change notification settings - Fork 5
Add script to test pipeline and c output #286
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
base: dev
Are you sure you want to change the base?
Conversation
klarasm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good. It would probably be good to squash these two commits together.
| fi | ||
| - name: Run integrated pipeline test | ||
| run: | | ||
| bash test_pipeline.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No final newline.
| echo "Compiling SDF_example_008.hs into C" | ||
| nix run .#forsyde-compiler -- examples/model/SDF_example_008.hs -o ./examples/implementation/platform_independent/test_008.c --output-c | ||
| echo "Compiling C code into executable" | ||
| gcc examples/implementation/platform_independent/test_008.c -o test_008 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be nice to eventually just loop through all the files in the test/model directory, but this should be fine for now since we currently only support this one.
| echo "Compiling C code into executable" | ||
| gcc examples/implementation/platform_independent/test_008.c -o test_008 | ||
|
|
||
| expected_output=$(cat <<EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it would be nice to get the output from the haskell model directly but not sure how we would automate that (we would need to write some stub for passing arbitrary list as well as probably adding a cabal project for the test/model directory or something). I think this is fine as it is for now, however.
| echo "Running..." | ||
| actual_output=$(printf "1 1\n2 2\n3 3\n4 4\n" | ./test_008) | ||
|
|
||
| if [ "$expected_output" != "$actual_output" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could put this into a function which we call with maybe test name, expected output, and actual output. But that's probably for later once we support more of the models.
No description provided.