#ADD_SUBDIRECTORY(/usr/src/gtest gtest)
ADD_SUBDIRECTORY(/usr/src/gmock gmock)
enable_testing()
-add_test(NAME fridatest COMMAND fridatest ${CMAKE_SOURCE_DIR})
+add_test(NAME fridatest COMMAND fridatest ${CMAKE_SOURCE_DIR}/testdata)
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)
set_property(TEST fridatest
extern char * TEST_DATA_DIRECTORY;
TEST(BasicBlockTest, deserializeValidInstance) {
- QFile file(QString(TEST_DATA_DIRECTORY) + "/testdata/core/BasicBlock/valid.xml");
+ QFile file(QString("%1/%2").arg(TEST_DATA_DIRECTORY, "/core/BasicBlock/valid.xml"));
InformationManager manager;
file.open(QFile::ReadOnly | QFile::Text);
QXmlStreamReader reader(&file);
}
TEST(BasicBlockTest, deserializeInvalidInstance) {
- QFile file(QString(TEST_DATA_DIRECTORY) + "/testdata/core/BasicBlock/invalid.xml");
+ QFile file(QString("%1/%2").arg(TEST_DATA_DIRECTORY, "/core/BasicBlock/invalid.xml"));
InformationManager manager;
file.open(QFile::ReadOnly | QFile::Text);
QXmlStreamReader reader(&file);
}
TEST(BasicBlockTest, deserializeThenSerializeIsIdentity) {
- QFile infile(QString(TEST_DATA_DIRECTORY) + "/testdata/core/BasicBlock/valid.xml");
+ QFile infile(QString("%1/%2").arg(TEST_DATA_DIRECTORY, "/core/BasicBlock/valid.xml"));
QTemporaryFile outfile;
InformationManager manager;
extern char * TEST_DATA_DIRECTORY;
TEST(FunctionTest, deserializeValidInstance) {
- QFile file(QString(TEST_DATA_DIRECTORY) + "/testdata/core/Function/valid.xml");
+ QFile file(QString("%1/%2").arg(TEST_DATA_DIRECTORY, "/core/Function/valid.xml"));
InformationManager manager;
file.open(QFile::ReadOnly | QFile::Text);
QXmlStreamReader reader(&file);
#include <QApplication>
#include "Config.hxx"
-char* TEST_DATA_DIRECTORY;
+const char* TEST_DATA_DIRECTORY;
int main(int argc, char **argv) {
testing::InitGoogleTest(&argc, argv);
if (argc > 1)
TEST_DATA_DIRECTORY = argv[1];
else
- TEST_DATA_DIRECTORY = "./";
+ TEST_DATA_DIRECTORY = "./testdata";
return RUN_ALL_TESTS();
}