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 cases that interact with conditional compilation #56

Open
35 tasks
LegalizeAdulthood opened this issue Dec 12, 2018 · 1 comment
Open
35 tasks

Comments

@LegalizeAdulthood
Copy link
Owner

Conditional compilation is just a fact of life in C++. However, lots of refactoring tools can't see into all the alternatives of a conditional compiled block of code. Add tests for refactorings that exercise conditionally compiled code.

  • Add Block Delimiter
  • Add Override
  • Add Parameter
  • Change Signature
  • Create Overload
  • Create Setter Method
  • Extract Constant
  • Extract Function
  • Extract Method
  • Extract Parameter
  • Extract Variable
  • Flatten Conditional
  • Inline Macro
  • Inline Recent Assignment
  • Inline Result
  • Inline Variable
  • Make Method Static
  • Move Implementation to Source File
  • Move Method
  • Optimize Namespace References
  • Remove Block Delimiter
  • Remove Unused Parameter
  • Rename
  • Reorder Parameters
  • Replace If With Ternary
  • Replace Iterative For With Range For
  • Replace NULL/0 with nullptr
  • Replace String Literal with Raw String Literal
  • Replace Ternary With If
  • Replace Type With Auto
  • Replace auto_ptr With unique_ptr
  • Reverse Conditional
  • Simplify Boolean Expression
  • Split Initialization From Declaration
  • Split Multi-Variable Declaration
@LegalizeAdulthood
Copy link
Owner Author

Idea for how to add this to the existing suite:

  1. Use a CMake variable to define the conditionally compiled variant
  2. Create variant targets for the test case libraries and the test suite executable
  3. Use a variant configuration headers (e.g. config.h) in two different directories to define the two variants.
  4. Use the CMake variable to adjust the include search location to select one of the two variants.
  5. Add #ifdef preprocessor directives to source files to identify variant cases.

LegalizeAdulthood added a commit that referenced this issue Jan 14, 2024
The use case was about code that is currently ifdef'ed out.  Rather than
address this a single test case in Create Setter Method, a more
comprehensive test series is needed.  See issue #56.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant