Skip to content

Commit dc0992c

Browse files
committed
WIP: testin sphinx build + artifacts x7
1 parent 416220c commit dc0992c

File tree

3 files changed

+52
-8
lines changed

3 files changed

+52
-8
lines changed

.github/workflows/documentation.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,6 @@ jobs:
5353
with:
5454
name: __build_artifacts__
5555
path: ${{ github.workspace }}/artifacts/*
56-
57-
# TODO: old
58-
# - name: Store the dlls/pyd as artifacts
59-
# uses: actions/upload-artifact@v2
60-
# with:
61-
# name: __build_artifacts__
62-
# path: ${{ github.workspace }}/artifacts/*
6356

6457

6558
build-docs:
@@ -104,6 +97,7 @@ jobs:
10497
- name: Sphinx build
10598
run: |
10699
conda run --name diff_check --no-capture-output sphinx-build doc _build
100+
working-directory: ${{github.workspace}}
107101

108102

109103
# page-deployement:

doc/.gitkeep

Whitespace-only changes.

doc/testing.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,54 @@
11
(test_guide)=
22
# Test guide
33

4-
/// how to do testing
4+
In df we use `CTest` as a test framework managed by Cmake in the file `cmake/tests.cmake` to run:
5+
* [c++](cpp_test) tests with `GoogleTest`, and
6+
* [python](py_test) in `PyTest`.
7+
8+
Tests are in the `tests` folder, and here's its structure:
9+
```terminal
10+
F:\DIFFCHECK\TESTS
11+
│ allCppTests.cc
12+
13+
├───integration_tests <-- mainly python interfaces
14+
│ ├───ghcomponents_tests <-- relative to gh components
15+
│ │ .gitkeep
16+
│ │
17+
│ ├───package_tests <-- relative to the pypi package
18+
│ │ .gitkeep
19+
│ │
20+
│ └───pybinds_tests <-- strictly pybinding
21+
│ │ diffCheck.dll
22+
│ │ diffcheck_bindings.cp39-win_amd64.pyd
23+
│ │ Open3D.dll
24+
│ │ test_pybind_pyver.py
25+
│ │ test_pybind_units.py
26+
27+
├───test_data <-- here is where we put some .ply data
28+
│ roof_quarter.ply
29+
30+
└───unit_tests <-- c++ backend, one for each header
31+
DFLog.cc
32+
DFPointCloudTest.cc
33+
```
34+
35+
To run the tests, you can use the following commands:
36+
```terminal
37+
cmake -S . -B build -A x64 -DBUILD_PYTHON_MODULE=ON -DBUILD_TESTS=ON -DRUN_TESTS=ON
38+
cmake --build build --config Release
39+
```
40+
41+
(py_test)=
42+
## Write Python tests
43+
44+
To write a test, you need to create a new file in the `tests/integration_tests` folder. Write a new `.py` test file and add it in the `cmake/tests.cmake` in the `add_test` function.
45+
e.g.:
46+
https://github.com/diffCheckOrg/diffCheck/blob/e080a93cdd73d96efb0686f80bf13730e0b8efa3/cmake/tests.cmake#L45-L48
47+
48+
49+
(cpp_test)=
50+
## Write C++ tests
51+
52+
To write a test, you need to create a new file in the `tests/unit_tests` folder. Next add your file in the executable `${CPP_UNIT_TESTS}` in the `cmake/tests.cmake`.
53+
e.g.:
54+
https://github.com/diffCheckOrg/diffCheck/blob/e080a93cdd73d96efb0686f80bf13730e0b8efa3/cmake/tests.cmake#L13-L17

0 commit comments

Comments
 (0)