summaryrefslogtreecommitdiff
path: root/cpp/test/Slice/errorDetection/run.py
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2009-01-23 17:07:21 -0500
committerBernard Normier <bernard@zeroc.com>2009-01-23 17:07:21 -0500
commit2380e089401d048490da23bc6d71e5687bafbe47 (patch)
tree6d97052d1f93bc2bafcd7fd1a9ebe103544b6cad /cpp/test/Slice/errorDetection/run.py
parentFixed permissions (diff)
parent3.3.1 third-party updates (diff)
downloadice-2380e089401d048490da23bc6d71e5687bafbe47.tar.bz2
ice-2380e089401d048490da23bc6d71e5687bafbe47.tar.xz
ice-2380e089401d048490da23bc6d71e5687bafbe47.zip
Merge branch 'R3_3_branch' of cvs:/home/git/ice into R3_3_branch
Conflicts: java/resources/IceGridAdmin/icegridadmin_content_dyn.html java/resources/IceGridAdmin/icegridadmin_content_static.html
Diffstat (limited to 'cpp/test/Slice/errorDetection/run.py')
-rwxr-xr-xcpp/test/Slice/errorDetection/run.py39
1 files changed, 17 insertions, 22 deletions
diff --git a/cpp/test/Slice/errorDetection/run.py b/cpp/test/Slice/errorDetection/run.py
index abd3b0053b6..b10af237310 100755
--- a/cpp/test/Slice/errorDetection/run.py
+++ b/cpp/test/Slice/errorDetection/run.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# **********************************************************************
#
-# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
+# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
@@ -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()
+ lines1 = stderr.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()