]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Run tests on Windows platform.
authormkr <mkr@opencascade.com>
Mon, 17 Aug 2015 08:03:48 +0000 (11:03 +0300)
committervsr <vsr@opencascade.com>
Tue, 3 Nov 2015 10:35:34 +0000 (13:35 +0300)
doc/salome/examples/testme.py
src/XAO/tests/TestUtils.hxx

index 0f16a4288907a43b2b2b331f383f62f86e20cd0d..3e0e49698afcd901bb360a5fdb35523aea1f55dc 100755 (executable)
@@ -24,11 +24,21 @@ import unittest, sys, os
 class SalomeSession(object):
     def __init__(self, script):
         import runSalome
-        sys.argv  = ["runSalome.py"]
+        run_script = "runSalome.py"
+        if sys.platform == 'win32':
+            module_dir = os.getenv("KERNEL_ROOT_DIR")
+            if module_dir: run_script = os.path.join(module_dir, "bin", "salome", run_script)
+            pass
+        sys.argv  = [run_script]
         sys.argv += ["--terminal"]
         sys.argv += ["--modules=GEOM"]
         sys.argv += ["%s" % script]
+        if sys.platform == 'win32':
+            main_module_path = sys.modules['__main__'].__file__
+            sys.modules['__main__'].__file__ = ''
         clt, d = runSalome.main()
+        if sys.platform == 'win32':
+            sys.modules['__main__'].__file__ = main_module_path
         return
 
     def __del__(self):
index a541371bfb080a3bb288ee79fbf8847c0c2ec836..1661cc0bb777c9e39419486e8aada407a56f0b05 100644 (file)
@@ -40,7 +40,7 @@ namespace XAO
         {
             std::ifstream rstr;
             int length;
-            rstr.open(filePath.c_str());
+            rstr.open(filePath.c_str(), std::ios_base::binary);
             rstr.seekg(0, rstr.end);        // go to the end
             length = rstr.tellg();          // report location (this is the length)
             rstr.seekg(0, rstr.beg);        // go back to the beginning