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

Enable the usage of selftests #751

Merged
merged 2 commits into from
Feb 5, 2022
Merged

Conversation

CohenArthur
Copy link
Member

From what I can understand, self tests seem to only be used in the C family of languages and in no other gcc frontend. And for some reason one of the self test for the gccrs frontend seem to be the parsing of C code and C types, which fails, which is why this PR is a draft. Once this is fixed, selftests should be enabled for the frontend and we should be able to add some to the project.

@CohenArthur
Copy link
Member Author

@philberty @tschwinge I ended up returning early from the "C tests" that are in gcc files common to all languages in 606250b. This is definitely not a good solution and I will also ask for advice on the mailing list as to how to handle the situation. I think these tests could be moved, or maybe we might need to add some extra flags to not run them if we are running the rust selftests.

@CohenArthur
Copy link
Member Author

But we can now have selftests and their failure is caught by the CI :)

@CohenArthur CohenArthur force-pushed the use-selftest branch 2 times, most recently from 10b339c to 05b2fda Compare November 5, 2021 09:56
@tschwinge
Copy link
Member

@CohenArthur, given the replies to your http://mid.mail-archive.com/20211105093847.urtlztspddvlmahz@oneshade "C-family selftests in language-independant source files", do you know how to proceed or would like me to look into it at this point? (No worries, of course, if you've just not yet gotten around to continuing that.)

@CohenArthur
Copy link
Member Author

Hi @tschwinge ! Thanks for offering your help :D I think I know how to proceed, or at least where to start, but I haven't gotten around to it. Thanks for the review, I'll fix up that commit

@philberty philberty linked an issue Dec 8, 2021 that may be closed by this pull request
@CohenArthur CohenArthur force-pushed the use-selftest branch 5 times, most recently from 132d238 to 777d1d2 Compare January 25, 2022 21:31
@CohenArthur CohenArthur marked this pull request as ready for review January 26, 2022 08:34
@CohenArthur
Copy link
Member Author

I think it should be good now @tschwinge @philberty :) I'll add some unit tests for the base 62 code as a starting point

@philberty
Copy link
Member

nice work @CohenArthur this is something I am really excited about! :D

@philberty
Copy link
Member

As far as i can tell this looks good but I am not sure about the final commit 777d1d2 do we need to touch this or can we drop it?

@tschwinge tschwinge self-assigned this Jan 26, 2022
@tschwinge
Copy link
Member

Great; I'll have a look.

@CohenArthur
Copy link
Member Author

As far as i can tell this looks good but I am not sure about the final commit 777d1d2 do we need to touch this or can we drop it?

The last commit is "extremely important" as it prevents our selftests from running some C specific selftests which we obviously fail. This is the commit that fixes what David Malcolm was suggesting over on the gcc mailing list

@dkm
Copy link
Member

dkm commented Jan 27, 2022

As far as i can tell this looks good but I am not sure about the final commit 777d1d2 do we need to touch this or can we drop it?

The last commit is "extremely important" as it prevents our selftests from running some C specific selftests which we obviously fail. This is the commit that fixes what David Malcolm was suggesting over on the gcc mailing list

Should this be sent upstream instead ? If that was suggested by David, that should be easy to have it merged ?

Copy link
Member

@tschwinge tschwinge left a comment

Choose a reason for hiding this comment

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

We're getting there! :-)

gcc/rust/rust-lang.cc Show resolved Hide resolved
gcc/rust/util/rust-base62.cc Outdated Show resolved Hide resolved
.github/workflows/ccpp.yml Outdated Show resolved Hide resolved
gcc/c/c-lang.c Outdated Show resolved Hide resolved
gcc/rust/rust-lang.cc Outdated Show resolved Hide resolved
gcc/c-family/c-common.h Outdated Show resolved Hide resolved
@CohenArthur
Copy link
Member Author

@tschwinge Thanks a lot for the review and offer to help getting one commit upstream. @dkm I think this commit should definitely be sent upstream and I'll start looking into it!

@CohenArthur CohenArthur requested a review from tschwinge January 28, 2022 13:25
@CohenArthur CohenArthur force-pushed the use-selftest branch 2 times, most recently from 87bd1ba to bc47ace Compare February 5, 2022 15:01
@CohenArthur
Copy link
Member Author

Commits have been fixed-up as talked about during the jitsi call :)

Copy link
Member

@tschwinge tschwinge left a comment

Choose a reason for hiding this comment

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

... and my response simply is:

bors: merge

@bors
Copy link
Contributor

bors bot commented Feb 5, 2022

Build succeeded:

@bors bors bot merged commit 2423c89 into Rust-GCC:master Feb 5, 2022
@tschwinge
Copy link
Member

As far as i can tell this looks good but I am not sure about the final commit 777d1d2 do we need to touch this or can we drop it?

The last commit is "extremely important" as it prevents our selftests from running some C specific selftests which we obviously fail. This is the commit that fixes what David Malcolm was suggesting over on the gcc mailing list

Should this be sent upstream instead ? If that was suggested by David, that should be easy to have it merged ?

🎉 This has recently been pushed (commit 9815244 "selftest: Move C-specific tests to c_family" -- @CohenArthur's first in GCC upstream!), and I'm working on another #247 merge, and then also resolve any local divergence we may have in these selftest files. (..., but first need to resolve some other GCC/Rust local breakage re *.opt files; stay tuned...)

@CohenArthur CohenArthur deleted the use-selftest branch March 24, 2022 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable GCC SelfTest Framework
4 participants