From b24b1e26e24f18c77035f4255dee90757b08365b Mon Sep 17 00:00:00 2001 From: David Barksdale Date: Fri, 30 Apr 2010 05:35:52 +0000 Subject: [PATCH] Move python test scripts to .py.in and sed in the correct python path. --- src/fs/Makefile.am | 29 +++++++++++++++---- ...net_fs_idx.py => test_gnunet_fs_idx.py.in} | 2 +- ...nunet_fs_ns.py => test_gnunet_fs_ns.py.in} | 2 +- ...net_fs_psd.py => test_gnunet_fs_psd.py.in} | 2 +- ...net_fs_rec.py => test_gnunet_fs_rec.py.in} | 2 +- src/peerinfo-tool/Makefile.am | 15 ++++++++-- ...peerinfo.py => test_gnunet_peerinfo.py.in} | 2 +- 7 files changed, 42 insertions(+), 12 deletions(-) rename src/fs/{test_gnunet_fs_idx.py => test_gnunet_fs_idx.py.in} (99%) rename src/fs/{test_gnunet_fs_ns.py => test_gnunet_fs_ns.py.in} (99%) rename src/fs/{test_gnunet_fs_psd.py => test_gnunet_fs_psd.py.in} (99%) rename src/fs/{test_gnunet_fs_rec.py => test_gnunet_fs_rec.py.in} (99%) rename src/peerinfo-tool/{test_gnunet_peerinfo.py => test_gnunet_peerinfo.py.in} (99%) diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am index d18d06dd7..e497f3e39 100644 --- a/src/fs/Makefile.am +++ b/src/fs/Makefile.am @@ -133,10 +133,6 @@ check_PROGRAMS = \ if HAVE_PYTHON_PEXPECT -TEST_EXTENSIONS = .py -PY_LOG_COMPILER = $(PYTHON) -AM_PY_LOG_FLAGS = -v - check_SCRIPTS = \ test_gnunet_fs_psd.py \ test_gnunet_fs_rec.py \ @@ -254,6 +250,24 @@ test_gnunet_service_fs_p2p_LDADD = \ $(top_builddir)/src/fs/libgnunetfs.la \ $(top_builddir)/src/util/libgnunetutil.la +do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g' + +test_gnunet_fs_psd.py: test_gnunet_fs_psd.py.in Makefile + $(do_subst) < $(srcdir)/test_gnunet_fs_psd.py.in > test_gnunet_fs_psd.py + chmod +x test_gnunet_fs_psd.py + +test_gnunet_fs_rec.py: test_gnunet_fs_rec.py.in Makefile + $(do_subst) < $(srcdir)/test_gnunet_fs_rec.py.in > test_gnunet_fs_rec.py + chmod +x test_gnunet_fs_rec.py + +test_gnunet_fs_ns.py: test_gnunet_fs_ns.py.in Makefile + $(do_subst) < $(srcdir)/test_gnunet_fs_ns.py.in > test_gnunet_fs_ns.py + chmod +x test_gnunet_fs_ns.py + +test_gnunet_fs_idx.py: test_gnunet_fs_idx.py.in Makefile + $(do_subst) < $(srcdir)/test_gnunet_fs_idx.py.in > test_gnunet_fs_idx.py + chmod +x test_gnunet_fs_idx.py + EXTRA_DIST = \ fs_test_lib_data.conf \ @@ -273,4 +287,9 @@ EXTRA_DIST = \ test_gnunet_fs_psd_data.conf \ test_gnunet_fs_rec_data.conf \ test_gnunet_fs_rec_data.tgz \ - $(check_SCRIPTS) + test_gnunet_fs_psd.py.in \ + test_gnunet_fs_rec.py.in \ + test_gnunet_fs_ns.py.in \ + test_gnunet_fs_idx.py.in + +CLEANFILES = $(check_SCRIPTS) diff --git a/src/fs/test_gnunet_fs_idx.py b/src/fs/test_gnunet_fs_idx.py.in similarity index 99% rename from src/fs/test_gnunet_fs_idx.py rename to src/fs/test_gnunet_fs_idx.py.in index 267d9f2a5..3bb3681c6 100755 --- a/src/fs/test_gnunet_fs_idx.py +++ b/src/fs/test_gnunet_fs_idx.py.in @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!@PYTHON@ # This file is part of GNUnet. # (C) 2010 Christian Grothoff (and other contributing authors) # diff --git a/src/fs/test_gnunet_fs_ns.py b/src/fs/test_gnunet_fs_ns.py.in similarity index 99% rename from src/fs/test_gnunet_fs_ns.py rename to src/fs/test_gnunet_fs_ns.py.in index 616b52a29..92fd7d5de 100755 --- a/src/fs/test_gnunet_fs_ns.py +++ b/src/fs/test_gnunet_fs_ns.py.in @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!@PYTHON@ # This file is part of GNUnet. # (C) 2010 Christian Grothoff (and other contributing authors) # diff --git a/src/fs/test_gnunet_fs_psd.py b/src/fs/test_gnunet_fs_psd.py.in similarity index 99% rename from src/fs/test_gnunet_fs_psd.py rename to src/fs/test_gnunet_fs_psd.py.in index bb00ba5d1..d66b8b994 100755 --- a/src/fs/test_gnunet_fs_psd.py +++ b/src/fs/test_gnunet_fs_psd.py.in @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!@PYTHON@ # This file is part of GNUnet. # (C) 2010 Christian Grothoff (and other contributing authors) # diff --git a/src/fs/test_gnunet_fs_rec.py b/src/fs/test_gnunet_fs_rec.py.in similarity index 99% rename from src/fs/test_gnunet_fs_rec.py rename to src/fs/test_gnunet_fs_rec.py.in index 62189af32..145b8e3b4 100755 --- a/src/fs/test_gnunet_fs_rec.py +++ b/src/fs/test_gnunet_fs_rec.py.in @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!@PYTHON@ # This file is part of GNUnet. # (C) 2010 Christian Grothoff (and other contributing authors) # diff --git a/src/peerinfo-tool/Makefile.am b/src/peerinfo-tool/Makefile.am index 1fc088ad9..8b74efefb 100644 --- a/src/peerinfo-tool/Makefile.am +++ b/src/peerinfo-tool/Makefile.am @@ -20,8 +20,19 @@ gnunet_peerinfo_LDADD = \ $(top_builddir)/src/util/libgnunetutil.la if HAVE_PYTHON_PEXPECT -TESTS_ENVIRONMENT = $(PYTHON) -TESTS = \ +check_SCRIPTS = \ test_gnunet_peerinfo.py endif +TESTS = $(check_SCRIPTS) + +do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g' + +test_gnunet_peerinfo.py: test_gnunet_peerinfo.py.in Makefile + $(do_subst) < $(srcdir)/test_gnunet_peerinfo.py.in > test_gnunet_peerinfo.py + chmod +x test_gnunet_peerinfo.py + +EXTRADIST = \ + test_gnunet_peerinfo.py.in + +CLEANFILES = $(check_SCRIPTS) diff --git a/src/peerinfo-tool/test_gnunet_peerinfo.py b/src/peerinfo-tool/test_gnunet_peerinfo.py.in similarity index 99% rename from src/peerinfo-tool/test_gnunet_peerinfo.py rename to src/peerinfo-tool/test_gnunet_peerinfo.py.in index bab59ee47..ba542f28a 100755 --- a/src/peerinfo-tool/test_gnunet_peerinfo.py +++ b/src/peerinfo-tool/test_gnunet_peerinfo.py.in @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!@PYTHON@ # This file is part of GNUnet. # (C) 2010 Christian Grothoff (and other contributing authors) # -- 2.25.1