Skip to content

Commit

Permalink
Update Documentation: Add MacOS with Make instructions for Exercism C…
Browse files Browse the repository at this point in the history
…LI (#930)

* Added a new section for using the exercism CLI to test the exercises
when running on Mac OS as. This should allow for new lerners of C++ to
be able to get up and running using the CLI without needing an IDE like
XCode setup and configured and be able to use the exercism tools
available.

* Updated formatting, spelling and grammar for the additions for the Mac
OS testing.

* Apply suggestions from code review

Co-authored-by: Victor Goff <[email protected]>

---------

Co-authored-by: Tim Austin <[email protected]>
Co-authored-by: Victor Goff <[email protected]>
  • Loading branch information
3 people authored Dec 29, 2024
1 parent acc3255 commit 66c8cdc
Showing 1 changed file with 22 additions and 1 deletion.
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`.
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

0 comments on commit 66c8cdc

Please sign in to comment.