Skip to content

Commit d9bf574

Browse files
wxiaoguangStelios Malathouras
authored and
Stelios Malathouras
committed
Improve document for developers: Windows CGO, unit test option (go-gitea#18140)
1 parent bd8f8b8 commit d9bf574

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

docs/content/doc/developers/hacking-on-gitea.en-us.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ One of these three distributions of Make will run on Windows:
7373
- MSYS2 is a collection of tools and libraries providing you with an easy-to-use environment for building, installing and running native Windows software, it includes MinGW-w64.
7474
- In MingGW-w64, the binary is called `mingw32-make.exe` instead of `make.exe`. Add the `bin` folder to `PATH`.
7575
- In MSYS2, you can use `make` directly. See [MSYS2 Porting](https://www.msys2.org/wiki/Porting/).
76+
- To compile Gitea with CGO_ENABLED (eg: SQLite3), you might need to use [tdm-gcc](https://jmeubank.github.io/tdm-gcc/) instead of MSYS2 gcc, because MSYS2 gcc headers lack some Windows-only CRT functions like `_beginthread`.
7677
- [Chocolatey package](https://chocolatey.org/packages/make). Run `choco install make`
7778

7879
**Note**: If you are attempting to build using make with Windows Command Prompt, you may run into issues. The above prompts (Git bash, or MinGW) are recommended, however if you only have command prompt (or potentially PowerShell) you can set environment variables using the [set](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/set_1) command, e.g. `set TAGS=bindata`.
@@ -273,10 +274,17 @@ make test-sqlite-migration # with SQLite switched for the appropriate database
273274

274275
There are two types of test run by Gitea: Unit tests and Integration Tests.
275276

277+
### Unit Tests
278+
279+
Unit tests are covered by `*_test.go` in `go test` system.
280+
You can set environment variable `GITEA_UNIT_TESTS_VERBOSE=1` to see detail logs during the test.
281+
276282
```bash
277283
TAGS="bindata sqlite sqlite_unlock_notify" make test # Runs the unit tests
278284
```
279285

286+
### Integration Tests
287+
280288
Unit tests will not and cannot completely test Gitea alone. Therefore, we
281289
have written integration tests; however, these are database dependent.
282290

@@ -288,10 +296,12 @@ will run the integration tests in an SQLite environment. Integration tests
288296
require `git lfs` to be installed. Other database tests are available but
289297
may need adjustment to the local environment.
290298

291-
Look at
292-
[`integrations/README.md`](https://github.com/go-gitea/gitea/blob/main/integrations/README.md)
299+
Take a look at [`integrations/README.md`](https://github.com/go-gitea/gitea/blob/main/integrations/README.md)
293300
for more information and how to run a single test.
294301

302+
303+
### Testing for a PR
304+
295305
Our continuous integration will test the code passes its unit tests and that
296306
all supported databases will pass integration test in a Docker environment.
297307
Migration from several recent versions of Gitea will also be tested.

0 commit comments

Comments
 (0)