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

[Refactor]: Remove underscore in C++ test suite names and test names #309

Closed
1 task done
Bai-Li-NOAA opened this issue Mar 13, 2023 · 2 comments
Closed
1 task done
Labels
attribute: low hanging 🍎 Easy to knock off in less than 1 day kind: test case Testing of the software P2 mid-level priority
Milestone

Comments

@Bai-Li-NOAA
Copy link
Contributor

Refactor request

We should rename GoogleTest test suite names and test names without using underscore (_). GoogleTest reserves underscore for special purpose keywords. For example, the two tests below will both generate the same class (Time_Flies_Like_An_Arrow_Test) when using underscore. More details can be found in GoogleTest FAQ page.

TEST(Time, Flies_Like_An_Arrow) { ... }
TEST(Time_Flies, Like_An_Arrow) { ... }

Expected behavior

Test suite names and test names must be non-empty, unique, and may only contain ASCII alphanumeric characters. Use Camel case for names.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Bai-Li-NOAA Bai-Li-NOAA added the status: triage_needed This is not approved for this milestone, do not work on it yet label Mar 13, 2023
@ChristineStawitz-NOAA ChristineStawitz-NOAA added kind: test case Testing of the software and removed status: triage_needed This is not approved for this milestone, do not work on it yet labels Mar 14, 2023
@ChristineStawitz-NOAA ChristineStawitz-NOAA added this to the MQ milestone Mar 14, 2023
@ChristineStawitz-NOAA ChristineStawitz-NOAA added the P2 mid-level priority label Jul 18, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA added the attribute: low hanging 🍎 Easy to knock off in less than 1 day label Oct 10, 2023
@kellijohnson-NOAA
Copy link
Contributor

Guidance on using TEST() from GoogleTest Primer indicates that the arguments for TEST() go from general to specific. The first argument is the name of the test suite, and the second argument is the test’s name within the test suite. Both names must be valid C++ identifiers, and they should not contain any underscores (_). A test’s full name consists of its containing test suite and its individual name. Tests from different test suites can have the same individual name.

@k-doering-NOAA
Copy link
Member

changes in main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
attribute: low hanging 🍎 Easy to knock off in less than 1 day kind: test case Testing of the software P2 mid-level priority
Projects
No open projects
Status: Done
Development

No branches or pull requests

6 participants