automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[automake-commit] branch master updated: python: generalize tests.


From: Karl Berry
Subject: [automake-commit] branch master updated: python: generalize tests.
Date: Thu, 06 Jul 2023 21:27:46 -0400

This is an automated email from the git hooks/post-receive script.

karl pushed a commit to branch master
in repository automake.

View the commit online:
https://git.savannah.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=c5f08e89e062f977983cef8da6d0746456ac29d6

The following commit(s) were added to refs/heads/master by this push:
     new c5f08e89e python: generalize tests.
c5f08e89e is described below

commit c5f08e89e062f977983cef8da6d0746456ac29d6
Author: Bogdan <bogdro_rep@gmx.us>
AuthorDate: Thu Jul 6 18:27:36 2023 -0700

    python: generalize tests.
    
    This change finishes fixing https://bugs.gnu.org/30556.
    
    * t/python-prefix.sh: use $PYTHON if set, not hardwiring "python".
    * t/python-virtualenv.sh (get-pyexecdir): new make target;
    use it instead of hardwiring $py_site.
---
 t/python-prefix.sh     |  7 ++++++-
 t/python-virtualenv.sh | 10 ++++++----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/t/python-prefix.sh b/t/python-prefix.sh
index df15e4300..766f47258 100644
--- a/t/python-prefix.sh
+++ b/t/python-prefix.sh
@@ -43,7 +43,12 @@ echo-python-exec-prefix:
        @echo $(PYTHON_EXEC_PREFIX)
 END
 
-py_version=$(python -c 'import sys; print("%u.%u" % sys.version_info[:2])')
+if test -z "$PYTHON"; then
+  py_exec=python
+else
+  py_exec=$PYTHON
+fi
+py_version=$("$py_exec" -c 'import sys; print("%u.%u" % sys.version_info[:2])')
 py_inst_site=inst/lib/python$py_version/site-packages
 py_instexec_site=instexec/lib/python$py_version/site-packages
 
diff --git a/t/python-virtualenv.sh b/t/python-virtualenv.sh
index ae5d96ad6..b06964b90 100644
--- a/t/python-virtualenv.sh
+++ b/t/python-virtualenv.sh
@@ -100,6 +100,8 @@ test-run:
        python -c 'from am_foo import foo_func; assert (foo_func () == 12345)'
        python -c 'from am_virtenv import old_am; assert (old_am () == 
"AutoMake")'
 all-local: debug
+get-pyexecdir:
+       @echo $(pyexecdir)
 END
 
 cat > am_foo.py << 'END'
@@ -127,8 +129,8 @@ check_install ()
   py_installed "$py_site"/am_foo.pyc
   py_installed "$py_site"/am_virtenv/__init__.py
   py_installed "$py_site"/am_virtenv/__init__.pyc
-  test -f      "$py_site"/libquux.a
-  test -f      "$py_site"/am_virtenv/libzardoz.a
+  test -f      "$($MAKE get-pyexecdir ${1+"$@"})"/libquux.a
+  test -f      "$($MAKE get-pyexecdir ${1+"$@"})"/am_virtenv/libzardoz.a
 }
 
 check_uninstall ()
@@ -139,8 +141,8 @@ check_uninstall ()
   py_installed --not "$py_site"/am_foo.pyc
   test ! -e          "$py_site"/am_virtenv/__init__.py
   py_installed --not "$py_site"/am_virtenv/__init__.pyc
-  test ! -e          "$py_site"/libquux.a
-  test ! -e          "$py_site"/am_virtenv/libzardoz.a
+  test ! -e          "$($MAKE get-pyexecdir ${1+"$@"})"/libquux.a
+  test ! -e          "$($MAKE get-pyexecdir ${1+"$@"})"/am_virtenv/libzardoz.a
 }
 
 $ACLOCAL



reply via email to

[Prev in Thread] Current Thread [Next in Thread]