diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 25 | ||||
-rw-r--r-- | tests/cgalcachetest.cc | 9 | ||||
-rw-r--r-- | tests/cgalpngtest.cc | 7 | ||||
-rw-r--r-- | tests/cgalstlsanitytest.cc | 11 | ||||
-rw-r--r-- | tests/cgaltest.cc | 7 | ||||
-rw-r--r-- | tests/csgtermtest.cc | 7 | ||||
-rw-r--r-- | tests/csgtestcore.cc | 9 | ||||
-rw-r--r-- | tests/csgtexttest.cc | 7 | ||||
-rw-r--r-- | tests/dumptest.cc | 7 | ||||
-rw-r--r-- | tests/echotest.cc | 7 | ||||
-rw-r--r-- | tests/modulecachetest.cc | 7 |
11 files changed, 24 insertions, 79 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5eecaae..8fd079f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -179,28 +179,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") FIND_LIBRARY(COCOA_LIBRARY Cocoa REQUIRED) endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") -# Qt4 - -set(CMAKE_INCLUDE_DIRECTORIES_BEFORE ON) -find_package(OpenGL REQUIRED) -if ( "${OPENGL_glu_LIBRARY}" MATCHES "NOTFOUND" ) - # GLU and Mesa split in late 2012 so some systems dont have GLU - find_library(OPENGL_glu_LIBRARY GLU HINTS "$ENV{OPENSCAD_LIBRARIES}/lib" REQUIRED) - set( OPENGL_LIBRARY ${OPENGL_glu_LIBRARY} ${OPENGL_LIBRARY} ) -endif() - -if (MINGW_CROSS_ENV_DIR) - mingw_cross_env_find_qt() - mingw_cross_env_info() - include_directories( ${QT_INCLUDE_DIRS} ) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${QT_CFLAGS_OTHER}") -else() - find_package(Qt4 COMPONENTS QtCore REQUIRED) - include(${QT_USE_FILE}) -endif() - -set(CMAKE_INCLUDE_DIRECTORIES_BEFORE OFF) - # Eigen @@ -268,6 +246,8 @@ else() inclusion(EIGEN_DIR EIGEN_INCLUDE_DIR) endif() +# OpenGL +find_package(OpenGL REQUIRED) # OpenCSG if (NOT $ENV{OPENCSGDIR} STREQUAL "") @@ -444,6 +424,7 @@ set(CORE_SOURCES ../src/rotateextrude.cc ../src/printutils.cc ../src/progress.cc + ../src/boost-utils.cc ${FLEX_OpenSCADlexer_OUTPUTS} ${BISON_OpenSCADparser_OUTPUTS}) diff --git a/tests/cgalcachetest.cc b/tests/cgalcachetest.cc index 3a0a855..b7e51b5 100644 --- a/tests/cgalcachetest.cc +++ b/tests/cgalcachetest.cc @@ -40,7 +40,6 @@ #include "PolySetCGALEvaluator.h" #include "CGALCache.h" -#include <QCoreApplication> #ifndef _MSC_VER #include <getopt.h> #endif @@ -57,7 +56,6 @@ namespace po = boost::program_options; std::string commandline_commands; std::string currentdir; -QString examplesdir; using std::string; @@ -124,13 +122,12 @@ int main(int argc, char **argv) Builtins::instance()->initialize(); - QCoreApplication app(argc, argv); fs::path original_path = fs::current_path(); - currentdir = boosty::stringy( fs::current_path() ); + currentdir = boosty::stringy(fs::current_path()); - parser_init(QCoreApplication::instance()->applicationDirPath().toStdString()); - add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries")); + parser_init(boosty::stringy(fs::path(argv[0]).branch_path())); + add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); Context root_ctx; register_builtin(root_ctx); diff --git a/tests/cgalpngtest.cc b/tests/cgalpngtest.cc index 52205fd..947a231 100644 --- a/tests/cgalpngtest.cc +++ b/tests/cgalpngtest.cc @@ -43,7 +43,6 @@ #include "cgal.h" #include "OffscreenView.h" -#include <QCoreApplication> #ifndef _MSC_VER #include <getopt.h> #endif @@ -57,7 +56,6 @@ namespace fs = boost::filesystem; std::string commandline_commands; std::string currentdir; -QString examplesdir; using std::string; @@ -97,13 +95,12 @@ int main(int argc, char **argv) #endif Builtins::instance()->initialize(); - QCoreApplication app(argc, argv); fs::path original_path = fs::current_path(); currentdir = boosty::stringy( fs::current_path() ); - parser_init(QCoreApplication::instance()->applicationDirPath().toStdString()); - add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries")); + parser_init(boosty::stringy(fs::path(argv[0]).branch_path())); + add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); Context root_ctx; register_builtin(root_ctx); diff --git a/tests/cgalstlsanitytest.cc b/tests/cgalstlsanitytest.cc index 2815463..228bfde 100644 --- a/tests/cgalstlsanitytest.cc +++ b/tests/cgalstlsanitytest.cc @@ -38,11 +38,6 @@ #include "CGALEvaluator.h" #include "PolySetCGALEvaluator.h" -#include <QCoreApplication> -#include <QFile> -#include <QDir> -#include <QSet> -#include <QTextStream> #ifndef _MSC_VER #include <getopt.h> #endif @@ -56,7 +51,6 @@ namespace fs = boost::filesystem; std::string commandline_commands; std::string currentdir; -QString examplesdir; using std::string; @@ -83,13 +77,12 @@ int main(int argc, char **argv) Builtins::instance()->initialize(); - QCoreApplication app(argc, argv); fs::path original_path = fs::current_path(); currentdir = boosty::stringy( fs::current_path() ); - parser_init(QCoreApplication::instance()->applicationDirPath().toStdString()); - add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries")); + parser_init(boosty::stringy(fs::path(argv[0]).branch_path())); + add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); Context root_ctx; register_builtin(root_ctx); diff --git a/tests/cgaltest.cc b/tests/cgaltest.cc index 4a15050..9c8c090 100644 --- a/tests/cgaltest.cc +++ b/tests/cgaltest.cc @@ -38,7 +38,6 @@ #include "CGALEvaluator.h" #include "PolySetCGALEvaluator.h" -#include <QCoreApplication> #ifndef _MSC_VER #include <getopt.h> #endif @@ -52,7 +51,6 @@ namespace fs = boost::filesystem; std::string commandline_commands; std::string currentdir; -QString examplesdir; using std::string; @@ -76,13 +74,12 @@ int main(int argc, char **argv) Builtins::instance()->initialize(); - QCoreApplication app(argc, argv); fs::path original_path = fs::current_path(); currentdir = boosty::stringy( fs::current_path() ); - parser_init(QCoreApplication::instance()->applicationDirPath().toStdString()); - add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries")); + parser_init(boosty::stringy(fs::path(argv[0]).branch_path())); + add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); Context root_ctx; register_builtin(root_ctx); diff --git a/tests/csgtermtest.cc b/tests/csgtermtest.cc index e793c4a..864ba5d 100644 --- a/tests/csgtermtest.cc +++ b/tests/csgtermtest.cc @@ -38,7 +38,6 @@ #include "Tree.h" #include "csgterm.h" -#include <QCoreApplication> #ifndef _MSC_VER #include <getopt.h> #endif @@ -53,7 +52,6 @@ namespace fs = boost::filesystem; std::string commandline_commands; std::string currentdir; -QString examplesdir; using std::cout; @@ -71,13 +69,12 @@ int main(int argc, char **argv) Builtins::instance()->initialize(); - QCoreApplication app(argc, argv); fs::path original_path = fs::current_path(); currentdir = boosty::stringy( fs::current_path() ); - parser_init(QCoreApplication::instance()->applicationDirPath().toStdString()); - add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries")); + parser_init(boosty::stringy(fs::path(argv[0]).branch_path())); + add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); Context root_ctx; register_builtin(root_ctx); diff --git a/tests/csgtestcore.cc b/tests/csgtestcore.cc index 7583a41..1e518e2 100644 --- a/tests/csgtestcore.cc +++ b/tests/csgtestcore.cc @@ -23,9 +23,6 @@ #include "csgtermnormalizer.h" #include "OffscreenView.h" -#include <QCoreApplication> -#include <QTimer> - #include <sstream> #include <vector> @@ -128,14 +125,12 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type) Builtins::instance()->initialize(); - QCoreApplication app(argc, argv); - fs::path original_path = fs::current_path(); std::string currentdir = boosty::stringy( fs::current_path() ); - parser_init(QCoreApplication::instance()->applicationDirPath().toStdString()); - add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries")); + parser_init(boosty::stringy(fs::path(argv[0]).branch_path())); + add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); Context root_ctx; register_builtin(root_ctx); diff --git a/tests/csgtexttest.cc b/tests/csgtexttest.cc index e050232..6a72dff 100644 --- a/tests/csgtexttest.cc +++ b/tests/csgtexttest.cc @@ -37,7 +37,6 @@ #include "builtin.h" #include "Tree.h" -#include <QCoreApplication> #ifndef _MSC_VER #include <getopt.h> #endif @@ -52,7 +51,6 @@ namespace fs = boost::filesystem; std::string commandline_commands; std::string currentdir; -QString examplesdir; void csgTree(CSGTextCache &cache, const AbstractNode &root) { @@ -75,13 +73,12 @@ int main(int argc, char **argv) Builtins::instance()->initialize(); - QCoreApplication app(argc, argv); fs::path original_path = fs::current_path(); currentdir = boosty::stringy( fs::current_path() ); - parser_init(QCoreApplication::instance()->applicationDirPath().toStdString()); - add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries")); + parser_init(boosty::stringy(fs::path(argv[0]).branch_path())); + add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); Context root_ctx; register_builtin(root_ctx); diff --git a/tests/dumptest.cc b/tests/dumptest.cc index b75a2e2..4ddefe2 100644 --- a/tests/dumptest.cc +++ b/tests/dumptest.cc @@ -35,7 +35,6 @@ #include "builtin.h" #include "Tree.h" -#include <QCoreApplication> #ifndef _MSC_VER #include <getopt.h> #endif @@ -50,7 +49,6 @@ namespace fs = boost::filesystem; std::string commandline_commands; std::string currentdir; -QString examplesdir; using std::string; @@ -81,13 +79,12 @@ int main(int argc, char **argv) Builtins::instance()->initialize(); - QCoreApplication app(argc, argv); fs::path original_path = fs::current_path(); currentdir = boosty::stringy(fs::current_path()); - parser_init(QCoreApplication::instance()->applicationDirPath().toStdString()); - add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries")); + parser_init(boosty::stringy(fs::path(argv[0]).branch_path())); + add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); Context root_ctx; register_builtin(root_ctx); diff --git a/tests/echotest.cc b/tests/echotest.cc index bf2f4a4..af4942b 100644 --- a/tests/echotest.cc +++ b/tests/echotest.cc @@ -34,7 +34,6 @@ #include "builtin.h" #include "printutils.h" -#include <QCoreApplication> #ifndef _MSC_VER #include <getopt.h> #endif @@ -49,7 +48,6 @@ namespace fs = boost::filesystem; std::string commandline_commands; std::string currentdir; -QString examplesdir; using std::string; @@ -83,13 +81,12 @@ int main(int argc, char **argv) Builtins::instance()->initialize(); - QCoreApplication app(argc, argv); fs::path original_path = fs::current_path(); currentdir = boosty::stringy( fs::current_path() ); - parser_init(QCoreApplication::instance()->applicationDirPath().toStdString()); - add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries")); + parser_init(boosty::stringy(fs::path(argv[0]).branch_path())); + add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); Context root_ctx; register_builtin(root_ctx); diff --git a/tests/modulecachetest.cc b/tests/modulecachetest.cc index 0028114..1103720 100644 --- a/tests/modulecachetest.cc +++ b/tests/modulecachetest.cc @@ -35,7 +35,6 @@ #include "builtin.h" #include "Tree.h" -#include <QCoreApplication> #ifndef _MSC_VER #include <getopt.h> #endif @@ -50,7 +49,6 @@ namespace fs = boost::filesystem; std::string commandline_commands; std::string currentdir; -QString examplesdir; using std::string; @@ -71,13 +69,12 @@ int main(int argc, char **argv) Builtins::instance()->initialize(); - QCoreApplication app(argc, argv); fs::path original_path = fs::current_path(); currentdir = boosty::stringy( fs::current_path() ); - parser_init(QCoreApplication::instance()->applicationDirPath().toStdString()); - add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries")); + parser_init(boosty::stringy(fs::path(argv[0]).branch_path())); + add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); Context root_ctx; register_builtin(root_ctx); |