From 9d3fd3b8cc14bf29d3a711433d2a8960f6835b91 Mon Sep 17 00:00:00 2001 From: Cal Date: Sun, 29 Dec 2024 10:46:41 +0900 Subject: [PATCH 1/3] 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. --- docs/TESTS.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/TESTS.md b/docs/TESTS.md index 3aebe9786..75201ee15 100644 --- a/docs/TESTS.md +++ b/docs/TESTS.md @@ -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. @@ -105,4 +106,25 @@ 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 \ No newline at end of file +[cpp-installation-instructions]: https://exercism.org/docs/tracks/cpp/installation + +### Mac OS with Make _when using the exercise CLI_ +#### This example will specifically assist those who want to use the Exercism CLI app for configuring, testing and submitting their CPP examples. + +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 not create empty files for the implementation before +running CMake. This is because the Exercism CLI uses the `.exercism/metadata.json` file in the root directory to parse the test + +Simply type `exercism test` in the root directory to compile the tests. This should +generate compile time errors. Once the errors are fixed, `exercism test` will build and +run the tests using the exercism CLI. + +[cpp-installation-instructions]: https://exercism.org/docs/tracks/cpp/installation From 773ad88973dda59f218d087a5f3d418ebb2abee7 Mon Sep 17 00:00:00 2001 From: Cal Date: Sun, 29 Dec 2024 11:04:30 +0900 Subject: [PATCH 2/3] Updated formatting, spelling and grammar for the additions for the Mac OS testing. --- docs/TESTS.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/TESTS.md b/docs/TESTS.md index 75201ee15..7c2419aa5 100644 --- a/docs/TESTS.md +++ b/docs/TESTS.md @@ -108,10 +108,10 @@ Errors similar to `The CXX compiler identification is unknown` will likely be re [web-xcode-download]: https://apps.apple.com/us/app/xcode/id497799835?mt=12 [cpp-installation-instructions]: https://exercism.org/docs/tracks/cpp/installation -### Mac OS with Make _when using the exercise CLI_ -#### This example will specifically assist those who want to use the Exercism CLI app for configuring, testing and submitting their CPP examples. +### 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`. +The generator name for CMake is `Unix Makefiles`. Assuming the current exercise is `bob` and we're in the exercise folder: ```sh @@ -120,11 +120,10 @@ $ cmake -G "Unix Makefiles" . $ exercism test ``` -In this example we do not create empty files for the implementation before -running CMake. This is because the Exercism CLI uses the `.exercism/metadata.json` file in the root directory to parse the 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, `exercism test` will build and -run the tests using the exercism CLI. +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 From 03787bde97580f7dc6b65bbdd243ab32f6f03915 Mon Sep 17 00:00:00 2001 From: Tim Austin Date: Sun, 29 Dec 2024 00:35:18 -0600 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Victor Goff --- docs/TESTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/TESTS.md b/docs/TESTS.md index 7c2419aa5..829b516ef 100644 --- a/docs/TESTS.md +++ b/docs/TESTS.md @@ -111,7 +111,7 @@ Errors similar to `The CXX compiler identification is unknown` will likely be re ### 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`. +The generator name for CMake is `Unix Makefiles`. Assuming the current exercise is `bob` and we're in the exercise folder: ```sh