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

Add tests for Package functions #32

Merged
merged 40 commits into from
May 14, 2022
Merged

Add tests for Package functions #32

merged 40 commits into from
May 14, 2022

Conversation

erikscheurer
Copy link
Contributor

@erikscheurer erikscheurer commented Apr 22, 2022

This PR adds tests for the most of the package functions. The tests are heavily inspired by the python bindings.

The tests use the original Julia bindings, but make Julia use a dummy API instead of the real preCICE API.

@erikscheurer erikscheurer marked this pull request as draft April 22, 2022 15:46
@erikscheurer
Copy link
Contributor Author

erikscheurer commented May 4, 2022

At the moment, the fake Solverdummy interface has to be specified manually for the test. This is done by running in the test directory:

$ make
$ julia
julia> ]
pkg> dev ../
julia> push!(Libc.Libdl.DL_LOAD_PATH, "<path-to-test-directory>")
julia> ]
pkg> test PreCICE

Then the new testset should run, and pass except for one test. At the moment, after this testset I've put in a exit() so the solverdummy doesn't run, because running the solverdummy would have to access the correct SolverInterface. Until the path works, I'll leave it like this.
The one test that doesn't work is the readWriteScalarData test. Here a scalar value is written to the fake_read_write_buffer. This works without problem as far as my debugging shows.
However, reading the data doesn't. The Problem probably lies somewhere in handling references and pointers with the C code.
PreCICE.jl passes a reference to a double into the C function which then is supposed to rewrite the data where the pointer is pointing to.
In the Python bindings, the pointer is different, but this is C++ code instead of C and I don't have enough experience with C/C++ to fix this error.
The tests should also resemble how it is implemented in the original SolverInterface so the orientation shouldn't only be the python bindings.

@erikscheurer erikscheurer requested a review from IshaanDesai May 13, 2022 14:41
Copy link
Member

@IshaanDesai IshaanDesai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a few minor comments, otherwise its good to go 👍 Good job here, we now have a proper testing infrastructure!

erikscheurer and others added 4 commits May 14, 2022 17:25
Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>
Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>
@erikscheurer erikscheurer marked this pull request as ready for review May 14, 2022 15:53
@erikscheurer erikscheurer merged commit 752ecec into develop May 14, 2022
@erikscheurer erikscheurer deleted the testing branch May 14, 2022 16:01
erikscheurer added a commit that referenced this pull request May 21, 2022
* Change version

* Correct TagBot

* Try _ to seperate PreCICE from bindings version

* Seperate bindings version with a `-`

* Change version to release candidate `2.4.0-0-rc1`

* Add formatter workflow (#31)

* Update README

* Add formatter workflow

* Format every current file

* New line at the end of the file

* Revert README changes

* Run format on each push on all branches

* Update README with general repository and troubleshooting (#30)

* Update README

* Minor edits to README

Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>

* Fix bug: readScalarData returns wrong value (#33)

* Fix wrong transposes (#35)

* Add tests for Package functions (#32)

* Update README

* Add formatter workflow

* Format every current file

* New line at the end of the file

* Revert README changes

* Run format on each push on all branches

* [WIP] Set up testing for all functions

* [WIP] Set up testing for all functions

* Correct some errors and types

* Use string compare and debugging

* Debugging

* Undo Integer convert

* Don't use range for 1.6 compat

* integer to Cint

* Merge develop into testing

* Seperate Functioncall tests

* Add info message where to run `make`

* Format

* Move function tests back to the rest

* Undo documentation changes for now unchanged functions

* Add user info where to run `make`

* Update test workflow to include function tests

* Undo changes to workflow and Fix runtests

* Update Readme

* Test excluding julia x86 architecture

* Test running tests manually

* Undo workflow changes

* Compile Fake solverdummy

* Install make in workflow

* no sudo

* make instead of build essential

* update and apt

* Add info on how to compile fake SolveIinterface.c

* Change command in user info

* Update README.md

Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>

* Update README.md

Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>

* Review Changes

Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>

* Remove meshName from arguments (#36)

* Remove meshName from arguments

* Remove MeshName from solverdummy test

* Format

* Fix tests (#37)

* Fix tests

* Remove unecessary comment

* Update version number

Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>
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