8000 contributing.md: Add build instructions by Lotterleben · Pull Request #1484 · catchorg/Catch2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

contributing.md: Add build instructions #1484

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

Merged
merged 2 commits into from
Jan 19, 2019

Conversation

Lotterleben
Copy link

Description

When looking into the contributing.md, I would’ve found it helpful to see at a glance how I can build and run the SelfTest binary correctly. This PR adds instructions for this.
Note that the instructions in this PR are what I came up with after some trial & error; if there’s a more elegant way to build the SelfTest binary I’d be more than happy to change the text accordingly :)

GitHub Issues

--

@Lotterleben
Copy link
Author
< 8000 p dir="auto">Whoops, I just noticed that my editor auto-removed existing trailing whitespace as well. I can undo this or move it into a new PR if you like.

@codecov
Copy link
codecov bot commented Jan 4, 2019

Codecov Report

Merging #1484 into master will decrease coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1484      +/-   ##
==========================================
- Coverage   80.42%   80.39%   -0.03%     
==========================================
  Files         121      121              
  Lines        3421     3426       +5     
==========================================
+ Hits         2751     2754       +3     
- Misses        670      672       +2

@codecov
Copy link
codecov bot commented Jan 4, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@61e1ea9). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master    #1484   +/-   ##
=========================================
  Coverage          ?   80.39%           
=========================================
  Files             ?      121           
  Lines             ?     3426           
  Branches          ?        0           
=========================================
  Hits              ?     2754           
  Misses            ?      672           
  Partials          ?        0

@horenmar
Copy link
Member

Thanks and don't worry about the whitespace changes.

* Compiling Catch's SelfTest project:
```
$ cd Catch2
$ cmake -Bcmake-build-debug -H. -DCATCH_BUILD_TESTING=ON
Copy link
Member

Choose a reason for hiding this comment

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

I have a small nitpick for this:

This doesn't actually configure the build to be done in the Debug configuration, even though the build folder is named that way. To have the build be configured for Debug, you need to add -DCMAKE_BUILD_TYPE=Debug.

Copy link
Member

Choose a reason for hiding this comment

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

Also, you don't need -DCATCH_BUILD_TESTING=ON, as it is the default and will remain that way.

$ cd Catch2
$ cmake -Bcmake-build-debug -H. -DCATCH_BUILD_TESTING=ON
$ cd cmake-build-debug/
$ make
Copy link
Member

Choose a reason for hiding this comment

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

This will only work for Unixish systems and not on Windows. To support Windows, the last two steps can be changed to cmake --build cmake-build-debug instead.

Also we support approvals through CTest now, so the building and testing can be done like so

cmake -Bcmake-build-debug -H. -DCMAKE_BUILD_TYPE=Debug
cmake --build cmake-build-debug
cd cmake-build-debug
ctest -C Debug --output-on-failure

The advantage of this approach is that it can be used without change on both Unixish systems and Windows.

The disadvantage is that to get better control, you need to familiarize yourself with another tool (CTest), so it is probably worth it to keep a separate guide for running the approval tests manually.

@horenmar horenmar force-pushed the extend_contributing branch from d08e35d to 2988e9f Compare January 19, 2019 12:05
@horenmar horenmar merged commit 4109870 into catchorg:master Jan 19, 2019
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.

3 participants
0