Skip to content

Commit

Permalink
Add downstream tests to tmt
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
  • Loading branch information
LecrisUT committed Aug 14, 2023
1 parent 830fe2a commit d96098f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/examples/downstream/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
environment:
HAS_PYTEST: true
2 changes: 2 additions & 0 deletions docs/examples/downstream/nanobind_example/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
summary:
Nanobind downstream example
2 changes: 2 additions & 0 deletions docs/examples/downstream/pybind11_example/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
summary:
Pybind downstream example
10 changes: 8 additions & 2 deletions docs/examples/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,21 @@ rlJournalStart
tmt_root=${TMT_SOURCE_DIR}/scikit_build_core-*
fi
rlRun "rsync -r ${tmt_root}$TMT_TEST_NAME/ $tmp" 0 "Copy example project"
rlRun "rsync -r ${tmt_root}/docs/examples/getting_started/test.py $tmp" 0 "Copy test.py file"
if [ "${HAS_PYTEST}" != True ]; then
rlRun "rsync -r ${tmt_root}/docs/examples/getting_started/test.py $tmp" 0 "Copy test.py file"
fi
rlRun "pushd $tmp"
rlRun "tree" 0 "Show directory tree"
rlRun "set -o pipefail"
rlPhaseEnd

rlPhaseStartTest
rlRun "pip install . --config-settings=cmake.verbose=true --no-index" 0 "Build the python project"
rlRun "python3 test.py" 0 "Test project is installed correctly"
if [ "${HAS_PYTEST}" == True ]; then
rlRun "pytest" 0 "Run built-in pytest"
else
rlRun "python3 test.py" 0 "Test project is installed correctly"
fi
rlPhaseEnd

rlPhaseStartCleanup
Expand Down

0 comments on commit d96098f

Please sign in to comment.