From: LRN Date: Fri, 6 Sep 2013 16:48:58 +0000 (+0000) Subject: W32 compatibility for test_testbed_api_barriers X-Git-Tag: initial-import-from-subversion-38251~7469 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8f9923a6fb8a3034370e18579ab4aee00bbee1c6;p=oweals%2Fgnunet.git W32 compatibility for test_testbed_api_barriers --- diff --git a/src/testbed/Makefile.am b/src/testbed/Makefile.am index 18d6a3ae9..b3779ec21 100644 --- a/src/testbed/Makefile.am +++ b/src/testbed/Makefile.am @@ -367,7 +367,7 @@ test_testbed_api_barriers_LDADD = \ $(top_builddir)/src/util/libgnunetutil.la \ libgnunettestbed.la -do_subst = sed -e 's,[@]libexecdir[@],$(libexecdir),g' +do_subst = sed -e 's,[@]libexecdir[@],$(libexecdir),g' -e 's,[@]exec_prefix[@],$(exec_prefix),g' buildvars.py: buildvars.py.in Makefile $(do_subst) < $(srcdir)/buildvars.py.in > $@ diff --git a/src/testbed/buildvars.py.in b/src/testbed/buildvars.py.in index e1b7d7666..339945c20 100644 --- a/src/testbed/buildvars.py.in +++ b/src/testbed/buildvars.py.in @@ -21,4 +21,14 @@ # brief: file for importing variables from build syste into python # author: Sree Harsha Totakura +import os + +exec_prefix = '@exec_prefix@' libexecdir = '@libexecdir@' + +if libexecdir.startswith (exec_prefix): + libexecdir = libexecdir[len (exec_prefix):] + +gnunet_prefix = os.environ.get ('GNUNET_PREFIX', None) +if gnunet_prefix and libexecdir.startswith ('/'): + libexecdir = os.path.join (gnunet_prefix, libexecdir[1:]) diff --git a/src/testbed/test_testbed_api_barriers.py b/src/testbed/test_testbed_api_barriers.py index 9ee8c61ff..17b6ab1e5 100755 --- a/src/testbed/test_testbed_api_barriers.py +++ b/src/testbed/test_testbed_api_barriers.py @@ -29,14 +29,18 @@ import os import sys from buildvars import libexecdir - -service = 'gnunet-service-test-barriers' +if os.name == 'nt': + service = 'gnunet-service-test-barriers.exe' + test_testbed_api_barriers = './test_testbed_api_barriers.exe' +else: + service = 'gnunet-service-test-barriers' + test_testbed_api_barriers = './test_testbed_api_barriers' # copy gnunet-service-test-barriers service to gnunet's libexec dir shutil.copy (service, libexecdir) # start the testcase binary -ret = subprocess.call ('./test_testbed_api_barriers', shell=False) +ret = subprocess.call (test_testbed_api_barriers, shell=False) # remove the installed gnunet-service-test-barriers copy os.unlink (os.path.join (libexecdir, service))