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: README.md
+35-1Lines changed: 35 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
6
6
-----
7
7
8
-
###Welcome to the **nanoFramework** Base Class Library repository!
8
+
# Welcome to the **nanoFramework** Base Class Library repository!
9
9
10
10
## Build status
11
11
@@ -20,6 +20,40 @@
20
20
21
21
The **nanoFramework** Base Class Library is provided in two flavours: with or without support for System.Reflection namespace. The reason for this is that the reflection API adds up a significant size to the DLL and image size. For targets with smaller flash this can be prohibitive.
22
22
23
+
## Unit Test
24
+
25
+
nanoFramework has a dedicated [Unit Test framework](https://github.com/nanoframework/nanoFramework.TestFramework). This repository has Unit Test and you will find all of them under the `Tests`folder. The main solution embed all all the tests as well. You can run them directly from Visual Studio and create new tests. For more information on the [Unit Test Framework](https://docs.nanoframework.net/content/unit-test/index.html).
26
+
27
+
lib-CoreLibrary has specific needs that differ from what you'll find in the documentation:
28
+
29
+
- You need to have th nanoFramework.TestFramework as a nuget package as it will bring the nanoCLR Win32 emulator
30
+
- You need to remove the reference to mscorlib, nanoFramework.TestFramework and nanoFramework.UnitTestLauncher
31
+
- Use project reference instead for all those 3 elements
32
+
33
+
You can then run the test either on a real device, either in the emulator as described in the documentation. You may have to manually flash your device for the mscorlib version to match the one you are building on.
34
+
35
+
**Important**: Any new code checked in this repository will have to:
36
+
37
+
- have a proper test covering for all the methods, properties, events and the possible exceptions,
38
+
- do not break more of the the existing tests meaning, in other words, it should not create more issues than already existing.
39
+
40
+
### Test structure and project reference
41
+
42
+
All the projects are referenced based and to be able to run the tests in the pipeline, in command line and in Visual Studio, it does require a specific structure:
43
+
44
+
- The `NFUnitTestAdapter` project must be present and untouched. It does contains the core elements needed to have the nanoCLR Win32 application present.
45
+
- You need to have a `nano.runsettings` file in each sub directory you want to run the tests on from Visual Studio
46
+
- If you want to run the tests in command line you have to use the `Developer Command Prompt for VS 2019` then you can use from the home cloned lib-CoreLibrary directory a command line like this one:
- You have to build the TestAdapter from the source in this case. You can use the path to the nuget as well, this will have the same effect.
55
+
- you have full diagnostic enabled in this case.
56
+
23
57
## Feedback and documentation
24
58
25
59
For documentation, providing feedback, issues and finding out how to contribute please refer to the [Home repo](https://github.com/nanoframework/Home).
0 commit comments