فهرست منبع

document windows build, mock setup, testing

Mike 2 سال پیش
والد
کامیت
ca841d0a1c
1فایلهای تغییر یافته به همراه47 افزوده شده و 7 حذف شده
  1. 47 7
      docs/BUILD.md

+ 47 - 7
docs/BUILD.md

@@ -1,12 +1,24 @@
 # Development: How to Run/Compile Retro AIM Server
 
-This document explains how to Build Retro AIM Server.
+This guide explains how to set up a development environment for Retro AIM Server and build/run the application. It
+assumes that you have little to no experience with golang.
 
 ## Dependencies
 
+Before you can run Retro AIM Server, set up the following software dependencies.
+
+### Golang
+
+Since Retro AIM Server is written in go, install the latest version of [golang](https://go.dev/).
+
+If you're new to go, try [Visual Studio Code](https://code.visualstudio.com) wth the
+[go plugin](https://code.visualstudio.com/docs/languages/go) as your first IDE.
+
+### C Compiler
+
 A C compiler is required in order to build the sqlite dependency.
 
-**macOS**
+#### macOS
 
 > If you have git, this is likely already set up on your machine.
 
@@ -14,18 +26,35 @@ A C compiler is required in order to build the sqlite dependency.
 xcode-select --install
 ```
 
-**Linux (Ubuntu)**
+#### Linux (Ubuntu)
 
 ```shell
 sudo apt install build-essential
 ```
 
-Retro AIM Server requires [go 1.21](https://go.dev/) or newer to run.
+#### Windows
+
+Install the [tdm-gcc compiler](https://jmeubank.github.io/tdm-gcc/).
+
+### Mockery (optional)
+
+[Mockery](https://github.com/vektra/mockery) is used to generate test mocks. Install this dependency and regenerate the
+mocks if you change any interfaces.
+
+```shell
+go install github.com/vektra/mockery/v2@latest
+```
+
+Run the following command in a terminal from the root of the repository in order to regenerate test mocks,
+
+```shell
+mockery
+```
 
 ## Run the Server
 
-To run Retro AIM Server without building a binary, run the following script. The default settings can be modified
-in `config/settings.env`.
+To run the server using `go run`, run the following script from the root of the repository. The default settings can be
+modified in `config/settings.env`.
 
 ```shell
 scripts/run_dev.sh
@@ -33,13 +62,24 @@ scripts/run_dev.sh
 
 ## Build the Server
 
+To build the server binary:
+
 ```shell
 go build -o retro_aim_server ./cmd/server
 ```
 
-To run:
+To run the binary with the settings file:
 
 ```shell
 source config/settings.env
 ./retro_aim_server
 ```
+
+## Testing
+
+Retro AIM Server includes a test suite that must pass before merging new code. To run the unit tests, run the following
+command from the root of the repository in a terminal:
+
+```shell
+go test -race ./...
+```