summaryrefslogtreecommitdiff
path: root/cpp/test/Slice/errorDetection/run.py
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2008-08-04 19:18:45 -0230
committerMatthew Newhook <matthew@zeroc.com>2008-08-04 19:18:45 -0230
commitd9c568300c2aed6ab736026ea116b3f1a72fbe43 (patch)
tree27191ba2b0d1ef43256561da01462b98c7bd696d /cpp/test/Slice/errorDetection/run.py
parentMerge branch 'R3_3_branch' of ssh://cvs.zeroc.com/home/git/ice into R3_3_branch (diff)
downloadice-d9c568300c2aed6ab736026ea116b3f1a72fbe43.tar.bz2
ice-d9c568300c2aed6ab736026ea116b3f1a72fbe43.tar.xz
ice-d9c568300c2aed6ab736026ea116b3f1a72fbe43.zip
Numerous cleanups to the test suite and expect scripts.
Conflicts: cpp/test/Glacier2/staticFiltering/run.py
Diffstat (limited to 'cpp/test/Slice/errorDetection/run.py')
-rwxr-xr-xcpp/test/Slice/errorDetection/run.py35
1 files changed, 15 insertions, 20 deletions
diff --git a/cpp/test/Slice/errorDetection/run.py b/cpp/test/Slice/errorDetection/run.py
index abd3b0053b6..cd4f11068ef 100755
--- a/cpp/test/Slice/errorDetection/run.py
+++ b/cpp/test/Slice/errorDetection/run.py
@@ -10,26 +10,21 @@
import os, sys, re
-for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
- toplevel = os.path.normpath(toplevel)
- if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")):
- break
-else:
- raise "can't find toplevel directory!"
+path = [ ".", "..", "../..", "../../..", "../../../.." ]
+head = os.path.dirname(sys.argv[0])
+if len(head) > 0:
+ path = [os.path.join(head, p) for p in path]
+path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
+if len(path) == 0:
+ raise "can't find toplevel os.getcwd()!"
+sys.path.append(os.path.join(path[0]))
+from scripts import *
-#
-# For LD_LIBRARY_PATH and similar env variables
-#
-sys.path.append(os.path.join(toplevel, "config"))
-import TestUtil
-TestUtil.processCmdLine()
-
-directory = os.path.dirname(os.path.abspath(__file__))
slice2cpp = os.path.join(TestUtil.getCppBinDir(), "slice2cpp")
-regex1 = re.compile(r"\.ice$", re.IGNORECASE)
+regex1 = re.compile("\.ice$", re.IGNORECASE)
files = []
-for file in os.listdir(directory):
+for file in os.listdir(os.getcwd()):
if(regex1.search(file)):
files.append(file)
@@ -40,17 +35,17 @@ for file in files:
print file + "...",
if file == "CaseSensitive.ice":
- command = slice2cpp + " --case-sensitive -I. " + os.path.join(directory, file);
+ command = slice2cpp + " --case-sensitive -I. " + os.path.join(os.getcwd(), file);
else:
- command = slice2cpp + " -I. " + os.path.join(directory, file);
+ command = slice2cpp + " -I. " + os.path.join(os.getcwd(), file);
stdin, stdout, stderr = os.popen3(command)
lines1 = stdout.readlines()
- lines2 = open(os.path.join(directory, regex1.sub(".err", file)), "r").readlines()
+ lines2 = open(os.path.join(os.getcwd(), regex1.sub(".err", file)), "r").readlines()
if len(lines1) != len(lines2):
print "failed!"
sys.exit(1)
- regex2 = re.compile(r"^.*(?=" + file + ")")
+ regex2 = re.compile("^.*(?=" + file + ")")
i = 0
while i < len(lines1):
line1 = regex2.sub("", lines1[i]).strip()