Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run nosetests with the Python interpreter (2 vs. 3) that was requeste… #984

Merged
merged 3 commits into from
Jul 18, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ endif ()
################################################################################

# needed for target doc and fulldoc
find_program( NOSETESTS NAMES nosetests )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!
Can you please remove the comment above as that seems outdated and not very helpful anyway.

find_package( Doxygen )
find_program( SED NAMES sed gsed )

Expand Down
4 changes: 2 additions & 2 deletions testsuite/do_tests.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -724,13 +724,13 @@ if test "x${TEST_PYNEST}" = xtrue ; then
# of support for nosetests. We use the TEST_OUTDIR as Python-free
# dummy directory to search for tests.

if command -v nosetests >/dev/null 2>&1 && nosetests --with-xunit --xunit-file=/dev/null --where=${TEST_OUTDIR} >/dev/null 2>&1; then
if command -v @NOSETESTS@ >/dev/null 2>&1 && @NOSETESTS@ --with-xunit --xunit-file=/dev/null --where=${TEST_OUTDIR} >/dev/null 2>&1; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line checks

  1. if the nosetests executable is available (command -v yields the same as which, but is more portable) and
  2. if it can be run successfully using the options we are using below in line 733
    I think that 2. should also use the correct Python to be meaningful


echo
echo " Using nosetests."
echo

nosetests -v --with-xunit --xunit-file=${TEST_OUTDIR}/pynest_tests.xml ${NEST_PYTHON_PREFIX:-@CMAKE_INSTALL_PREFIX@/@PYEXECDIR@}/nest/tests ${NEST_PYTHON_PREFIX:-@CMAKE_INSTALL_PREFIX@/@PYEXECDIR@}/nest/topology/tests 2>&1 \
@PYTHON@ @NOSETESTS@ -v --with-xunit --xunit-file=${TEST_OUTDIR}/pynest_tests.xml ${NEST_PYTHON_PREFIX:-@CMAKE_INSTALL_PREFIX@/@PYEXECDIR@}/nest/tests ${NEST_PYTHON_PREFIX:-@CMAKE_INSTALL_PREFIX@/@PYEXECDIR@}/nest/topology/tests 2>&1 \
| tee -a "${TEST_LOGFILE}" | grep -i --line-buffered "\.\.\. ok\|fail\|skip\|error" | sed 's/^/ /'

PYNEST_TEST_TOTAL="$( tail -n 3 ${TEST_LOGFILE} | grep Ran | cut -d' ' -f2 )"
Expand Down