Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 39 additions & 29 deletions .github/workflows/gtest.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: gtest

on:
push:
branches:
- master
pull_request:
- push
- pull_request

jobs:
gtest:
Expand All @@ -14,38 +12,50 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout Sentry Native
uses: actions/checkout@v4
- name: Figure out version
id: tag
run: |
TAG=$(git describe --tags --abbrev=0)
COMMITS_SINCE_TAG=$(git rev-list ${TAG}..HEAD --count)
if [ "${COMMITS_SINCE_TAG}" -eq 0 ]; then
echo "VERSION=${VERSION}" >> $GITHUB_ENV
else
echo "VERSION="$(git describe --tags --abbrev=8) >> $GITHUB_ENV
fi
- name: Cache Conan2 dependencies
uses: actions/cache@v3
with:
repository: getsentry/sentry-native
path: sentry-native
- name: Apt dance
run: sudo apt-get update
- name: Install libcurl
run: sudo apt-get install libcurl4-openssl-dev
path: ~/.conan2
key: ${{ runner.os }}-conan2-${{ hashFiles('**/conanfile.py') }}
restore-keys: |
${{ runner.os }}-conan2-
- name: Set up Python 3.8 for gcovr
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: install gcovr 5.0
run: |
pip install gcovr==5.0 # 5.1 is not supported
- name: SonarQube install
uses: SonarSource/sonarcloud-github-c-cpp@v3
- name: Make build directory
run: mkdir gtest-build
- name: CMake
run: cmake -S . -B gtest-build -DCMAKE_BUILD_TYPE=Debug
- name: Install Conan
run: pip install conan
- name: Configure Conan Profile
run: |
conan profile detect -e
conan remote add conan-nexus https://nexus.cridland.io/repository/dwd-conan --force
conan remote login conan-nexus ci --password ${{ secrets.NEXUS_PASSWORD }}
- name: Conan Deps
run: conan install . --output-folder=gh-build -s build_type=Debug -s compiler.cppstd=gnu23 -b missing --version=${{ env.VERSION }}
- name: Create package
run: conan create . --version=${{ env.VERSION }}
- name: Conan deps for tests
run: cd test && conan install . --output-folder=. -s build_type=Debug -s compiler.cppstd=gnu23 -b missing --version=${{ env.VERSION }}
- name: CMake tests
run: cd test && cmake -B gh-build -DCMAKE_BUILD_TYPE=Debug
- name: Build Wrapper
run: build-wrapper-linux-x86-64 --out-dir sonar-out cmake --build gtest-build
- name: Run Tests
run: cd ./gtest-build && ./rapidxml-test
- name: Show coverage
run: cd ./gtest-build && gcovr -r ..
- name: Collate coverage
run: cd ./gtest-build && gcovr -r .. --sonarqube >../coverage.xml
run: cd test && build-wrapper-linux-x86-64 --out-dir sonar-out cmake --build gh-build
- name: Sonar Scanner
run: sonar-scanner --define sonar.cfamily.compile-commands=sonar-out/compile_commands.json --define sonar.coverageReportPaths=coverage.xml
run: cd test && sonar-scanner --define sonar.cfamily.compile-commands=sonar-out/compile_commands.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Run Tests
run: cd test/gh-build && ./rapidxml-test
- name: Upload
run: conan upload -r conan-nexus --confirm 'flxml/*'
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# RapidXML
## Dave's Version
# FLXML
## Or -- RapidXML, Dave's Version

Hey! This is RapidXML, an ancient C++ library for parsing XML quickly and flexibly.
Hey! This is a fork of RapidXML, an ancient C++ library for parsing XML quickly and flexibly. To distinguish, this version is called "FLXML", for "Fast/Light XML". Hey, it's a name.

There's a lot of forks of this around, and I (Dave Cridland) didn't write the vast majority of this library - instead, it was written by someone called Marcin Kalicinski, and his copyright is dated 2009.

## Version 2, Breaking Changes

This is version 2.x. You might not want this.
This is version 2.x. You might not want this, since it introduces a number of breaking changes from rapidxml. The rapidxml-like library is available, with breaking changes, by including `rapidxml.hpp` as before, within the `rapidxml` namespace - however this is an alias to the `flxml` namespace defined in `flxml.h`.

It has breaking changes, the largest of which are:
* No more case insensitive option. Really, nobody should be using XML case insensitively anyway, but it was too difficult to keep around, sorry.
Expand All @@ -28,12 +28,12 @@ Internal changes:

New features:
* Instead of the `doc->allocate_node` / `node->append_node` dance, you can now `node->append_element(name, value)`, where `name` can be either a `string` (or `string_view`, etc) or a tuple like {xmlns, local_name}, which will set an xmlns attribute if needed.
* There's a xpathish thing going on in `rapidxml_predicates`, which lets you search for (or iterate through) elements using a trivial subset of XPath.
* There's a xpathish thing going on in `flxml/predicates.h`, which lets you search for (or iterate through) elements using a trivial subset of XPath.
* You can get access to containerish things in rapidxml_iterators by methods on nodes/documents, as `node.children()`, `node.attributes()` and a new `node.descendants()`.

### Fun

The rapidxml_iterators library is now included in rapidxml.hpp, and you can do amusing things like:
The rapidxml_iterators library is now included in `flxml.h`, and you can do amusing things like:

```c++
for (auto & child : node.children()) {
Expand All @@ -46,7 +46,7 @@ More in [test/iterators.cpp](./test/iterators.cpp)
Of course, in this case it might be simpler to:

```c++
auto xpath = rapidxml::xpath::parse("/potato");
auto xpath = flxml::xpath::parse("/potato");
for (auto & child : xp->all(node)) {
scream_for(joy);
}
Expand Down Expand Up @@ -77,10 +77,10 @@ The other thing this fork added was a file of simple tests, which I've recently

The original makes reference to an expansive test suite, but this was not included in the open source release. I'll expand these tests as and when I need to.

The tests use a driver which can optionally use Sentry for performance/error tracking; to enable, use the CMake option RAPIDXML_SENTRY, and clone the [sentry-native](https://github.com/getsentry/sentry-native) repository into the root, and when running `rapidxml-test`, set SENTRY_DSN in the environment. None of the submodules are needed, but it'll need libcurl, so `sudo apt install libcurl4-openssl-dev`.
The tests use a driver which can optionally use Sentry for performance/error tracking; to enable, use the CMake option RAPIDXML_SENTRY, and clone the [sentry-native](https://github.com/getsentry/sentry-native) repository into the root, and when running `rapidxml-test`, set SENTRY_DSN in the environment.

## Pull Requests
The tests are in a different Conan package, to keep things light and simple.

Erm. I didn't expect any, so never set up any of the infrastructure for them - this was really a fork-of-convenience for me. Not that they're unwelcome, of course, just entirely unexpected.
## Pull Requests

But yeah, go for it, just include an assurance you're happy with the licensing.
Pull request are very welcome, but do ensure you're happy with the licensing first.
16 changes: 16 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from conan import ConanFile
from conan.tools.files import copy

class FLXML(ConanFile):
name = "flxml"
exports_sources = "include/*"
no_copy_source = True

def package(self):
copy(self, "include/*.hpp", self.source_folder, self.package_folder)
copy(self, "include/*.h", self.source_folder, self.package_folder)

def package_info(self):
self.cpp_info.includedirs = ['include']
self.cpp_info.libdirs = []
self.cpp_info.bindirs = []
Loading
Loading