mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-13 02:00:35 +05:00
Run tests on Windows platform.
This commit is contained in:
parent
e6bcaa307f
commit
072d2d2cd9
@ -24,11 +24,21 @@ import unittest, sys, os
|
|||||||
class SalomeSession(object):
|
class SalomeSession(object):
|
||||||
def __init__(self, script):
|
def __init__(self, script):
|
||||||
import runSalome
|
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 += ["--terminal"]
|
||||||
sys.argv += ["--modules=GEOM"]
|
sys.argv += ["--modules=GEOM"]
|
||||||
sys.argv += ["%s" % script]
|
sys.argv += ["%s" % script]
|
||||||
|
if sys.platform == 'win32':
|
||||||
|
main_module_path = sys.modules['__main__'].__file__
|
||||||
|
sys.modules['__main__'].__file__ = ''
|
||||||
clt, d = runSalome.main()
|
clt, d = runSalome.main()
|
||||||
|
if sys.platform == 'win32':
|
||||||
|
sys.modules['__main__'].__file__ = main_module_path
|
||||||
return
|
return
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
|
@ -40,7 +40,7 @@ namespace XAO
|
|||||||
{
|
{
|
||||||
std::ifstream rstr;
|
std::ifstream rstr;
|
||||||
int length;
|
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
|
rstr.seekg(0, rstr.end); // go to the end
|
||||||
length = rstr.tellg(); // report location (this is the length)
|
length = rstr.tellg(); // report location (this is the length)
|
||||||
rstr.seekg(0, rstr.beg); // go back to the beginning
|
rstr.seekg(0, rstr.beg); // go back to the beginning
|
||||||
|
Loading…
Reference in New Issue
Block a user