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

Macro compilation tests. #57

Merged
merged 25 commits into from
Feb 20, 2022
Merged

Macro compilation tests. #57

merged 25 commits into from
Feb 20, 2022

Conversation

Anders429
Copy link
Owner

This PR defines macro compilation tests using the trybuild crate. These tests are for every macro defined within this crate. Additionally, some macros (specifically, the stages! macro and a small amount of the entities! macro) were rewritten to match the expected output (which is good, that means the tests are working!). More tests could be added in the future with #54, but for now I believe this covers all the possible failure cases of the macros.

@codecov-commenter
Copy link

codecov-commenter commented Feb 18, 2022

Codecov Report

Merging #57 (1e8dcfa) into master (bec99bb) will decrease coverage by 0.73%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #57      +/-   ##
==========================================
- Coverage   22.00%   21.27%   -0.74%     
==========================================
  Files          54       54              
  Lines        3853     3986     +133     
==========================================
  Hits          848      848              
- Misses       3005     3138     +133     
Impacted Files Coverage Δ
src/entities/mod.rs 0.00% <ø> (ø)
src/lib.rs 100.00% <ø> (ø)
src/world/mod.rs 0.00% <0.00%> (ø)
src/system/mod.rs 0.00% <0.00%> (ø)
src/system/par.rs 0.00% <0.00%> (ø)
src/query/result/iter.rs 0.00% <0.00%> (ø)
src/system/schedule/mod.rs 0.00% <0.00%> (ø)
src/query/result/par_iter.rs 0.00% <0.00%> (ø)
src/system/schedule/builder.rs 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bec99bb...1e8dcfa. Read the comment docs.

@Anders429
Copy link
Owner Author

Anders429 commented Feb 18, 2022

There are two failures, caused by things outside of this PR:

  • miri: seems that miri isn't set up to allow directory-level access, which is required by trybuild. Essentially, readdir64 is not yet included in the list of foreign functions supported. This appears to be the tracking function.
  • valgrind: this appears to be a bug within cargo-valgrind. The output from valgrind doesn't match what cargo-valgrind is expecting. Doesn't seem to be caused by the tests at all.

@Anders429
Copy link
Owner Author

Fixed the cargo-valgrind issue by upgriding the valgrind version in the CI. Unfortunately, this leads to a new problem, which is that valgrind finds a memory leak specifically when running the trybuild tests. As far as I can tell, it's detecting a link directly with the trybuild TestCases object. This is not useful for the crate, and can be safely ignored.

Both of these failures seem to be out of scope of this crate. I'm thinking the best option moving forward is to just disable trybuild tests on the miri and valgrind jobs.

@Anders429
Copy link
Owner Author

Just to clarify, the decision to ignore these tests for valgrind and miri is fine because the only aspect that would be checked in either of those workflows is the trybuild::TestCases object. The compilation tests wouldn't be tested whatsoever, so we aren't even checking anything by running either tool over these tests.

I will be keeping the more recent version of valgrind, as I think that has benefit regardless of whether it is needed to make the workflow work correctly. Using up-to-date software is a good idea, and the work is now already done to make it up-to-date.

@Anders429 Anders429 merged commit cf186bd into master Feb 20, 2022
@Anders429 Anders429 deleted the trybuild branch February 20, 2022 06:36
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