pkg_check_modules(LOG4CXX REQUIRED liblog4cxx)
pkg_check_modules(GUILE REQUIRED guile-2.0)
FIND_PACKAGE(SWIG REQUIRED)
+find_program(SWIG_EXECUTABLE NAMES swig3.0)
INCLUDE(${SWIG_USE_FILE})
add_definitions(${LOG4CXX_CFLAGS})
#ADD_SUBDIRECTORY(/usr/src/gtest gtest)
ADD_SUBDIRECTORY(/usr/src/gmock gmock)
enable_testing()
-target_link_libraries(fridatest gmock gtest ${QT_LIBRARIES} ${LLVM_LDFLAGS} -lLLVM-3.5 ${LLVM_SYSTEM_LIBS} ${LOG4CXX_LDFLAGS} ${GUILE_LDFLAGS} ${QUAZIP_LIBRARIES})
add_test(NAME fridatest COMMAND fridatest ${CMAKE_SOURCE_DIR})
-
-
+target_link_libraries(fridatest gmock gtest ${QT_LIBRARIES} ${LLVM_LDFLAGS} -lLLVM-3.5 ${LLVM_SYSTEM_LIBS} ${LOG4CXX_LDFLAGS} ${GUILE_LDFLAGS} ${QUAZIP_LIBRARIES})
+target_compile_options(fridatest PRIVATE -DCONFIG_TEST)
install(TARGETS frida
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
#ifndef INCLUDE__Config_hxx_
#define INCLUDE__Config_hxx_
-#cmakedefine CMAKE_INSTALL_FULL_LIBDIR "@CMAKE_INSTALL_FULL_LIBDIR@"
+#ifdef CONFIG_TEST
+# define CONFIG_LIBDIR "@CMAKE_CURRENT_BINARY_DIR@"
+#else
+# define CONFIG_LIBDIR "@CMAKE_INSTALL_FULL_LIBDIR@"
+#endif
#endif /* INCLUDE__Config_hxx_ */
scm_c_use_module("system repl server");
scm_call_0(scm_c_public_ref("system repl server", "spawn-server"));
- scm_c_load_extension(CMAKE_INSTALL_FULL_LIBDIR "/frida/plugins/Interpreter/libguile-frida-binding",
+ scm_c_load_extension(CONFIG_LIBDIR "/frida/plugins/Interpreter/libguile-frida-binding",
"scm_init_frida_module");
guile_output_port = scm_open_output_string();
QApplication::setApplicationName("frida");
QApplication::setApplicationVersion("0.0");
- QApplication::addLibraryPath(CMAKE_INSTALL_FULL_LIBDIR "/frida/plugins/Interpreter");
+ QApplication::addLibraryPath(CONFIG_LIBDIR "/frida/plugins/Interpreter");
#ifdef ARGPARSE
parser.addHelpOption();
parser.addVersionOption();
#include <gtest/gtest.h>
+#include "log4cxx/logger.h"
+#include "log4cxx/basicconfigurator.h"
+#include <QApplication>
+#include "Config.hxx"
char* TEST_DATA_DIRECTORY;
int main(int argc, char **argv) {
- testing::InitGoogleTest(&argc, argv);
+ testing::InitGoogleTest(&argc, argv);
+ log4cxx::BasicConfigurator::configure();
- if (argc > 1)
- TEST_DATA_DIRECTORY = argv[1];
- else
- TEST_DATA_DIRECTORY = "./";
+ QApplication::addLibraryPath(CONFIG_LIBDIR);
+ if (argc > 1)
+ TEST_DATA_DIRECTORY = argv[1];
+ else
+ TEST_DATA_DIRECTORY = "./";
- return RUN_ALL_TESTS();
+ return RUN_ALL_TESTS();
}