You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2018/10/16 17:44:37 UTC

qpid-proton git commit: NO-JIRA: [c, cpp] Fix example scripts for old python and CMake

Repository: qpid-proton
Updated Branches:
  refs/heads/master 8292110aa -> 4939f7412


NO-JIRA: [c,cpp] Fix example scripts for old python and CMake


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/4939f741
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/4939f741
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/4939f741

Branch: refs/heads/master
Commit: 4939f7412ebc26e6e552ede7badecc4b59b1350d
Parents: 8292110
Author: Alan Conway <ac...@redhat.com>
Authored: Tue Oct 16 12:34:25 2018 -0400
Committer: Alan Conway <ac...@redhat.com>
Committed: Tue Oct 16 12:35:46 2018 -0400

----------------------------------------------------------------------
 c/examples/CMakeLists.txt |  3 +--
 cpp/examples/testme       | 27 ++++++++++++++-------------
 2 files changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4939f741/c/examples/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/c/examples/CMakeLists.txt b/c/examples/CMakeLists.txt
index 8526ffe..87a4334 100644
--- a/c/examples/CMakeLists.txt
+++ b/c/examples/CMakeLists.txt
@@ -51,6 +51,5 @@ if (PYTHON_EXECUTABLE)
   add_test(
     NAME c-example-tests
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-    COMMAND ${PYTHON_EXECUTABLE} testme -v)
-  set_tests_properties(c-example-tests PROPERTIES ENVIRONMENT "${test_env}")
+    COMMAND ${PN_ENV_SCRIPT} -- ${test_env} ${PYTHON_EXECUTABLE} testme -v)
 endif()

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/4939f741/cpp/examples/testme
----------------------------------------------------------------------
diff --git a/cpp/examples/testme b/cpp/examples/testme
index ed642e9..b2e7ddd 100755
--- a/cpp/examples/testme
+++ b/cpp/examples/testme
@@ -23,7 +23,7 @@
 
 import sys, shutil, os, errno
 from test_unittest import  unittest
-from test_subprocess import Popen, TestProcessError, check_output
+from test_subprocess import Popen, TestProcessError, check_output, in_path
 import test_subprocess
 from os.path import dirname
 from string import Template
@@ -145,12 +145,11 @@ map{string(k1):int(42), symbol(k2):boolean(0)}
         self.assertEqual(["send"]*len(out), out)
 
     def test_scheduled_send(self):
-        try:
-            out = check_output(["scheduled_send", "-a", Broker.addr+"scheduled_send", "-t", "0.1", "-i", "0.001"]).split()
-            self.assertTrue(len(out) > 0);
-            self.assertEqual(["send"]*len(out), out)
-        except OSError as e:
-            if e.errno != errno.ENOENT: raise
+        if not in_path("scheduled_send"):
+            return
+        out = check_output(["scheduled_send", "-a", Broker.addr+"scheduled_send", "-t", "0.1", "-i", "0.001"]).split()
+        self.assertTrue(len(out) > 0);
+        self.assertEqual(["send"]*len(out), out)
 
     def test_message_properties(self):
         expect="""using put/get: short=123 string=foo symbol=sym
@@ -165,15 +164,17 @@ expected conversion_error: "unexpected type, want: uint got: string"
         self.assertMultiLineEqual(expect, check_output(["message_properties"]))
 
     def test_multithreaded_client(self):
-        try:
-            got = check_output(["multithreaded_client", Broker.addr, "examples", "10"])
-            self.maxDiff = None
-            self.assertIn("10 messages sent and received", got);
-        except OSError as e:
-            if e.errno != errno.ENOENT: raise
+        if not in_path("multithreaded_client"):
+            return
+        got = check_output(["multithreaded_client", Broker.addr, "examples", "10"])
+        self.maxDiff = None
+        self.assertIn("10 messages sent and received", got);
+
 
     # Test is unstable, enable when fixed
     def skip_test_multithreaded_client_flow_control(self):
+        if not in_path("multithreaded_client_flow_control"):
+            return
         got = check_output(["multithreaded_client_flow_control", Broker.addr, "examples", "10", "2"])
         self.maxDiff = None
         self.assertIn("20 messages sent and received", got);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org