From 365d8bf95ad0146bbbceaf756a69caa660909f9c Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Tue, 28 Feb 2023 16:29:40 +0300 Subject: [PATCH] Add test for all systems --- OfficeCryptReader/Test/Test.cpp | 4 +++ OfficeCryptReader/Test/test.pro | 58 +++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 OfficeCryptReader/Test/test.pro diff --git a/OfficeCryptReader/Test/Test.cpp b/OfficeCryptReader/Test/Test.cpp index 6a1aaaa5c0..9e9025ff72 100644 --- a/OfficeCryptReader/Test/Test.cpp +++ b/OfficeCryptReader/Test/Test.cpp @@ -5,6 +5,8 @@ #include "../../Common/OfficeFileFormatChecker.h" #include "../../DesktopEditor/common/File.h" +#ifndef _QT + #if defined(_WIN64) #pragma comment(lib, "../../build/bin/icu/win_64/icuuc.lib") #elif defined (_WIN32) @@ -20,6 +22,8 @@ #pragma comment(lib, "../../build/bin/icu/win_32/icuuc.lib") #endif +#endif + int _tmain(int argc, _TCHAR* argv[]) { #define __CRTDBG_MAP_ALLOC diff --git a/OfficeCryptReader/Test/test.pro b/OfficeCryptReader/Test/test.pro new file mode 100644 index 0000000000..7533faf78a --- /dev/null +++ b/OfficeCryptReader/Test/test.pro @@ -0,0 +1,58 @@ +TEMPLATE = app +CONFIG += console +CONFIG -= app_bundle +CONFIG -= qt + +TARGET = test +CORE_ROOT_DIR = $$PWD/../.. +PWD_ROOT_DIR = $$PWD + +CONFIG += core_static_link_libstd +include($$CORE_ROOT_DIR/Common/base.pri) +include($$CORE_ROOT_DIR/Common/3dParty/boost/boost.pri) + +LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lCryptoPPLib -lCompoundFileLib +ADD_DEPENDENCY(UnicodeConverter, kernel) + +include($$CORE_ROOT_DIR/Common/3dParty/icu/icu.pri) + +CONFIG += open_ssl_common +include($$CORE_ROOT_DIR/Common/3dParty/openssl/openssl.pri) + +DEFINES += CRYPTOPP_DISABLE_ASM +DESTDIR = $$CORE_BUILDS_BINARY_PATH + +HEADERS += \ + $$PWD/../source/ECMACryptFile.h \ + $$PWD/../source/CryptTransform.h \ + $$PWD/../source/simple_xml_writer.h + +SOURCES += \ + $$PWD/../source/ECMACryptFile.cpp \ + $$PWD/../source/CryptTransform.cpp + +SOURCES += \ + $$CORE_ROOT_DIR/Common/OfficeFileFormatChecker2.cpp \ + $$CORE_ROOT_DIR/Common/3dParty/pole/pole.cpp \ + $$CORE_ROOT_DIR/MsBinaryFile/DocFile/MemoryStream.cpp \ + $$CORE_ROOT_DIR/OOXML/Base/unicode_util.cpp + +SOURCES += $$PWD/Test.cpp +DEFINES += _QT + +core_windows { + DEFINES -= UNICODE + + LIBS += -lAdvapi32 + LIBS += -lShell32 + LIBS += -lGdi32 + LIBS += -lUser32 + LIBS += -lcrypt32 + LIBS += -lcryptui + LIBS += -lws2_32 +} + +core_linux { + LIBS += -lz -pthread -ldl + QMAKE_LFLAGS += -Wl,--rpath=./ +}