-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
85 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,27 @@ | ||
INCLUDE_DIRECTORIES("${EVP_ROOT}") | ||
INCLUDE_DIRECTORIES("${EVP_HEADERS}") | ||
INCLUDE_DIRECTORIES("${GTEST_INCLUDES}") | ||
|
||
INCLUDE(GoogleTest) | ||
|
||
ADD_COMPILE_DEFINITIONS("BASE_PATH=\"${EVP_ROOT}\"") | ||
LINK_LIBRARIES(libevp) | ||
LINK_LIBRARIES(GTest::gtest_main) | ||
|
||
ADD_EXECUTABLE(test_v1_packing v1/test_packing.cpp) | ||
ADD_EXECUTABLE(test_v1_packing | ||
"v1/test_packing.cpp" | ||
) | ||
|
||
ADD_TEST(NAME v1_packing_single_file COMMAND test_v1_packing 0 ${CMAKE_SOURCE_DIR}) | ||
ADD_TEST(NAME v1_packing_folder COMMAND test_v1_packing 1 ${CMAKE_SOURCE_DIR}) | ||
gtest_discover_tests(test_v1_packing) | ||
|
||
ADD_EXECUTABLE(test_v1_unpacking v1/test_unpacking.cpp) | ||
ADD_EXECUTABLE(test_v1_unpacking | ||
"v1/test_unpacking.cpp" | ||
) | ||
|
||
ADD_TEST(NAME v1_unpacking_single_file COMMAND test_v1_unpacking 0 ${CMAKE_SOURCE_DIR}) | ||
ADD_TEST(NAME v1_unpacking_folder COMMAND test_v1_unpacking 1 ${CMAKE_SOURCE_DIR}) | ||
ADD_TEST(NAME v1_get_file_from_evp COMMAND test_v1_unpacking 2 ${CMAKE_SOURCE_DIR}) | ||
ADD_TEST(NAME v1_get_file_from_evp_stream COMMAND test_v1_unpacking 3 ${CMAKE_SOURCE_DIR}) | ||
gtest_discover_tests(test_v1_unpacking) | ||
|
||
ADD_EXECUTABLE(test_misc v1/test_misc.cpp) | ||
ADD_EXECUTABLE(test_misc | ||
"v1/test_misc.cpp" | ||
) | ||
|
||
ADD_TEST(NAME v1_get_evp_file_list COMMAND test_misc 0 ${CMAKE_SOURCE_DIR}) | ||
gtest_discover_tests(test_misc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,16 @@ | ||
#include "libevp.hpp" | ||
#include "test/utilities_assert.hpp" | ||
#include <libevp.hpp> | ||
#include <gtest/gtest.h> | ||
|
||
using namespace libevp; | ||
|
||
int v1_get_evp_file_list(const std::string& base) { | ||
std::string input = base + std::string("/test/v1/resources/valid_folders.evp"); | ||
TEST(misc, get_evp_file_list) { | ||
std::string input = BASE_PATH + std::string("/test/v1/resources/valid_folders.evp"); | ||
|
||
auto files = evp::get_evp_file_list(input); | ||
|
||
ASSERT(files.size() == 4); | ||
ASSERT(files[0].generic_string() == "subfolder_1/text_1.txt"); | ||
ASSERT(files[1].generic_string() == "subfolder_1/text_2.txt"); | ||
ASSERT(files[2].generic_string() == "subfolder_2/text_3.txt"); | ||
ASSERT(files[3].generic_string() == "text_1.txt"); | ||
|
||
return 0; | ||
EXPECT_TRUE(files.size() == 4); | ||
EXPECT_TRUE(files[0].generic_string() == "subfolder_1/text_1.txt"); | ||
EXPECT_TRUE(files[1].generic_string() == "subfolder_1/text_2.txt"); | ||
EXPECT_TRUE(files[2].generic_string() == "subfolder_2/text_3.txt"); | ||
EXPECT_TRUE(files[3].generic_string() == "text_1.txt"); | ||
} | ||
|
||
int main(int argc, char* argv[]) { | ||
if (argc == 3) { | ||
switch (std::stoi(argv[1])) { | ||
case 0: return v1_get_evp_file_list(argv[2]); | ||
default: break; | ||
} | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters