From 0dcfd3b15a016042ab2ab9bd57bb7c744adc590f Mon Sep 17 00:00:00 2001 From: pit-ray Date: Sun, 18 Feb 2024 17:33:11 +0900 Subject: [PATCH] add tests document in README --- CONTRIBUTING.md | 14 +------------- README.md | 35 +++++++++++++++++++++++++---------- tests/README.md | 2 +- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8238bd93..c07fde6a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -90,20 +90,8 @@ If you have already installed **MinGW-w64** or **Visual Studio**, all you need i ``` #### Run Test +See [here](../tests/README.md) for unit tests and runtime test. -##### Visual Studio - ```bash - $ cmake -B tests/build -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 17 2022" tests - $ cmake --build tests/build - $ cd tests/build ; ctest -C Debug ; cd ../.. - ``` - -##### MinGW-w64 >= GCC 11.2.0 - ```bash - $ cmake -B tests/build -DCMAKE_BUILD_TYPE=Debug -G "MinGW Makefiles" tests - $ cmake --build tests/build - $ cd tests/build ; ctest -C Debug ; cd ../.. - ``` #### Make Installer ```bash diff --git a/README.md b/README.md index eedaec46..1e74a253 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ It is also available from the command line as a command for UI operations like `
## Installation -We support a variety of installation methods. +win-vind supports a variety of installation methods. ### [Chocolatey](https://chocolatey.org/) @@ -144,26 +144,41 @@ For more information on default mappings, please visit our [website](https://pit -## How to build - -#### Debug +## Build +All you have to do is install [cmake](https://cmake.org/download/), [Visual Sudio](https://visualstudio.microsoft.com/ja/downloads/) and [Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/), then do the following. ```bash -$ cmake -B build . +$ cmake -B build $ cmake --build build $ ./build/Debug/win-vind.exe ``` -#### Release +If you want to build with MinGW or create an installer, see [here](https://github.com/pit-ray/win-vind/blob/master/CONTRIBUTING.md#to-development). + +## Test +Tests can be run using ctest and python. + +### Unit Test +Run source code level tests. ```bash -$ cmake -B build -DCMAKE_BUILD_TYPE=Release . -$ cmake --build build --config Release -$ ./build/Release/win-vind.exe +$ cd tests +$ cmake -B build unit +$ cmake --build build +$ ctest -C Debug --test-dir build --output-on-failure +$ cd .. ``` -If you want to build with MinGW or create an installer, see [here](https://github.com/pit-ray/win-vind/blob/master/CONTRIBUTING.md#to-development). +### Runtime Test +Runtime tests check the behavior of the built binaries. + +```bash +$ cd tests +$ python runtime/test.py "../bin_64/win-vind/win-vind.exe" # Specifies the binary for release. +$ cd .. +``` +See [this document](tests/README.md) for details. ## Contribute If you would like to contribute to win-vind, see [CONTRIBUTING.md](https://github.com/pit-ray/win-vind/blob/master/CONTRIBUTING.md). diff --git a/tests/README.md b/tests/README.md index 08a8f644..70a450f7 100644 --- a/tests/README.md +++ b/tests/README.md @@ -6,7 +6,7 @@ It are run using CTest at compile time. This is based on branch coverage. ### Visual Studio 2019 ```bash -$ cmake -B build_msvc -G "Visual Studio 16 2019" unit +$ cmake -B build_msvc -G "Visual Studio 17 2022" unit $ cmake --build build_msvc $ ctest -C Debug --test-dir build_msvc --output-on-failure ```