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

Update Documentation: Add MacOS with Make instructions for Exercism CLI #930

Merged
merged 3 commits into from
Dec 29, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion docs/TESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ code using the appropriate command for your environment:
* Linux with make: `make`
* Windows with Visual Studio: Select Build / Build Solution from the menu.
* MacOS with Xcode: Select Build from the toolbar
* MacOS with "Unix Makefile": `make` _If using the exercism CLI app_

Examples of running CMake for different environments are shown below.

Expand Down Expand Up @@ -105,4 +106,24 @@ Please download and install Xcode via the App Store or via [this link][web-xcode
Errors similar to `The CXX compiler identification is unknown` will likely be resolved by following the [instructions to install GCC][cpp-installation-instructions] or by adding another target in Xcode as per the above paragraph.

[web-xcode-download]: https://apps.apple.com/us/app/xcode/id497799835?mt=12
[cpp-installation-instructions]: https://exercism.org/docs/tracks/cpp/installation
[cpp-installation-instructions]: https://exercism.org/docs/tracks/cpp/installation

### MacOS with Make _when using the Exercism CLI_
#### This example specifically assists those who want to use the Exercism CLI app for configuring, testing, and submitting their C++ exercises.

The generator name for CMake is `Unix Makefiles`.
neenjaw marked this conversation as resolved.
Show resolved Hide resolved
Assuming the current exercise is `bob` and we're in the exercise folder:

```sh
$ touch bob.{h,cpp}
$ cmake -G "Unix Makefiles" .
$ exercism test
```

In this example, we do create empty files for the implementation before running CMake, but we do **not** create an empty build directory.
This is because the Exercism CLI uses the `.exercism/metadata.json` file in the root directory to parse the test cases.

Simply type `exercism test` in the root directory to compile the tests. This should generate compile-time errors.
Once the errors are fixed, running `exercism test` again will build and execute the tests using the Exercism CLI.

[cpp-installation-instructions]: https://exercism.org/docs/tracks/cpp/installation