Compare commits
9 Commits
fix-docs-t
...
fix-source
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4da14a32d7 | ||
|
|
7be848b8a1 | ||
|
|
66534af3fc | ||
|
|
8ae47dd766 | ||
|
|
079758e154 | ||
|
|
11c0305119 | ||
|
|
72013f8725 | ||
|
|
44c1a6cae4 | ||
|
|
a6962866d6 |
@@ -1,6 +1,8 @@
|
|||||||
compilation_database_dir: debug
|
compilation_database_dir: debug
|
||||||
output_directory: docs/diagrams
|
output_directory: docs/diagrams
|
||||||
comment_parser: clang
|
comment_parser: clang
|
||||||
|
add_compile_flags:
|
||||||
|
- -Wno-deprecated-declarations
|
||||||
remove_compile_flags:
|
remove_compile_flags:
|
||||||
- -Wno-class-memaccess
|
- -Wno-class-memaccess
|
||||||
- -Wno-dangling-reference
|
- -Wno-dangling-reference
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
### 0.4.2
|
||||||
* Fixed random typos and omissions in docs (#208)
|
* Fixed random typos and omissions in docs (#208)
|
||||||
* Fixed handling of diagram hyperlinks with sources outside of project dir (#213)
|
* Fixed handling of diagram hyperlinks with sources outside of project dir (#213)
|
||||||
* Fixed test case t00014 on macos (#176)
|
* Fixed test case t00014 on macos (#176)
|
||||||
|
|||||||
2
Doxyfile
2
Doxyfile
@@ -38,7 +38,7 @@ PROJECT_NAME = "clang-uml"
|
|||||||
# could be handy for archiving the generated documentation or if some version
|
# could be handy for archiving the generated documentation or if some version
|
||||||
# control system is used.
|
# control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER = 0.4.1
|
PROJECT_NUMBER = 0.4.2
|
||||||
|
|
||||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||||
# for a project that appears at the top of each page and should give viewer a
|
# for a project that appears at the top of each page and should give viewer a
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
[](https://github.com/bkryza/clang-uml/actions)
|
[](https://github.com/bkryza/clang-uml/actions)
|
||||||
[](https://codecov.io/gh/bkryza/clang-uml)
|
[](https://codecov.io/gh/bkryza/clang-uml)
|
||||||
[](https://github.com/bkryza/clang-uml/releases)
|
[](https://github.com/bkryza/clang-uml/releases)
|
||||||
[](https://github.com/bkryza/clang-uml/releases)
|
[](https://github.com/bkryza/clang-uml/releases)
|
||||||
[](https://clang-uml.github.io)
|
[](https://clang-uml.github.io)
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ else(LINK_LLVM_SHARED)
|
|||||||
LLVMWindowsDriver
|
LLVMWindowsDriver
|
||||||
LLVMWindowsManifest)
|
LLVMWindowsManifest)
|
||||||
endif()
|
endif()
|
||||||
|
if(${LLVM_PACKAGE_VERSION} VERSION_GREATER_EQUAL "17.0")
|
||||||
|
list(APPEND LIBTOOLING_LIBS clangASTMatchers)
|
||||||
|
endif()
|
||||||
endif(MSVC)
|
endif(MSVC)
|
||||||
endif(LINK_LLVM_SHARED)
|
endif(LINK_LLVM_SHARED)
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#### Ubuntu
|
#### Ubuntu
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Currently supported Ubuntu versions are Focal, Jammy and Lunar
|
# Currently supported Ubuntu versions are Focal, Jammy, Lunar and Mantic
|
||||||
sudo add-apt-repository ppa:bkryza/clang-uml
|
sudo add-apt-repository ppa:bkryza/clang-uml
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install clang-uml
|
sudo apt install clang-uml
|
||||||
@@ -32,17 +32,17 @@ sudo apt install clang-uml
|
|||||||
#### Fedora
|
#### Fedora
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Fedora 36
|
|
||||||
wget https://github.com/bkryza/clang-uml/releases/download/0.4.1/clang-uml-0.4.1-1.fc36.x86_64.rpm
|
|
||||||
sudo dnf install ./clang-uml-0.4.1-1.fc36.x86_64.rpm
|
|
||||||
|
|
||||||
# Fedora 37
|
# Fedora 37
|
||||||
wget https://github.com/bkryza/clang-uml/releases/download/0.4.1/clang-uml-0.4.1-1.fc37.x86_64.rpm
|
wget https://github.com/bkryza/clang-uml/releases/download/0.4.2/clang-uml-0.4.2-1.fc37.x86_64.rpm
|
||||||
sudo dnf install ./clang-uml-0.4.1-1.fc37.x86_64.rpm
|
sudo dnf install ./clang-uml-0.4.2-1.fc37.x86_64.rpm
|
||||||
|
|
||||||
# Fedora 38
|
# Fedora 38
|
||||||
wget https://github.com/bkryza/clang-uml/releases/download/0.4.1/clang-uml-0.4.1-1.fc38.x86_64.rpm
|
wget https://github.com/bkryza/clang-uml/releases/download/0.4.2/clang-uml-0.4.2-1.fc38.x86_64.rpm
|
||||||
sudo dnf install ./clang-uml-0.4.1-1.fc38.x86_64.rpm
|
sudo dnf install ./clang-uml-0.4.2-1.fc38.x86_64.rpm
|
||||||
|
|
||||||
|
# Fedora 39
|
||||||
|
wget https://github.com/bkryza/clang-uml/releases/download/0.4.2/clang-uml-0.4.2-1.fc39.x86_64.rpm
|
||||||
|
sudo dnf install ./clang-uml-0.4.2-1.fc39.x86_64.rpm
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Conda
|
#### Conda
|
||||||
@@ -171,7 +171,7 @@ bin\clang-uml.exe --version
|
|||||||
```
|
```
|
||||||
It should produce something like:
|
It should produce something like:
|
||||||
```bash
|
```bash
|
||||||
clang-uml 0.4.1
|
clang-uml 0.4.2
|
||||||
Copyright (C) 2021-2023 Bartek Kryza <bkryza@gmail.com>
|
Copyright (C) 2021-2023 Bartek Kryza <bkryza@gmail.com>
|
||||||
Linux x86_64 6.2.0-36-generic
|
Linux x86_64 6.2.0-36-generic
|
||||||
Built against LLVM/Clang libraries version: 17.0.3
|
Built against LLVM/Clang libraries version: 17.0.3
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ rpm:
|
|||||||
echo "############################"
|
echo "############################"
|
||||||
#rm -rf $(build_dir)
|
#rm -rf $(build_dir)
|
||||||
mkdir -p $(build_dir)
|
mkdir -p $(build_dir)
|
||||||
dnf install -y fedora-packager rpmdevtools gcc cmake git clang-devel clang-tools-extra ccache yaml-cpp llvm-devel wget yaml-cpp-devel
|
dnf install -y fedora-packager rpmdevtools gcc gdb cmake git clang-devel clang-tools-extra ccache yaml-cpp llvm-devel wget yaml-cpp-devel
|
||||||
rpmdev-setuptree
|
rpmdev-setuptree
|
||||||
cp $(build_dir)/$(SOURCE_ARCHIVE_RPM) /root/rpmbuild/SOURCES/
|
cp $(build_dir)/$(SOURCE_ARCHIVE_RPM) /root/rpmbuild/SOURCES/
|
||||||
cp fedora/clang-uml.spec /root/rpmbuild/SPECS/
|
cp fedora/clang-uml.spec /root/rpmbuild/SPECS/
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ cd packaging
|
|||||||
make DIST=focal deb
|
make DIST=focal deb
|
||||||
make DIST=jammy deb
|
make DIST=jammy deb
|
||||||
make DIST=lunar deb
|
make DIST=lunar deb
|
||||||
|
make DIST=mantic deb
|
||||||
|
|
||||||
cd _BUILD/ubuntu/focal
|
cd _BUILD/ubuntu/focal
|
||||||
dput ppa:bkryza/clang-uml *.changes
|
dput ppa:bkryza/clang-uml *.changes
|
||||||
@@ -17,17 +18,20 @@ dput ppa:bkryza/clang-uml *.changes
|
|||||||
cd _BUILD/ubuntu/jammy
|
cd _BUILD/ubuntu/jammy
|
||||||
dput ppa:bkryza/clang-uml *.changes
|
dput ppa:bkryza/clang-uml *.changes
|
||||||
|
|
||||||
cd _BUILD/ubuntu/kinetic
|
cd _BUILD/ubuntu/lunar
|
||||||
dput ppa:bkryza/clang-uml *.changes
|
dput ppa:bkryza/clang-uml *.changes
|
||||||
|
|
||||||
|
cd _BUILD/ubuntu/mantic
|
||||||
|
dput ppa:bkryza/clang-uml *.changes
|
||||||
```
|
```
|
||||||
|
|
||||||
## Fedora
|
## Fedora
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd clang-uml
|
cd clang-uml
|
||||||
make fedora_36
|
make fedora/37
|
||||||
make fedora_37
|
make fedora/38
|
||||||
|
make fedora/39
|
||||||
find packaging/_BUILD/fedora
|
find packaging/_BUILD/fedora
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -37,6 +41,7 @@ find packaging/_BUILD/fedora
|
|||||||
docker run --rm -v $PWD:$PWD -it continuumio/miniconda3 bash
|
docker run --rm -v $PWD:$PWD -it continuumio/miniconda3 bash
|
||||||
conda install conda-build make anaconda-client
|
conda install conda-build make anaconda-client
|
||||||
cd packaging
|
cd packaging
|
||||||
|
git config --global --add safe.directory /home/bartek/devel/clang-uml
|
||||||
make CONDA_TOKEN=<TOKEN> conda
|
make CONDA_TOKEN=<TOKEN> conda
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -22,17 +22,17 @@ requirements:
|
|||||||
- {{ compiler('c') }}
|
- {{ compiler('c') }}
|
||||||
- {{ compiler('cxx') }}
|
- {{ compiler('cxx') }}
|
||||||
- conda-forge::pkg-config
|
- conda-forge::pkg-config
|
||||||
- conda-forge::yaml-cpp 0.7.0
|
- conda-forge::yaml-cpp 0.8.0
|
||||||
- conda-forge::clangdev 15.0.6
|
- conda-forge::clangdev 17.0.6
|
||||||
- conda-forge::libclang 15.0.6
|
- conda-forge::libclang 17.0.6
|
||||||
- conda-forge::libclang-cpp 15.0.6
|
- conda-forge::libclang-cpp 17.0.6
|
||||||
- conda-forge::cmake
|
- conda-forge::cmake
|
||||||
- conda-forge::git
|
- conda-forge::git
|
||||||
- conda-forge::make # [unix]
|
- conda-forge::make # [unix]
|
||||||
run:
|
run:
|
||||||
- conda-forge::yaml-cpp 0.7.0
|
- conda-forge::yaml-cpp 0.8.0
|
||||||
- conda-forge::libclang 15.0.6
|
- conda-forge::libclang 17.0.6
|
||||||
- conda-forge::libclang-cpp 15.0.6
|
- conda-forge::libclang-cpp 17.0.6
|
||||||
|
|
||||||
test:
|
test:
|
||||||
commands:
|
commands:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ Source: clang-uml
|
|||||||
Maintainer: Bartek Kryza <bkryza@gmail.com>
|
Maintainer: Bartek Kryza <bkryza@gmail.com>
|
||||||
Section: devel
|
Section: devel
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Build-Depends: debhelper, git, make, gcc-10, g++-10, cmake (>= 3.16), libyaml-cpp-dev, llvm-12, llvm-12-dev, clang-12, libclang-12-dev, libclang-cpp12-dev, bash-completion
|
Build-Depends: debhelper, git, make, ccache, pkg-config, gcc-10, g++-10, gdb, cmake (>= 3.16), libyaml-cpp-dev, llvm-12, llvm-12-dev, clang-12, libclang-12-dev, libclang-cpp12-dev, bash-completion, libdw-dev, libunwind-dev
|
||||||
Standards-Version: 4.3.0
|
Standards-Version: 4.3.0
|
||||||
Vcs-Browser: https://github.com/bkryza/clang-uml
|
Vcs-Browser: https://github.com/bkryza/clang-uml
|
||||||
Vcs-Git: https://github.com/bkryza/clang-uml.git
|
Vcs-Git: https://github.com/bkryza/clang-uml.git
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ Source: clang-uml
|
|||||||
Maintainer: Bartek Kryza <bkryza@gmail.com>
|
Maintainer: Bartek Kryza <bkryza@gmail.com>
|
||||||
Section: devel
|
Section: devel
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Build-Depends: debhelper, git, make, gcc-11, g++-11, cmake (>= 3.16), libyaml-cpp-dev, llvm-15, llvm-15-dev, clang-15, libclang-15-dev, libclang-cpp15-dev, bash-completion, dh-sequence-bash-completion
|
Build-Depends: debhelper, git, make, ccache, pkg-config, gcc-11, g++-11, gdb, cmake (>= 3.16), libyaml-cpp-dev, llvm-15, llvm-15-dev, clang-15, libclang-15-dev, libclang-cpp15-dev, bash-completion, dh-sequence-bash-completion, libdw-dev, libunwind-dev
|
||||||
Standards-Version: 4.3.0
|
Standards-Version: 4.3.0
|
||||||
Vcs-Browser: https://github.com/bkryza/clang-uml
|
Vcs-Browser: https://github.com/bkryza/clang-uml
|
||||||
Vcs-Git: https://github.com/bkryza/clang-uml.git
|
Vcs-Git: https://github.com/bkryza/clang-uml.git
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ Source: clang-uml
|
|||||||
Maintainer: Bartek Kryza <bkryza@gmail.com>
|
Maintainer: Bartek Kryza <bkryza@gmail.com>
|
||||||
Section: devel
|
Section: devel
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Build-Depends: debhelper, git, make, gcc, g++, cmake (>= 3.16), libyaml-cpp-dev, llvm-16, llvm-16-dev, clang-16, clang-tools-16, libclang-16-dev, libclang-cpp16-dev, libmlir-16-dev, mlir-16-tools, bash-completion, dh-sequence-bash-completion
|
Build-Depends: debhelper, git, make, ccache, pkg-config, gcc-12, g++-12, gdb, cmake (>= 3.16), libyaml-cpp-dev, llvm-16, llvm-16-dev, clang-16, clang-tools-16, libclang-16-dev, libclang-cpp16-dev, libmlir-16-dev, mlir-16-tools, bash-completion, dh-sequence-bash-completion, libdw-dev, libunwind-dev
|
||||||
Standards-Version: 4.3.0
|
Standards-Version: 4.3.0
|
||||||
Vcs-Browser: https://github.com/bkryza/clang-uml
|
Vcs-Browser: https://github.com/bkryza/clang-uml
|
||||||
Vcs-Git: https://github.com/bkryza/clang-uml.git
|
Vcs-Git: https://github.com/bkryza/clang-uml.git
|
||||||
|
|||||||
19
packaging/debian/control.mantic
Normal file
19
packaging/debian/control.mantic
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
Source: clang-uml
|
||||||
|
Maintainer: Bartek Kryza <bkryza@gmail.com>
|
||||||
|
Section: devel
|
||||||
|
Priority: optional
|
||||||
|
Build-Depends: debhelper, git, make, ccache, pkg-config, gcc-13, g++-13, gdb, cmake (>= 3.16), libyaml-cpp-dev, llvm-16, llvm-16-dev, clang-16, clang-tools-16, libclang-16-dev, libclang-cpp16-dev, libmlir-16-dev, mlir-16-tools, bash-completion, dh-sequence-bash-completion, libdw-dev, libunwind-dev
|
||||||
|
Standards-Version: 4.3.0
|
||||||
|
Vcs-Browser: https://github.com/bkryza/clang-uml
|
||||||
|
Vcs-Git: https://github.com/bkryza/clang-uml.git
|
||||||
|
Homepage: https://github.com/bkryza/clang-uml
|
||||||
|
|
||||||
|
|
||||||
|
Package: clang-uml
|
||||||
|
Architecture: any
|
||||||
|
Section: utils
|
||||||
|
Depends: ${misc:Depends}, ${shlibs:Depends}, clang-16
|
||||||
|
Pre-Depends: ${misc:Pre-Depends}
|
||||||
|
Description: Automatic C++ UML diagram generator based on Clang.
|
||||||
|
.
|
||||||
|
This package provides the clang-uml binary.
|
||||||
@@ -13,8 +13,9 @@ override_dh_auto_configure:
|
|||||||
-DGIT_VERSION={{VERSION}} \
|
-DGIT_VERSION={{VERSION}} \
|
||||||
-DBUILD_TESTS=OFF
|
-DBUILD_TESTS=OFF
|
||||||
|
|
||||||
|
.PHONY: override_dh_strip
|
||||||
override_dh_strip:
|
override_dh_strip:
|
||||||
dh_strip --dbgsym-migration='clang-uml-dbg (<<{{VERSION}}-1~)'
|
dh_strip --automatic-dbgsym
|
||||||
|
|
||||||
%:
|
%:
|
||||||
dh $@ --with bash-completion
|
dh $@ --with bash-completion
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ BuildRequires: clang-tools-extra
|
|||||||
BuildRequires: ccache
|
BuildRequires: ccache
|
||||||
BuildRequires: yaml-cpp-devel
|
BuildRequires: yaml-cpp-devel
|
||||||
BuildRequires: llvm-devel
|
BuildRequires: llvm-devel
|
||||||
|
BuildRequires: gdb
|
||||||
|
|
||||||
Requires: clang
|
Requires: clang
|
||||||
Requires: yaml-cpp
|
Requires: yaml-cpp
|
||||||
|
|||||||
@@ -30,7 +30,9 @@ target_compile_options(clang-umllib PRIVATE
|
|||||||
$<$<CXX_COMPILER_ID:MSVC>:/MP /W1 /bigobj /wd4291 /wd4624 /wd4244>)
|
$<$<CXX_COMPILER_ID:MSVC>:/MP /W1 /bigobj /wd4291 /wd4624 /wd4244>)
|
||||||
target_compile_definitions(clang-umllib PRIVATE
|
target_compile_definitions(clang-umllib PRIVATE
|
||||||
$<$<CXX_COMPILER_ID:MSVC>:
|
$<$<CXX_COMPILER_ID:MSVC>:
|
||||||
-DLLVM_FORCE_USE_OLD_TOOLCHAIN>)
|
-DLLVM_FORCE_USE_OLD_TOOLCHAIN
|
||||||
|
-DTERMCOLOR_USE_WINDOWS_API=1
|
||||||
|
-DTERMCOLOR_TARGET_WINDOWS=1>)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Define the target executable clang-uml
|
# Define the target executable clang-uml
|
||||||
|
|||||||
@@ -836,12 +836,23 @@ bool parse_source_location(const std::string &location_str, std::string &file,
|
|||||||
if (tokens.size() < 3)
|
if (tokens.size() < 3)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (tokens.size() == 4) {
|
||||||
|
// Handle Windows paths
|
||||||
|
decltype(tokens) tmp_tokens{};
|
||||||
|
tmp_tokens.emplace_back(
|
||||||
|
fmt::format("{}:{}", tokens.at(0), tokens.at(1)));
|
||||||
|
tmp_tokens.emplace_back(tokens.at(2));
|
||||||
|
tmp_tokens.emplace_back(tokens.at(3));
|
||||||
|
|
||||||
|
tokens = std::move(tmp_tokens);
|
||||||
|
}
|
||||||
|
|
||||||
file = tokens.at(0);
|
file = tokens.at(0);
|
||||||
try {
|
try {
|
||||||
line = std::stoi(tokens.at(1));
|
line = std::stoi(tokens.at(1));
|
||||||
}
|
}
|
||||||
catch (std::invalid_argument &e) {
|
catch (std::invalid_argument &e) {
|
||||||
line = 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -39,7 +39,11 @@ void progress_indicator::add_progress_bar(
|
|||||||
indicators::option::BarWidth{kBarWidth},
|
indicators::option::BarWidth{kBarWidth},
|
||||||
indicators::option::ForegroundColor{color},
|
indicators::option::ForegroundColor{color},
|
||||||
indicators::option::ShowElapsedTime{true},
|
indicators::option::ShowElapsedTime{true},
|
||||||
|
#if _MSC_VER
|
||||||
|
indicators::option::Fill{"="}, indicators::option::Lead{">"},
|
||||||
|
#else
|
||||||
indicators::option::Fill{"█"}, indicators::option::Lead{"█"},
|
indicators::option::Fill{"█"}, indicators::option::Lead{"█"},
|
||||||
|
#endif
|
||||||
indicators::option::Remainder{"-"},
|
indicators::option::Remainder{"-"},
|
||||||
indicators::option::PrefixText{
|
indicators::option::PrefixText{
|
||||||
fmt::format("{:<25}", util::abbreviate(name, kPrefixTextWidth))},
|
fmt::format("{:<25}", util::abbreviate(name, kPrefixTextWidth))},
|
||||||
@@ -104,8 +108,12 @@ void progress_indicator::complete(const std::string &name)
|
|||||||
|
|
||||||
bar.set_progress(kCompleteProgressPercent);
|
bar.set_progress(kCompleteProgressPercent);
|
||||||
|
|
||||||
bar.set_option(indicators::option::PostfixText{
|
#if _MSC_VER
|
||||||
fmt::format("{}/{} ✔", p.progress, p.max)});
|
const auto postfix_text = fmt::format("{}/{} OK", p.progress, p.max);
|
||||||
|
#else
|
||||||
|
const auto postfix_text = fmt::format("{}/{} ✔", p.progress, p.max);
|
||||||
|
#endif
|
||||||
|
bar.set_option(indicators::option::PostfixText{postfix_text});
|
||||||
bar.set_option(
|
bar.set_option(
|
||||||
indicators::option::ForegroundColor{indicators::Color::green});
|
indicators::option::ForegroundColor{indicators::Color::green});
|
||||||
bar.mark_as_completed();
|
bar.mark_as_completed();
|
||||||
@@ -118,9 +126,13 @@ void progress_indicator::fail(const std::string &name)
|
|||||||
auto &bar = progress_bars_[p.index];
|
auto &bar = progress_bars_[p.index];
|
||||||
progress_bars_mutex_.unlock();
|
progress_bars_mutex_.unlock();
|
||||||
|
|
||||||
|
#if _MSC_VER
|
||||||
|
const auto postfix_text = fmt::format("{}/{} FAILED", p.progress, p.max);
|
||||||
|
#else
|
||||||
|
const auto postfix_text = fmt::format("{}/{} ✗", p.progress, p.max);
|
||||||
|
#endif
|
||||||
bar.set_option(indicators::option::ForegroundColor{indicators::Color::red});
|
bar.set_option(indicators::option::ForegroundColor{indicators::Color::red});
|
||||||
bar.set_option(indicators::option::PostfixText{
|
bar.set_option(indicators::option::PostfixText{postfix_text});
|
||||||
fmt::format("{}/{} ✗", p.progress, p.max)});
|
|
||||||
bar.mark_as_completed();
|
bar.mark_as_completed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ void translation_unit_visitor::set_source_location(
|
|||||||
file_path = fs::absolute(file_path);
|
file_path = fs::absolute(file_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
file_path = fs::canonical(file_path);
|
file_path = fs::weakly_canonical(file_path);
|
||||||
|
|
||||||
file = file_path.string();
|
file = file_path.string();
|
||||||
|
|
||||||
|
|||||||
@@ -352,6 +352,8 @@ TEST_CASE("Test config relative paths handling", "[unit-test]")
|
|||||||
CHECK(def.get_relative_to()() == "/tmp");
|
CHECK(def.get_relative_to()() == "/tmp");
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
CHECK(def.root_directory().string() == "C:\\tmp");
|
CHECK(def.root_directory().string() == "C:\\tmp");
|
||||||
|
#elif __APPLE__
|
||||||
|
CHECK(def.root_directory().string() == "/private/tmp");
|
||||||
#else
|
#else
|
||||||
CHECK(def.root_directory().string() == "/tmp");
|
CHECK(def.root_directory().string() == "/tmp");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -430,3 +430,47 @@ TEST_CASE("Test is_relative_to", "[unit-test]")
|
|||||||
CHECK(is_relative_to(child, base1));
|
CHECK(is_relative_to(child, base1));
|
||||||
CHECK_FALSE(is_relative_to(child, base2));
|
CHECK_FALSE(is_relative_to(child, base2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("Test parse_source_location", "[unit-test]")
|
||||||
|
{
|
||||||
|
using namespace clanguml::common;
|
||||||
|
|
||||||
|
const std::string int_template_str{"ns1::ns2::class1<int>"};
|
||||||
|
|
||||||
|
std::string file;
|
||||||
|
unsigned line{};
|
||||||
|
unsigned column{};
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
result = parse_source_location("/a/b/c/d/test.cpp:123", file, line, column);
|
||||||
|
|
||||||
|
CHECK_FALSE(result);
|
||||||
|
|
||||||
|
result = false, file = "", line = 0, column = 0;
|
||||||
|
result =
|
||||||
|
parse_source_location("/a/b/c/d/test.cpp:123:456", file, line, column);
|
||||||
|
|
||||||
|
CHECK(result);
|
||||||
|
CHECK(file == "/a/b/c/d/test.cpp");
|
||||||
|
CHECK(line == 123);
|
||||||
|
CHECK(column == 456);
|
||||||
|
|
||||||
|
result = false, file = "", line = 0, column = 0;
|
||||||
|
|
||||||
|
result = parse_source_location(
|
||||||
|
"E:\\test\\src\\main.cpp:123", file, line, column);
|
||||||
|
|
||||||
|
CHECK_FALSE(result);
|
||||||
|
|
||||||
|
result = false, file = "", line = 0, column = 0;
|
||||||
|
|
||||||
|
result = parse_source_location(
|
||||||
|
"E:\\test\\src\\main.cpp:123:456", file, line, column);
|
||||||
|
|
||||||
|
CHECK(result);
|
||||||
|
CHECK(file == "E:\\test\\src\\main.cpp");
|
||||||
|
CHECK(line == 123);
|
||||||
|
CHECK(column == 456);
|
||||||
|
|
||||||
|
result = false, file = "", line = 0, column = 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user