Skip to content

Commit 16df062

Browse files
committed
[win] Fix XMLReader on Windows
- Use `std::ios::binary` flag to fix `LF` vs `CRLF` issue on Windows - Enable related failing tests
1 parent fd2caca commit 16df062

File tree

5 files changed

+29
-39
lines changed

5 files changed

+29
-39
lines changed

core/dictgen/src/XMLReader.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ bool XMLReader::GetAttributes(const std::string& tag, std::vector<Attributes>& o
454454
bool XMLReader::Parse(const std::string &fileName, SelectionRules& out)
455455
{
456456

457-
std::ifstream file(fileName);
457+
std::ifstream file(fileName, std::ios::binary);
458458

459459
PopulateMap();
460460

roottest/root/io/datamodelevolution/01/CMakeLists.txt

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,18 @@ ROOTTEST_ADD_TEST(test3
6868
root-io-datamodelevolution-01-test1-fixture
6969
root-io-datamodelevolution-01-test3-compile-fixture)
7070

71-
# problem with XML file parsing on windows
72-
if(NOT MSVC OR win_broken_tests)
73-
ROOTTEST_GENERATE_REFLEX_DICTIONARY(libDatModelV2_dictrflx
74-
DataModelV2.h
75-
SELECTION DataModelV2_selection.xml
76-
LIBNAME libDatModelV2_dictrflx
77-
NO_ROOTMAP
78-
FIXTURES_SETUP root-io-datamodelevolution-01-libDatModelV2_dictrflx-fixture)
71+
ROOTTEST_GENERATE_REFLEX_DICTIONARY(libDatModelV2_dictrflx
72+
DataModelV2.h
73+
SELECTION DataModelV2_selection.xml
74+
LIBNAME libDatModelV2_dictrflx
75+
NO_ROOTMAP
76+
FIXTURES_SETUP root-io-datamodelevolution-01-libDatModelV2_dictrflx-fixture)
7977

80-
ROOTTEST_ADD_TEST(rtest3
81-
MACRO test3.cxx+
82-
MACROARG "\"r\""
83-
OUTREF rtest3.ref
84-
LABELS longtest
85-
FIXTURES_REQUIRED root-io-datamodelevolution-01-libDatModelV2_dictrflx-fixture
86-
root-io-datamodelevolution-01-rtest1-fixture
87-
root-io-datamodelevolution-01-test3-compile-fixture)
88-
endif()
78+
ROOTTEST_ADD_TEST(rtest3
79+
MACRO test3.cxx+
80+
MACROARG "\"r\""
81+
OUTREF rtest3.ref
82+
LABELS longtest
83+
FIXTURES_REQUIRED root-io-datamodelevolution-01-libDatModelV2_dictrflx-fixture
84+
root-io-datamodelevolution-01-rtest1-fixture
85+
root-io-datamodelevolution-01-test3-compile-fixture)
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
# there is problem parsing XML file on Windows, therefore reflex dictionary generation fails
2-
if (NOT MSVC OR win_broken_tests)
3-
ROOTTEST_GENERATE_REFLEX_DICTIONARY(ioReadRuleEquivalentCode
4-
ioReadRuleEquivalentCode.h
5-
SELECTION ioReadRuleEquivalentCode_selection.xml
6-
FIXTURES_SETUP root-io-evolution-equivalent-ioReadRuleEquivalentCode-fixture)
1+
ROOTTEST_GENERATE_REFLEX_DICTIONARY(ioReadRuleEquivalentCode
2+
ioReadRuleEquivalentCode.h
3+
SELECTION ioReadRuleEquivalentCode_selection.xml
4+
FIXTURES_SETUP root-io-evolution-equivalent-ioReadRuleEquivalentCode-fixture)
75

8-
ROOTTEST_ADD_TEST(ioReadRuleEquivalentCode
9-
MACRO execioReadRuleEquivalentCode.C
10-
OUTREF execioReadRuleEquivalentCode.ref
11-
COPY_TO_BUILDDIR ioReadRuleEquivalentCode.root
12-
LABELS longtest io
13-
FIXTURES_REQUIRED root-io-evolution-equivalent-ioReadRuleEquivalentCode-fixture)
14-
endif()
6+
ROOTTEST_ADD_TEST(ioReadRuleEquivalentCode
7+
MACRO execioReadRuleEquivalentCode.C
8+
OUTREF execioReadRuleEquivalentCode.ref
9+
COPY_TO_BUILDDIR ioReadRuleEquivalentCode.root
10+
LABELS longtest io
11+
FIXTURES_REQUIRED root-io-evolution-equivalent-ioReadRuleEquivalentCode-fixture)

roottest/root/meta/genreflex/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,7 @@ ROOTTEST_ADD_TEST(attributesCheck
240240
FIXTURES_REQUIRED root-meta-genreflex-attributesCheck-fixture)
241241

242242
# ROOT-3746
243-
if(NOT MSVC OR win_broken_tests) # "Error: At line 4. Bad tag: />" there is no error and no such substring at line 4...
244243
ROOTTEST_ADD_TEST(unusedReadRule
245244
COMMAND ${ROOT_genreflex_CMD} ${CMAKE_CURRENT_SOURCE_DIR}/classes_root_3746.h
246245
--select=${CMAKE_CURRENT_SOURCE_DIR}/sel_root_3746.xml
247246
ERRREF root_3746.eref)
248-
endif()

roottest/root/meta/genreflex/ROOT-5594/CMakeLists.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
# OUTREF execdummy.ref
66
# DEPENDS ${GENERATE_REFLEX_TEST})
77

8-
if(NOT MSVC OR win_broken_tests)
9-
ROOTTEST_ADD_TEST(5594
10-
COMMAND ${ROOT_genreflex_CMD} ${CMAKE_CURRENT_SOURCE_DIR}/AliAODPid.h
11-
-o AliAODPid.cxx
12-
--select=${CMAKE_CURRENT_SOURCE_DIR}/AliAODPid_selection.xml)
13-
endif()
8+
ROOTTEST_ADD_TEST(5594
9+
COMMAND ${ROOT_genreflex_CMD} ${CMAKE_CURRENT_SOURCE_DIR}/AliAODPid.h
10+
-o AliAODPid.cxx
11+
--select=${CMAKE_CURRENT_SOURCE_DIR}/AliAODPid_selection.xml)

0 commit comments

Comments
 (0)