Skip to content

Commit 66c8cdc

Browse files
cbullard-devneenjawkotp
authored
Update Documentation: Add MacOS with Make instructions for Exercism CLI (#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 <keeperotphones@gmail.com> --------- Co-authored-by: Tim Austin <tim@neenjaw.com> Co-authored-by: Victor Goff <keeperotphones@gmail.com>
1 parent acc3255 commit 66c8cdc

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

docs/TESTS.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ code using the appropriate command for your environment:
5454
* Linux with make: `make`
5555
* Windows with Visual Studio: Select Build / Build Solution from the menu.
5656
* MacOS with Xcode: Select Build from the toolbar
57+
* MacOS with "Unix Makefile": `make` _If using the exercism CLI app_
5758

5859
Examples of running CMake for different environments are shown below.
5960

@@ -105,4 +106,24 @@ Please download and install Xcode via the App Store or via [this link][web-xcode
105106
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.
106107

107108
[web-xcode-download]: https://apps.apple.com/us/app/xcode/id497799835?mt=12
108-
[cpp-installation-instructions]: https://exercism.org/docs/tracks/cpp/installation
109+
[cpp-installation-instructions]: https://exercism.org/docs/tracks/cpp/installation
110+
111+
### MacOS with Make _when using the Exercism CLI_
112+
#### This example specifically assists those who want to use the Exercism CLI app for configuring, testing, and submitting their C++ exercises.
113+
114+
The generator name for CMake is `Unix Makefiles`.
115+
Assuming the current exercise is `bob` and we're in the exercise folder:
116+
117+
```sh
118+
$ touch bob.{h,cpp}
119+
$ cmake -G "Unix Makefiles" .
120+
$ exercism test
121+
```
122+
123+
In this example, we do create empty files for the implementation before running CMake, but we do **not** create an empty build directory.
124+
This is because the Exercism CLI uses the `.exercism/metadata.json` file in the root directory to parse the test cases.
125+
126+
Simply type `exercism test` in the root directory to compile the tests. This should generate compile-time errors.
127+
Once the errors are fixed, running `exercism test` again will build and execute the tests using the Exercism CLI.
128+
129+
[cpp-installation-instructions]: https://exercism.org/docs/tracks/cpp/installation

0 commit comments

Comments
 (0)