Commit bc011dbf authored by Peter Karasev's avatar Peter Karasev

add test files

parent e667d825
......@@ -8,7 +8,7 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
TestVRMLImporter.cxx,NO_VALID
)
# add another test case
ExternalData_add_test(VTKData
NAME ${vtk-module}Cxx-OBJImport-MixedOrder1
COMMAND ${vtk-module}CxxTests TestOBJImporter
......@@ -17,4 +17,19 @@ ExternalData_add_test(VTKData
-D " ${VTK_TEST_OUTPUT_DIR} "
)
ExternalData_add_test(VTKData
NAME ${vtk-module}Cxx-OBJImport-NoMTL
COMMAND ${vtk-module}CxxTests TestOBJImporter
-D DATA{../Data/Input/boxes_3_no_mtl.obj}
-D " ${VTK_TEST_OUTPUT_DIR} "
)
ExternalData_add_test(VTKData
NAME ${vtk-module}Cxx-OBJImport-MTLwithoutTextureFile
COMMAND ${vtk-module}CxxTests TestOBJImporter
-D DATA{../Data/Input/boxes_4_mtl_no_texture.obj} DATA{../Data/Input/boxes_4_mtl_no_texture.obj.mtl}
-D " ${VTK_TEST_OUTPUT_DIR} "
)
vtk_test_cxx_executable(${vtk-module}CxxTests tests)
......@@ -30,17 +30,25 @@ int TestOBJImporter( int argc, char * argv [] )
// Files for testing demonstrate updated functionality for OBJ import:
// polydata + textures + actor properties all get loaded.
if(argc < 8)
if(argc < (5))
{
std::cerr<<"expected TestName -D File1.obj File2.obj.mtl texture1 texture2 ... "<<std::endl;
std::cerr<<"expected TestName -D File1.obj [File2.obj.mtl] [texture1] [texture2] ... "<<std::endl;
return -1;
}
std::string filenameOBJ(argv[2]);
std::string filenameMTL(argv[3]);
std::string texfile1(argv[4]);
std::string texfile2(argv[5]);
std::string filenameMTL,texfile1,texfile2;
if(argc >= 6)
filenameMTL = argv[3];
if(argc >= 7)
texfile1 = argv[4];
if(argc >= 8)
texfile2 = argv[5];
std::vector<std::string> tmp1,tmp2;
std::string texture_path1 = vtksys::SystemTools::GetFilenamePath(texfile1);
std::string texture_path2 = vtksys::SystemTools::GetFilenamePath(texfile2);
......@@ -50,7 +58,8 @@ int TestOBJImporter( int argc, char * argv [] )
return -2;
}
std::string tmppath(argv[7]);
int lastArg = (argc <= 8) ? (argc-1) : 7;
std::string tmppath(argv[lastArg]);
vtkNew<vtkOBJImporter> importer;
if(argc > 8)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment