Skip to content

Commit 1697db1

Browse files
committed
WIP: testin sphinx build + artifacts x8
1 parent dc0992c commit 1697db1

File tree

2 files changed

+25
-32
lines changed

2 files changed

+25
-32
lines changed

doc/conf.py

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,41 +37,25 @@
3737
import os
3838
import sys
3939

40+
# -- Dlls/pyd imports ---------------------------------------------------------
4041
# import package's modules path and dlls/pyds, checking for import of pybind module
4142
extra_dll_dir_doc = os.path.abspath('./')
4243
extra_dll_dir_pysource = os.path.abspath('./../src/gh/diffCheck')
4344

4445
os.add_dll_directory(extra_dll_dir_doc) # For finding DLL dependencies on Windows
4546
sys.path.insert(0, extra_dll_dir_doc)
4647
sys.path.insert(0, extra_dll_dir_pysource)
47-
try:
48-
import diffCheck.diffcheck_bindings as dfb
49-
except ImportError as e:
50-
print(f"Failed to import diffcheck_bindings: {e}")
51-
print("Current sys.path directories:")
52-
for path in sys.path:
53-
print(path)
54-
print("Current files in the directory:")
55-
for file in os.listdir(extra_dll_dir_doc):
56-
print(file)
57-
sys.exit(1)
58-
59-
# import diffCheck
60-
# print(f"Current diffCheck imported: {diffCheck.__version__}")
61-
62-
63-
64-
# # Workaround to avoid expanding type aliases. See:
65-
# # https://github.com/sphinx-doc/sphinx/issues/6518#issuecomment-589613836
66-
# from typing import ForwardRef
67-
68-
# def _do_not_evaluate_in_diffCheck(
69-
# self, globalns, *args, _evaluate=ForwardRef._evaluate,
70-
# ):
71-
# if globalns.get('__name__', '').startswith('diffCheck'):
72-
# return self
73-
# return _evaluate(self, globalns, *args)
74-
# ForwardRef._evaluate = _do_not_evaluate_in_diffCheck
48+
# try:
49+
# import diffCheck.diffcheck_bindings as dfb
50+
# except ImportError as e:
51+
# print(f"Failed to import diffcheck_bindings: {e}")
52+
# print("Current sys.path directories:")
53+
# for path in sys.path:
54+
# print(path)
55+
# print("Current files in the directory:")
56+
# for file in os.listdir(extra_dll_dir_doc):
57+
# print(file)
58+
# sys.exit(1)
7559

7660
# -- Project information -----------------------------------------------------
7761

doc/testing.md renamed to doc/testing.rst

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
(test_guide)=
2-
# Test guide
1+
2+
.. _test_guide:
3+
4+
Testing
5+
=======
36

47
In df we use `CTest` as a test framework managed by Cmake in the file `cmake/tests.cmake` to run:
58
* [c++](cpp_test) tests with `GoogleTest`, and
69
* [python](py_test) in `PyTest`.
710

811
Tests are in the `tests` folder, and here's its structure:
12+
913
```terminal
1014
F:\DIFFCHECK\TESTS
1115
│ allCppTests.cc
@@ -41,9 +45,14 @@ cmake --build build --config Release
4145
(py_test)=
4246
## Write Python tests
4347

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.
48+
To write a test, you need to create a new file in the `tests/integration_tests` folder. Write a new `.py` test file if you are not contributing to an already existing test, and add it in the `cmake/tests.cmake` in the `add_test` function.
4549
e.g.:
46-
https://github.com/diffCheckOrg/diffCheck/blob/e080a93cdd73d96efb0686f80bf13730e0b8efa3/cmake/tests.cmake#L45-L48
50+
```cmake
51+
add_test(NAME PYBIND_UNIT_TEST
52+
COMMAND ${PYTHON_EXECUTABLE} -m pytest ${CMAKE_CURRENT_SOURCE_DIR}/tests/integration_tests/pybinds_tests/test_pybind_units.py
53+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
54+
)
55+
```
4756

4857

4958
(cpp_test)=

0 commit comments

Comments
 (0)