Skip to content

Commit 833009b

Browse files
committed
Add minimalistic smoke flow and consumption reference
1 parent 6c23014 commit 833009b

3 files changed

Lines changed: 47 additions & 23 deletions

File tree

docs/consume/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,18 @@ Note:
182182
- this is a known issue on Nabla side and will be refactored
183183
- do not propagate that pattern to package consumers
184184
- consumer-facing package helpers are designed to avoid exposing absolute paths in consumer compile definitions
185+
186+
## 9. Smoke reference
187+
188+
`smoke/` is a reference consumer for Nabla package consumption.
189+
190+
It contains multiple usage flows:
191+
192+
- `MINIMALISTIC` link-only consumption without helper calls
193+
- `CONFIGURE_ONLY` helper-based configure-time runtime sync
194+
- `BUILD_ONLY` helper-based build-time runtime sync
195+
196+
Flow selection is done with `NBL_SMOKE_FLOW` in `smoke/CMakeLists.txt` and `FLOW` in `smoke/RunSmokeFlow.cmake`.
197+
198+
Smoke is also used as CI coverage for package consumption flows.
199+
The `smoke-tests` job in `.github/workflows/build-nabla.yml` runs those flows as end-to-end checks.

smoke/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ target_link_libraries(smoke PRIVATE Nabla::Nabla)
3232
target_compile_definitions(smoke PRIVATE _AFXDLL)
3333
target_precompile_headers(smoke PRIVATE pch.hpp)
3434

35-
set(NBL_SMOKE_FLOW "CONFIGURE_ONLY" CACHE STRING "Smoke runtime flow: CONFIGURE_ONLY or BUILD_ONLY")
36-
set_property(CACHE NBL_SMOKE_FLOW PROPERTY STRINGS CONFIGURE_ONLY BUILD_ONLY)
35+
set(NBL_SMOKE_FLOW "CONFIGURE_ONLY" CACHE STRING "Smoke runtime flow: MINIMALISTIC, CONFIGURE_ONLY or BUILD_ONLY")
36+
set_property(CACHE NBL_SMOKE_FLOW PROPERTY STRINGS MINIMALISTIC CONFIGURE_ONLY BUILD_ONLY)
3737
string(TOUPPER "${NBL_SMOKE_FLOW}" NBL_SMOKE_FLOW)
3838
message(STATUS "Smoke runtime flow: ${NBL_SMOKE_FLOW}")
3939
option(NBL_SMOKE_INSTALL_SELFTEST "Install smoke with CTest metadata and run tests from install tree" ON)
4040

41-
if(NBL_SMOKE_FLOW STREQUAL "CONFIGURE_ONLY")
41+
if(NBL_SMOKE_FLOW STREQUAL "MINIMALISTIC")
42+
message(STATUS "Smoke minimalistic flow uses only package default runtime lookup")
43+
elseif(NBL_SMOKE_FLOW STREQUAL "CONFIGURE_ONLY")
4244
nabla_setup_runtime_modules(
4345
TARGETS smoke
4446
RUNTIME_MODULES_SUBDIR "Libraries"

smoke/RunSmokeFlow.cmake

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
if(NOT DEFINED FLOW)
2-
message(FATAL_ERROR "FLOW is required. Allowed values: CONFIGURE_ONLY, BUILD_ONLY")
2+
message(FATAL_ERROR "FLOW is required. Allowed values: MINIMALISTIC, CONFIGURE_ONLY, BUILD_ONLY")
33
endif()
44

55
string(TOUPPER "${FLOW}" FLOW)
6-
if(NOT FLOW MATCHES "^(CONFIGURE_ONLY|BUILD_ONLY)$")
7-
message(FATAL_ERROR "Invalid FLOW='${FLOW}'. Allowed values: CONFIGURE_ONLY, BUILD_ONLY")
6+
if(NOT FLOW MATCHES "^(MINIMALISTIC|CONFIGURE_ONLY|BUILD_ONLY)$")
7+
message(FATAL_ERROR "Invalid FLOW='${FLOW}'. Allowed values: MINIMALISTIC, CONFIGURE_ONLY, BUILD_ONLY")
88
endif()
99

1010
if(NOT DEFINED CONFIG)
@@ -44,12 +44,17 @@ endfunction()
4444

4545
file(REMOVE_RECURSE "${BUILD_DIR}")
4646

47+
set(_run_install_selftest ON)
48+
if(FLOW STREQUAL "MINIMALISTIC")
49+
set(_run_install_selftest OFF)
50+
endif()
51+
4752
run_cmd(
4853
"${CMAKE_COMMAND}"
4954
-S "${SMOKE_SOURCE_DIR}"
5055
-B "${BUILD_DIR}"
5156
-D "NBL_SMOKE_FLOW=${FLOW}"
52-
-D "NBL_SMOKE_INSTALL_SELFTEST=ON"
57+
-D "NBL_SMOKE_INSTALL_SELFTEST=${_run_install_selftest}"
5358
)
5459

5560
run_cmd(
@@ -68,21 +73,23 @@ run_cmd(
6873
-C "${CONFIG}"
6974
)
7075

71-
file(REMOVE_RECURSE "${INSTALL_DIR}")
76+
if(_run_install_selftest)
77+
file(REMOVE_RECURSE "${INSTALL_DIR}")
7278

73-
run_cmd(
74-
"${CMAKE_COMMAND}"
75-
--install "${BUILD_DIR}"
76-
--config "${CONFIG}"
77-
--prefix "${INSTALL_DIR}"
78-
)
79+
run_cmd(
80+
"${CMAKE_COMMAND}"
81+
--install "${BUILD_DIR}"
82+
--config "${CONFIG}"
83+
--prefix "${INSTALL_DIR}"
84+
)
7985

80-
run_cmd(
81-
"${CTEST_BIN}"
82-
--verbose
83-
--test-dir "${INSTALL_DIR}"
84-
--force-new-ctest-process
85-
--output-on-failure
86-
--no-tests=error
87-
-C "${CONFIG}"
88-
)
86+
run_cmd(
87+
"${CTEST_BIN}"
88+
--verbose
89+
--test-dir "${INSTALL_DIR}"
90+
--force-new-ctest-process
91+
--output-on-failure
92+
--no-tests=error
93+
-C "${CONFIG}"
94+
)
95+
endif()

0 commit comments

Comments
 (0)