diff options
author | Jose <jose@zeroc.com> | 2016-10-11 16:16:32 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2016-10-11 16:16:32 +0200 |
commit | e659399c9fce6fc56006789120e3b90a9134574f (patch) | |
tree | 9a47a3da29acf5598ed853e1be0c7651dc0ff133 /cpp/test/Slice/unicodePaths | |
parent | Fixed ICE-7346 - removed lmdb dependency, set cppflags instead if necessary (diff) | |
parent | Fixed typo (diff) | |
download | ice-e659399c9fce6fc56006789120e3b90a9134574f.tar.bz2 ice-e659399c9fce6fc56006789120e3b90a9134574f.tar.xz ice-e659399c9fce6fc56006789120e3b90a9134574f.zip |
Merge remote-tracking branch 'origin/3.6'
Conflicts:
README.md
android/build.gradle
android/gradle.properties
android/gradle/wrapper/gradle-wrapper.properties
config/Make.common.rules
config/PropertyNames.xml
cpp/BuildInstructionsLinux.md
cpp/BuildInstructionsOSX.md
cpp/BuildInstructionsWinRT.md
cpp/BuildInstructionsWindows.md
cpp/config/Make.rules
cpp/config/Make.rules.mak
cpp/include/IceUtil/Config.h
cpp/include/Slice/PythonUtil.h
cpp/include/Slice/RubyUtil.h
cpp/include/Slice/Util.h
cpp/src/Ice/DynamicLibrary.cpp
cpp/src/Ice/PropertyNames.cpp
cpp/src/Ice/PropertyNames.h
cpp/src/Ice/winrt/StreamEndpointI.cpp
cpp/src/IceGrid/IceGridDB.cpp
cpp/src/IceGrid/Util.cpp
cpp/src/IceUtil/FileUtil.cpp
cpp/src/IceUtil/FileUtil.h
cpp/src/Makefile
cpp/src/Slice/Util.cpp
cpp/src/slice2cs/Gen.cpp
cpp/src/slice2freeze/Main.cpp
cpp/src/slice2freezej/Main.cpp
cpp/src/slice2html/Makefile
cpp/src/slice2html/Makefile.mak
cpp/src/slice2java/Main.cpp
cpp/test/Ice/exceptions/AllTests.cpp
cpp/test/Ice/facets/AllTests.cpp
cpp/test/Ice/info/AllTests.cpp
cpp/test/Ice/location/AllTests.cpp
cpp/test/Ice/properties/run.py
cpp/test/Ice/timeout/AllTests.cpp
cpp/test/IceGrid/noRestartUpdate/AllTests.cpp
cpp/test/IceStorm/stress/run.py
cpp/test/TestSuite/10.0/Package.appxmanifest
cpp/test/TestSuite/10.0/TestSuite.vcxproj
cpp/test/TestSuite/10.0/TestSuite.vcxproj.filters
cpp/test/TestSuite/10.0/TestSuite_TemporaryKey.pfx
cpp/test/TestSuite/8.0/TestSuite.vcxproj
cpp/test/TestSuite/8.0/TestSuite_TemporaryKey.pfx
csharp/BuildInstructions.md
csharp/src/Ice/PropertyNames.cs
csharp/src/IceLocatorDiscovery/PluginI.cs
java/BuildInstructions.md
java/Makefile
java/Makefile.mak
java/src/Glacier2/src/main/java/Glacier2/Application.java
java/src/Glacier2/src/main/java/Glacier2/SessionFactoryHelper.java
java/src/Glacier2/src/main/java/Glacier2/SessionHelper.java
java/src/Ice/src/main/java/Ice/Object.java
java/src/Ice/src/main/java/Ice/ObjectImpl.java
java/src/Ice/src/main/java/IceInternal/PropertyNames.java
java/src/Ice/src/main/java/IceSSL/Plugin.java
java/src/Ice/src/main/java/IceSSL/PluginFactory.java
java/src/Ice/src/main/java/IceUtil/Cache.java
java/src/IceGridGUI/build.gradle
java/src/IceGridGUI/src/main/java/IceGridGUI/SimpleInternalFrame.java
java/src/IceGridGUI/src/main/java/IceGridGUI/Utils.java
java/test/build.gradle
java/test/ejb/README.md
js/src/Ice/PropertyNames.js
js/src/Ice/browser/TimerUtil.js
js/src/Ice/browser/WSTransceiver.js
js/test/Common/TestCases.json
js/test/Common/Worker.js
objective-c/include/objc/Ice/Config.h
objective-c/src/Ice/CommunicatorI.mm
php/BuildInstructionsLinuxOSX.md
php/BuildInstructionsWindows.md
php/config/Make.rules.mak.php
php/src/php7/IcePHP.rc
python/BuildInstructionsLinuxOSX.md
python/BuildInstructionsWindows.md
python/Makefile
python/modules/IcePy/Slice.cpp
python/test/Slice/import/run.py
ruby/BuildInstructionsLinuxOSX.md
ruby/BuildInstructionsWindows.md
ruby/config/Make.rules
ruby/src/IceRuby/Slice.cpp
scripts/TestController.py
scripts/TestUtil.py
slice/Ice/Communicator.ice
slice/Ice/Instrumentation.ice
slice/IceLocatorDiscovery/IceLocatorDiscovery.ice
Diffstat (limited to 'cpp/test/Slice/unicodePaths')
-rw-r--r-- | cpp/test/Slice/unicodePaths/run.py | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/cpp/test/Slice/unicodePaths/run.py b/cpp/test/Slice/unicodePaths/run.py new file mode 100644 index 00000000000..c8f999a0cab --- /dev/null +++ b/cpp/test/Slice/unicodePaths/run.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# ********************************************************************** +# +# Copyright (c) 2003-2016 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. +# +# ********************************************************************** + +import os, sys, locale, shutil + +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 RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil + +def test(b): + if not b: + print("failed!") + sys.exit(1) + +if TestUtil.isAIX() or TestUtil.isLinux(): + encoding = locale.getdefaultlocale()[1] + if encoding != "UTF-8": + print("Please set LC_ALL to xx_xx.UTF-8, for example FR_FR.UTF-8") + print("Skipping test") + sys.exit(0) + +if sys.version_info[0] == 2 and TestUtil.isWin32(): + print("To run this test on Windows you need to be using Python 3.x") + print("Python 2.x subprocess module doesn't support unicode on Windows") + print("Skipping tes") + sys.exit(0) + +sys.stdout.write("testing Slice compiler and unicode file paths... ") +sys.stdout.flush() +tests = [ + ("cpp", ["Test.cpp", "Test.h", "TestI.cpp", "TestI.h"], "--impl-c++11"), + ("cpp", ["Test.cpp", "Test.h", "TestI.cpp", "TestI.h"], "--impl-c++98"), + ("cs", ["Test.cs", "TestI.cs"], "--impl"), + ("html", ["index.html"], ""), + ("java", ["Test/Point.java", "Test/CanvasI.java"], "--impl"), + ("js", ["Test.js"], ""), + ("objc", ["Test.m"], ""), + ("php", ["Test.php"], "")] + +# +# Write config +# +if sys.version_info[0] == 2: + srcPath = "./\xe4\xb8\xad\xe5\x9b\xbd".decode("utf-8") +else: + srcPath = "./\u4e2d\u56fd" +if os.path.exists(srcPath): + shutil.rmtree(srcPath) +os.mkdir(srcPath) +TestUtil.createFile("%s/Test.ice" % srcPath, ["module Test { ", + "class Point{int x; int y; };", + "interface Canvas{ void draw(Point p); };", + "};"], "utf-8") + +for language, generated, args in tests: + compiler = '%s' % TestUtil.getSliceTranslator(language) + if not os.path.isfile(compiler): + continue + p = TestUtil.runCommand('"%s" %s/Test.ice --output-dir %s %s' % (compiler, srcPath, srcPath, args)) + test(p.wait() == 0) + for f in generated: + test(os.path.isfile(os.path.join(srcPath, f))) + os.remove(os.path.join(srcPath, f)) + + +if os.path.exists(srcPath): + shutil.rmtree(srcPath) +print("ok") |