Skip to content

Commit 6201a1d

Browse files
Merge branch 'master' into workgroup_scan
2 parents 97470a1 + 384fd27 commit 6201a1d

File tree

9 files changed

+535
-20
lines changed

9 files changed

+535
-20
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,6 @@
9393
[submodule "3rdparty/boost/preprocessor"]
9494
path = 3rdparty/boost/preprocessor
9595
url = [email protected]:Devsh-Graphics-Programming/preprocessor.git
96+
[submodule "tests"]
97+
path = tests
98+
url = [email protected]:Devsh-Graphics-Programming/Nabla-Continous-Integration-Python-Framework.git

CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Copyright (C) 2018-2020 - DevSH Graphics Programming Sp. z O.O.
22
# This file is part of the "Nabla Engine".
33
# For conditions of distribution and use, see copyright notice in nabla.h.in or nabla.h
4+
45
cmake_minimum_required(VERSION 3.26)
5-
#policies
66
cmake_policy(SET CMP0112 NEW)
7-
#
7+
88
set(NBL_BUILD_ANDROID OFF)
99

1010
include(ExternalProject)
@@ -55,6 +55,7 @@ endif()
5555

5656
get_filename_component(NBL_ROOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE)
5757
get_filename_component(NBL_ROOT_PATH_BINARY "${CMAKE_CURRENT_BINARY_DIR}" ABSOLUTE)
58+
get_filename_component(NBL_PYTHON_MODULE_ROOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/tests" ABSOLUTE)
5859
set(NBL_BUILTIN_RESOURCES_DIRECTORY_PATH "${NBL_ROOT_PATH}/include")
5960
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NBL_ROOT_PATH}/cmake" CACHE PATH "")
6061

@@ -317,11 +318,15 @@ option(NBL_BUILD_BULLET "Enable Bullet Physics building and integration?" OFF)
317318

318319
option(NBL_BUILD_DOCS "Enable building documentation?" OFF) # No one has doxygen installed, plus we dont know when was the last time we generated working doxy and we'll use SphinX in the future
319320

321+
option(NBL_ENABLE_PROJECT_JSON_CONFIG_VALIDATION "" ON)
320322
option(NBL_EMBED_BUILTIN_RESOURCES "Embed built-in resources?" ON)
321323

322324
set(THIRD_PARTY_SOURCE_DIR "${PROJECT_SOURCE_DIR}/3rdparty")
323325
set(THIRD_PARTY_BINARY_DIR "${PROJECT_BINARY_DIR}/3rdparty")
324326

327+
set(NBL_MEDIA_DIRECTORY "${PROJECT_SOURCE_DIR}/examples_tests/media")
328+
get_filename_component(NBL_MEDIA_DIRECTORY_ABS "${NBL_MEDIA_DIRECTORY}" ABSOLUTE)
329+
325330
option(NBL_UPDATE_GIT_SUBMODULE "Turn this ON to let CMake update all public submodules for you" ON)
326331
option(NBL_UPDATE_GIT_SUBMODULE_INCLUDE_PRIVATE "Turn this ON to attempt to update private Nabla submodules" OFF)
327332
find_package(Git REQUIRED)
@@ -332,6 +337,7 @@ NBL_UPDATE_SUBMODULES()
332337
add_subdirectory(${THIRD_PARTY_SOURCE_DIR})
333338

334339
add_subdirectory(src/nbl)
340+
add_subdirectory("${NBL_PYTHON_MODULE_ROOT_PATH}" tests) # Python Framework
335341

336342
if(NBL_BUILD_EXAMPLES)
337343
add_subdirectory(examples_tests)

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,41 @@ If you want to use git (without a submodule) then you can use `ExternalProject_A
344344

345345
I recommend you use `ExternalProject_Add` instead of `add_subdirectory` for **Nabla** as we haven't tested its use by *3rdparty* applications that use *CMake* to build themselves yet.
346346

347+
# Continuous integration
348+
349+
## Nabla Python Framework
350+
351+
### CPU & GPU local tests shipped with the repository
352+
353+
#### Description
354+
355+
***Nabla*** aims to implement full CPU & GPU tests used by our CI in-house infrastructure groovy pipelines in relocatable way allowing users to execute and debug the tests locally on their own devices as well. Each test is a Python module which part of it gets created with the CMake build system configuration. A test is defined and created as a module by
356+
357+
- top json configuration file
358+
- interface Python script
359+
360+
Top json configuration file contains run & build info, array of profiles and json inputs for a Python testing module. The file is processed and validated by CMake to create output profiles bound to the Python module. Single profile contains data used by the module to execute tests with and the implementation of the test is located in interface Python script - the script overrides common abstract interface defined as a integral part of Nabla Python framework module. The description is abstract and doesn't contain specific details, join our discord if you have any questions!
361+
362+
#### Development & Debug
363+
364+
Each valid Python module contains autogenerated .vscode's *launch.json* and *settings.json* to make development easy. You just need to `Open with Code`in the module's directory. Make sure to install [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) there to enable IntelliSense (Pylance), Linting, Debugging (multi-threaded, remote), code formatting, refactoring, unit tests, and more.
365+
366+
A target for which Python module is available for testing lists a special Python Framework section located in its solution's project file structure (**Visual Studio only!**) containing Nabla Python Framework sources, target's interface Python script, autogenerated json profiles and autogenerated` __main__.py` module script. Unfortunately pure Visual Studio works so-so with Python (issues with search module paths defined as `searchPath` .pyproj's property, issues with IntelliSense and Debugging) - we encourage to use Visual Studio Code if you need to Debug an interface or develop it.
367+
368+
#### Runtime
369+
370+
##### Command line
371+
372+
To run all tests bound to a module with a command line you just need to execute `python3 -m <module_reference>`. You can also specify special arguments to have more control over the test execution, for more details see [template module script](https://github.com/Devsh-Graphics-Programming/Nabla-Continous-Integration-Python-Framework/blob/4f7a67a3fa9bb418bcb07fa2f7a5853e55b853c4/scripts/__main__.py.cmake)
373+
374+
##### Visual Studio
375+
376+
You need to open a target's solution. To launch all tests bound to a module a module's `__main__.py` file located in Python Framework section must be selected and `Debug -> Execute File in Python interactive` executed.
377+
378+
**Visual Studio Code**
379+
380+
You need to open module's directory as workspace with `Open with Code `, select `Run and Debug` icon, select `__main__.py` file and run it.
381+
347382
# Caveats and Particular Behaviour
348383

349384
## Hardcoded Caps

__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)