summaryrefslogtreecommitdiff
path: root/cpp/test/Slice/errorDetection/run.py
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2001-08-15 17:21:39 +0000
committerMarc Laukien <marc@zeroc.com>2001-08-15 17:21:39 +0000
commit7aff96f568e834c4c13f26a46843d5ecbb1d325d (patch)
treee801f83704b85d59f80f1516576c3f91290f6d31 /cpp/test/Slice/errorDetection/run.py
parentfix (diff)
downloadice-7aff96f568e834c4c13f26a46843d5ecbb1d325d.tar.bz2
ice-7aff96f568e834c4c13f26a46843d5ecbb1d325d.tar.xz
ice-7aff96f568e834c4c13f26a46843d5ecbb1d325d.zip
IcePack ; restructuring
Diffstat (limited to 'cpp/test/Slice/errorDetection/run.py')
-rwxr-xr-xcpp/test/Slice/errorDetection/run.py52
1 files changed, 52 insertions, 0 deletions
diff --git a/cpp/test/Slice/errorDetection/run.py b/cpp/test/Slice/errorDetection/run.py
new file mode 100755
index 00000000000..ac04ed0e0dd
--- /dev/null
+++ b/cpp/test/Slice/errorDetection/run.py
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2001
+# MutableRealms, Inc.
+# Huntsville, AL, USA
+#
+# All Rights Reserved
+#
+# **********************************************************************
+
+import os, sys, re
+
+for toplevel in ["", "..", os.path.join("..", ".."), os.path.join("..", "..", "..")]:
+ if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")):
+ break
+else:
+ raise "can't find toplevel directory!"
+
+directory = os.path.join(toplevel, "test", "Slice", "parser")
+slice2cpp = os.path.join(toplevel, "bin", "slice2cpp")
+
+regex1 = re.compile(r".ice$", re.IGNORECASE)
+files = []
+for file in os.listdir(directory):
+ if(regex1.search(file)):
+ files.append(file)
+
+for file in files:
+
+ print file + "...",
+
+ stdin, stdout, stderr = os.popen3(slice2cpp + " " + os.path.join(directory, file))
+ lines1 = stderr.readlines()
+ lines2 = open(os.path.join(directory, regex1.sub(".err", file)), "r").readlines()
+
+ if len(lines1) != len(lines2):
+ print "failed!"
+ continue
+
+ regex2 = re.compile(r"^.*(?=" + file + ")")
+ diffs = ""
+ i = 0
+ while i < len(lines1) and i < len(lines2):
+ line1 = regex2.sub("", lines1[i])
+ line2 = regex2.sub("", lines2[i])
+ if line1 != line2:
+ print "failed!"
+ break
+ i += 1
+ else:
+ print "ok"