You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/cross-platform/matrix/1-foundations.md
+99-6Lines changed: 99 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,16 @@ Emacs](https://www.gnu.org/software/emacs/), or [Sublime
32
32
Text](https://www.sublimetext.com/), which are also popular and they all
33
33
support extensions that make C++ development easy.
34
34
35
+
## Source code
36
+
37
+
In case you want to, you can [download the source code](https://gitlab.arm.com/learning-code-examples/code-examples/-/archive/main/code-examples-main.tar.gz?path=learning-paths/cross-platform/matrix) for this learning path. This will download a `.tar.gz` archive that you will need to expand:
38
+
39
+
```BASH
40
+
tar xfz code-examples-main-learning-paths-cross-platform-matrix.tar.gz
The `add_library` instructs CMake how to build the Matrix library. The
246
335
`target_include_directories` specifies where the Matrix library header is located, and the `target_compile_features` specifies that C++17 is the version
@@ -301,3 +390,7 @@ For example, Visual Studio Code can work seamlessly with CMake with plugins, and
301
390
generate project files for several popular IDEs, such as Xcode, Sublime Text, Eclipse,
302
391
CodeBlocks, and CodeLite. You can run `cmake --help` to get a
303
392
list of supported *generators* (in CMake terminology) for your platform.
393
+
394
+
You can refer to this chapter source code in
395
+
`code-examples/learning-paths/cross-platform/matrix/chapter-1` in the archive that
Copy file name to clipboardExpand all lines: content/learning-paths/cross-platform/matrix/2-testing.md
+61-4Lines changed: 61 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ benefits:
17
17
- They offer an opportunity to catch regressions.
18
18
- They demonstrate how to use the library in practice.
19
19
- They create opportunities for those new to the project to easily check their patches, and verify that the introduction of the new code has not created unintended negative changes.
20
-
20
+
21
21
You will notice that setting up testing precedes library code development.
22
22
23
23
There are many unit testing frameworks available, and C++ is not short of them. See this [wikipedia
@@ -38,7 +38,38 @@ all external dependencies. It will be used by the main `CMakeLists.txt`.
38
38
39
39
Create the file `external/CMakeLists.txt` with the following content:
You might notice a new CMake feature: variables. Variables start with the `$` character and have a name inserted between curly braces. A CMake variable can be set by the CMake itself, or by the user, and they can be modified or used as they are.
44
75
@@ -235,11 +266,33 @@ several files inside the `tests/` directory.
235
266
236
267
Create the top-level test in `tests/main.cpp` and paste the following code into the file:
This test invokes `getVersion` and checks that the `major`, `minor` and `patch` levels match the expected values.
245
298
@@ -325,3 +378,7 @@ Matrix/
325
378
CMake makes it easy to use GoogleTest as an external project. Adding unit tests as you go is now easy.
326
379
327
380
You have created the unit testing environment for your Matrix library and added a test. The infrastructure is now in place to implement the core of the Matrix processing library.
381
+
382
+
You can refer to this chapter source code in
383
+
`code-examples/learning-paths/cross-platform/matrix/chapter-2` in the archive that
At this stage, the project should still build and compile, try it to confirm:
68
89
@@ -1045,3 +1066,7 @@ After this rather long exercise, you have a minimalistic, yet fully-functional c
1045
1066
Modern C++ enables you to express move and copy semantics, and to use smart pointers to make memory management easy.
1046
1067
1047
1068
The compiler also catch a large number of type or misuse errors. With this core functionality in place, you have all you need to implement matrix operations in the next section.
1069
+
1070
+
You can refer to this chapter source code in
1071
+
`code-examples/learning-paths/cross-platform/matrix/chapter-3` in the archive that
0 commit comments