AnimatLab  2
Test
Embedded_Tests.cpp
1 #include "stdafx.h"
2 #include <boost/test/unit_test.hpp>
3 #include <boost/shared_ptr.hpp>
4 
5 BOOST_AUTO_TEST_SUITE(Embedded_Suite )
6 
7 bool is_critical( CStdErrorInfo const& ex ) { return ex.m_lError < 0; }
8 
9 BOOST_AUTO_TEST_CASE( Dynamic_Loading )
10 {
11  Py_SetProgramName("AnimatLab");
12  Py_Initialize();
13  PyRun_SimpleString("import os\n"
14  "import sys\n"
15  "sys.path.append(\"C:/Projects/AnimatLabSDK/AnimatLabPublicSource/bin\")\n"
16  "os.chdir(\"C:/Projects/AnimatLabSDK/AnimatLabPublicSource/bin\")\n"
17  "import AnimatSimPy\n"
18  "simthread = AnimatSimPy.SimulationMgr.Instance().CreateSimulation(\"C:\\Projects\\AnimatLabSDK\\AnimatLabPublicSource\\Tutorials\\Examples\\StandAloneSimTest\\Bullet_Single_x32_Debug.asim\")\n"
19  "simthread.Simulate(2)\n");
20  //"AnimatSimPy.SimulationMgr.Instance().ShutdownAllSimulations()\n");
21 
22  int iCount = SimulationMgr::Instance().SimThreads().GetSize();
23 
24  Py_Finalize();
25 
26  //ObjectScriptPy PyObj;
27  //std::cout << "ID: " << PyObj.ID() << "\r\n";
28 
29  // std::string strExePath = Std_ExecutablePath();
30  // std::string strExecutablePath, strExeFile;
31  //Std_SplitPathAndFile(strExePath, strExecutablePath, strExeFile);
32 
33  // std::string strProjFile = strExecutablePath + "..\\Tutorials\\Examples\\StandAloneSimTest\\Bullet_Single_x32_Debug.asim";
34 
35  //SimulationThread *lpThread = SimulationMgr::Instance().CreateSimulation(strProjFile);
36  //lpThread->Simulate(2.0);
37  //SimulationMgr::Instance().ShutdownAllSimulations();
38 }
39 
40 
41 BOOST_AUTO_TEST_SUITE_END()