Skip to content

Conversation

@Himawari722
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@klarasm klarasm left a 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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants