diff options
Diffstat (limited to 'python/test/Slice/macros/Client.py')
-rwxr-xr-x | python/test/Slice/macros/Client.py | 49 |
1 files changed, 19 insertions, 30 deletions
diff --git a/python/test/Slice/macros/Client.py b/python/test/Slice/macros/Client.py index dea8161c050..7e6d25fe6e6 100755 --- a/python/test/Slice/macros/Client.py +++ b/python/test/Slice/macros/Client.py @@ -8,44 +8,33 @@ # # ********************************************************************** -import os, sys, traceback - -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "python", "Ice", "__init__.py")): - break -else: - raise RuntimeError("can't find toplevel directory!") - +from TestHelper import TestHelper +TestHelper.loadSlice('Test.ice') +import sys import Ice +import Test -Ice.loadSlice('Test.ice') -import Test, copy - -status = True def test(b): if not b: raise RuntimeError('test assertion failed') -try: - sys.stdout.write("testing Slice predefined macros... ") - sys.stdout.flush() - d = Test.Default() - test(d.x == 10) - test(d.y == 10) +class Client(TestHelper): + + def run(self, args): + sys.stdout.write("testing Slice predefined macros... ") + sys.stdout.flush() - nd = Test.NoDefault() - test(nd.x != 10) - test(nd.y != 10) + d = Test.Default() + test(d.x == 10) + test(d.y == 10) - c = Test.PythonOnly() - test(c.lang == "python") - test(c.version == Ice.intVersion()) - print("ok") -except: - traceback.print_exc() - status = False + nd = Test.NoDefault() + test(nd.x != 10) + test(nd.y != 10) -sys.exit(not status) + c = Test.PythonOnly() + test(c.lang == "python") + test(c.version == Ice.intVersion()) + print("ok") |