From b0b55e2037d52b392c1031c81cbb8d3ecd602ae6 Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 1 Jun 2015 02:46:09 +0200 Subject: [PATCH] Delete niftest as it's currently broken --- CMakeLists.txt | 9 --- components/nif/tests/.gitignore | 1 - components/nif/tests/CMakeLists.txt | 19 ------ components/nif/tests/niftest.cpp | 96 ----------------------------- components/nif/tests/test.sh | 15 ----- 5 files changed, 140 deletions(-) delete mode 100644 components/nif/tests/.gitignore delete mode 100644 components/nif/tests/CMakeLists.txt delete mode 100644 components/nif/tests/niftest.cpp delete mode 100755 components/nif/tests/test.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c3cd9f6b..43d40c2ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,6 @@ option(BUILD_OPENCS "build OpenMW Construction Set" ON) option(BUILD_WIZARD "build Installation Wizard" ON) option(BUILD_WITH_CODE_COVERAGE "Enable code coverage with gconv" OFF) option(BUILD_UNITTESTS "Enable Unittests with Google C++ Unittest" OFF) -option(BUILD_NIFTEST "build nif file tester" OFF) option(BUILD_MYGUI_PLUGIN "build MyGUI plugin for OpenMW resources, to use with MyGUI tools" ON) # OS X deployment @@ -319,9 +318,6 @@ IF(NOT WIN32 AND NOT APPLE) IF(BUILD_OPENCS) INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/openmw-cs" DESTINATION "${BINDIR}" ) ENDIF(BUILD_OPENCS) - IF(BUILD_NIFTEST) - INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/niftest" DESTINATION "${BINDIR}" ) - ENDIF(BUILD_NIFTEST) IF(BUILD_WIZARD) INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/openmw-wizard" DESTINATION "${BINDIR}" ) ENDIF(BUILD_WIZARD) @@ -461,11 +457,6 @@ add_subdirectory (components) # add_subdirectory(plugins/mygui_resource_plugin) #endif() -#Testing -if (BUILD_NIFTEST) - add_subdirectory(components/nif/tests/) -endif(BUILD_NIFTEST) - # Apps and tools if (BUILD_OPENMW) add_subdirectory( apps/openmw ) diff --git a/components/nif/tests/.gitignore b/components/nif/tests/.gitignore deleted file mode 100644 index 397b4a762..000000000 --- a/components/nif/tests/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.log diff --git a/components/nif/tests/CMakeLists.txt b/components/nif/tests/CMakeLists.txt deleted file mode 100644 index a45298180..000000000 --- a/components/nif/tests/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -set(NIFTEST - niftest.cpp -) -source_group(components\\nif\\tests FILES ${NIFTEST}) - -# Main executable -add_executable(niftest - ${NIFTEST} -) - -target_link_libraries(niftest - ${Boost_LIBRARIES} - components -) - -if (BUILD_WITH_CODE_COVERAGE) - add_definitions (--coverage) - target_link_libraries(niftest gcov) -endif() diff --git a/components/nif/tests/niftest.cpp b/components/nif/tests/niftest.cpp deleted file mode 100644 index a06c002df..000000000 --- a/components/nif/tests/niftest.cpp +++ /dev/null @@ -1,96 +0,0 @@ -///Program to test .nif files both on the FileSystem and in BSA archives. - -#include "../niffile.hpp" -#include "../../bsa/bsa_file.hpp" -#include "../../bsa/bsa_archive.hpp" -#include -#include -#include -#include -#include - -///See if the file has the named extension -bool hasExtension(std::string filename, std::string extensionToFind) -{ - std::string extension = filename.substr(filename.find_last_of(".")+1); - - //Convert strings to lower case for comparison - std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower); - std::transform(extensionToFind.begin(), extensionToFind.end(), extensionToFind.begin(), ::tolower); - - if(extension == extensionToFind) - return true; - else - return false; -} - -///See if the file has the "nif" extension. -bool isNIF(std::string filename) -{ - return hasExtension(filename,"nif"); -} -///See if the file has the "bsa" extension. -bool isBSA(std::string filename) -{ - return hasExtension(filename,"bsa"); -} - -///Check all the nif files in the given BSA archive -void readBSA(std::string filename) -{ - Bsa::BSAFile bsa; - bsa.open(filename.c_str()); - - const Bsa::BSAFile::FileList &files = bsa.getList(); - Bsa::addBSA(filename,"Bsa Files"); - - for(unsigned int i=0; i nifs.txt -find "$DATAFILESDIR" -iname *nif >> nifs.txt - -sed -e 's/.*/\"&\"/' nifs.txt > quoted_nifs.txt - -xargs --arg-file=quoted_nifs.txt ../../../niftest - -rm nifs.txt -rm quoted_nifs.txt