Skip to content

Commit

Permalink
Use Ninja-compatible syntax for passing TESTOPTS
Browse files Browse the repository at this point in the history
Ninja doesn't support passing environment as command line arguments
like make does, access TESTOPTS through environment instead of the
make syntax to make it work for both generators.
  • Loading branch information
pmatilai committed Feb 13, 2024
1 parent 81e500a commit 34cb5ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ if (MKTREE_BACKEND STREQUAL oci)
configure_file(${DOCKERFILE} Dockerfile COPYONLY)
add_custom_target(ci
COMMAND ./mktree.oci build
COMMAND ./mktree.oci check ${JOBS} $(TESTOPTS)
COMMAND ./mktree.oci check ${JOBS} $ENV{TESTOPTS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
else()
Expand Down Expand Up @@ -143,7 +143,7 @@ add_custom_target(shell
)

add_custom_target(check
COMMAND ./mktree check ${JOBS} $(TESTOPTS)
COMMAND ./mktree check ${JOBS} $ENV{TESTOPTS}
DEPENDS tree
)

Expand Down
5 changes: 5 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ For all available options, see the output of the command:
By default, tests are executed in parallel using all available cores, pass a
specific `-jN` value to limit.

Note that when building with Ninja, TESTOPTS must be passed via the
environment (also works with make):

TESTOPTS="..." ninja check

## Interactive testing

To drop into an interactive GNU Autotest shell, run:
Expand Down

0 comments on commit 34cb5ee

Please sign in to comment.