Skip to content

Commit

Permalink
chore: bump tinyxml version, directly use provided lic file
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoessbauer committed Mar 18, 2019
1 parent 98af541 commit 6b3d7f8
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 12 deletions.
11 changes: 10 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ file(WRITE "${CMAKE_BINARY_DIR}/test/${TEST_TARGET}.exe.is_google_test" "")

add_executable(${TEST_TARGET} ${SOURCES})
target_include_directories(${TEST_TARGET} PRIVATE "include")

target_link_libraries(${TEST_TARGET} gtest "drace-detector" "drace-common")

# enable dr mocks
target_compile_definitions(${TEST_TARGET} PRIVATE -DTESTING)
add_dependencies(${TEST_TARGET} "drace-client")
Expand All @@ -22,6 +22,15 @@ add_custom_target(copy_files_testing ALL
DEPENDS "$<TARGET_FILE:drace-detector>"
)

if(${DRACE_XML_EXPORTER})
target_compile_definitions(${TEST_TARGET} PRIVATE -DXML_EXPORTER)
target_link_libraries(${TEST_TARGET} "tinyxml2")
add_custom_command(TARGET copy_files_testing POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"$<TARGET_FILE:tinyxml2>"
"$<TARGET_FILE_DIR:drace-tests>")
endif()

add_custom_command(TARGET copy_files_testing POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/test/data/drace_excl.ini"
Expand Down
21 changes: 21 additions & 0 deletions test/src/DrIntegrationTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@

#include "DrIntegrationTest.h"

#include <iostream>
#include <string>

#ifdef XML_EXPORTER
#include <tinyxml2.h>
#include <cstdio>
#endif

std::string DrIntegration::drrun = "drrun.exe";
std::string DrIntegration::drclient = "drace-client/drace-client.dll";
bool DrIntegration::verbose = false;
Expand Down Expand Up @@ -57,6 +63,21 @@ TEST_F(DrIntegration, ExcludeRaces) {
run("-c test/data/drace_excl.ini", "mini-apps/concurrent-inc/gp-concurrent-inc.exe", 0, 0);
}

#ifdef XML_EXPORTER
TEST_F(DrIntegration, XmlOutput) {
std::string xmlfile("xmlOutput.xml");
run("--xml-file " + xmlfile, "mini-apps/concurrent-inc/gp-concurrent-inc.exe", 1, 10);
{
tinyxml2::XMLDocument doc;
ASSERT_EQ(doc.LoadFile(xmlfile.c_str()), tinyxml2::XML_SUCCESS) << "File not found";
const auto errornode = doc.FirstChildElement("valgrindoutput")->FirstChildElement("error");
EXPECT_GT(errornode->FirstChildElement("tid")->IntText(), 0);
EXPECT_STREQ(errornode->FirstChildElement("kind")->GetText(), "Race");
}
std::remove(xmlfile.c_str());
}
#endif

// Setup value-parameterized tests
INSTANTIATE_TEST_CASE_P(DrIntegration,
FlagMode,
Expand Down
2 changes: 1 addition & 1 deletion vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/leethomason/tinyxml2/tinyxml2.cpp")
add_library("tinyxml2" SHARED "${CMAKE_CURRENT_SOURCE_DIR}/leethomason/tinyxml2/tinyxml2.cpp")
target_include_directories("tinyxml2" INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/leethomason/tinyxml2/)
install(TARGETS "tinyxml2" DESTINATION bin)
file(READ "license_tinyxml2.tpl" LIC_FILE_TINYXML2)
file(READ "leethomason/tinyxml2/LICENSE.txt" LIC_FILE_TINYXML2)
file(APPEND ${LIC_FILE} "${LIC_SEP}leethomason/tinyxml2\n\n${LIC_FILE_TINYXML2}")
else()
set(DRACE_XML_EXPORTER OFF CACHE BOOL "Build with Valkyrie compatible XML exporter" FORCE)
Expand Down
2 changes: 1 addition & 1 deletion vendor/leethomason/tinyxml2
Submodule tinyxml2 updated 49 files
+14 −5 CMakeLists.txt
+18 −0 LICENSE.txt
+1 −0 Makefile
+2 −2 docs/_example_1.html
+2 −2 docs/_example_2.html
+2 −2 docs/_example_3.html
+2 −2 docs/_example_4.html
+2 −2 docs/annotated.html
+2 −2 docs/classes.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_attribute-members.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_attribute.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_comment-members.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_comment.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_const_handle-members.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_const_handle.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_declaration-members.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_declaration.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_document-members.html
+3 −3 docs/classtinyxml2_1_1_x_m_l_document.html
+34 −33 docs/classtinyxml2_1_1_x_m_l_element-members.html
+12 −8 docs/classtinyxml2_1_1_x_m_l_element.html
+4 −4 docs/classtinyxml2_1_1_x_m_l_handle-members.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_handle.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_node-members.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_node.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_printer-members.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_printer.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_text-members.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_text.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_unknown-members.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_unknown.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_visitor-members.html
+2 −2 docs/classtinyxml2_1_1_x_m_l_visitor.html
+2 −2 docs/files.html
+6 −3 docs/functions.html
+6 −3 docs/functions_func.html
+2 −2 docs/hierarchy.html
+13 −29 docs/index.html
+2 −2 docs/pages.html
+2 −1 docs/search/all_d.js
+2 −1 docs/search/functions_d.js
+103 −101 docs/tinyxml2_8h_source.html
+1 −5 dox
+2 −3 readme.md
+1 −0 resources/xmltest-5662204197076992.xml
+30 −20 tinyxml2.cpp
+24 −23 tinyxml2.h
+2 −2 tinyxml2.pc.in
+23 −3 xmltest.cpp
9 changes: 0 additions & 9 deletions vendor/license_tinyxml2.tpl

This file was deleted.

0 comments on commit 6b3d7f8

Please sign in to comment.