summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/sol2/Catch/scripts/scriptCommon.py
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-10-07 14:43:09 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-10-07 14:43:09 +0200
commit377472a6dd2c9bdff4d5667f5789c49aee2abb4c (patch)
treea0ce4d6fc3db1524609efc61307d48448e703f38 /3rdparty/sol2/Catch/scripts/scriptCommon.py
parent1335933ce00cf6095e403a24d0b1dd9e0b565650 (diff)
Added sol2 header only library as future replacement for luabridge (nw)
Diffstat (limited to '3rdparty/sol2/Catch/scripts/scriptCommon.py')
-rw-r--r--3rdparty/sol2/Catch/scripts/scriptCommon.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/3rdparty/sol2/Catch/scripts/scriptCommon.py b/3rdparty/sol2/Catch/scripts/scriptCommon.py
new file mode 100644
index 00000000000..6ac381adcb6
--- /dev/null
+++ b/3rdparty/sol2/Catch/scripts/scriptCommon.py
@@ -0,0 +1,21 @@
+import os
+import sys
+import subprocess
+
+catchPath = os.path.dirname(os.path.realpath( os.path.dirname(sys.argv[0])))
+
+def runAndCapture( args ):
+ child = subprocess.Popen(" ".join( args ), shell=True, stdout=subprocess.PIPE)
+ lines = []
+ line = ""
+ while True:
+ out = child.stdout.read(1)
+ if out == '' and child.poll() != None:
+ break
+ if out != '':
+ if out == '\n':
+ lines.append( line )
+ line = ""
+ else:
+ line = line + out
+ return lines \ No newline at end of file