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
1 change: 1 addition & 0 deletions .github/fedora/contour.spec
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ cmake . \
-DCONTOUR_QT_VERSION=6 \
-DPEDANTIC_COMPILER=ON \
-DPEDANTIC_COMPILER_WERROR=ON \
-DCONTOUR_TESTING=ON \
-B build \
-GNinja
cd build
Expand Down
1 change: 1 addition & 0 deletions .github/ubuntu18/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ RUN g++-10 --version
RUN cmake -S . -B build -G Ninja \
-D CMAKE_CXX_STANDARD=20 \
-D CONTOUR_QT_VERSION=5 \
-D CONTOUR_TESTING=ON \
-D CMAKE_CXX_COMPILER=g++-10

RUN cmake --build build -- -j3
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ jobs:
QTVER=${{ steps.set_vars.outputs.QTVER }}
cmake . \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCONTOUR_TESTING=ON \
-DQt${QTVER}_DIR="$(brew --prefix qt@${QTVER})/lib/cmake/Qt${QTVER}" \
-DCONTOUR_QT_VERSION=${QTVER} \
-B build/
Expand Down Expand Up @@ -351,7 +352,7 @@ jobs:
New-Item -ItemType Directory -Force -Path build
}
- name: "Generate build files"
run: cmake -DCMAKE_BUILD_TYPE=Release -DCONTOUR_QT_VERSION=6 -DLIBTERMINAL_BUILD_BENCH_HEADLESS=ON -DCMAKE_CXX_STANDARD=20 -DCMAKE_TOOLCHAIN_FILE="${{ runner.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows -DLIBTERMINAL_TESTING=ON -DLIBUNICODE_TESTING=ON -B build .
run: cmake -DCMAKE_BUILD_TYPE=Release -DCONTOUR_TESTING=ON -DCONTOUR_QT_VERSION=6 -DLIBTERMINAL_BUILD_BENCH_HEADLESS=ON -DCMAKE_CXX_STANDARD=20 -DCMAKE_TOOLCHAIN_FILE="${{ runner.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows -DLIBTERMINAL_TESTING=ON -DLIBUNICODE_TESTING=ON -B build .
- name: "Build"
run: cmake --build build/ --config Release
- name: "test: crispy"
Expand Down
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ if(NOT("${ADDR2LINE}" STREQUAL ""))
endif()
message(STATUS "addr2line: ${ADDR2LINE}")

option(CONTOUR_TESTING "Enables building of unittests for libterminal [default: ON" ON)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(MAINTAINER_MODE ON)
else()
set(MAINTAINER_MODE OFF)
endif()

option(CONTOUR_TESTING "Enables building of unittests for libterminal [default: ${MAINTAINER_MODE}]" ${MAINTAINER_MODE})
option(CONTOUR_FRONTEND_GUI "Enables GUI frontend." ON)
option(CONTOUR_COVERAGE "Builds with codecov [default: OFF]" OFF)
option(CONTOUR_SANITIZE "Builds with Address sanitizer enabled [default: OFF]" "OFF")
Expand Down
25 changes: 10 additions & 15 deletions cmake/ContourThirdParties.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ endmacro()
# Now, conditionally find all dependencies that were not included above
# via find_package, usually system installed packages.

if (TARGET Catch2::Catch2)
set(THIRDPARTY_BUILTIN_Catch2 "embedded")
else()
find_package(Catch2 REQUIRED)
set(THIRDPARTY_BUILTIN_Catch2 "system package")
if(CONTOUR_TESTING)
if(TARGET Catch2::Catch2WithMain)
set(THIRDPARTY_BUILTIN_Catch2 "embedded")
else()
find_package(Catch2 REQUIRED)
set(THIRDPARTY_BUILTIN_Catch2 "system package")
endif()
endif()

if(TARGET fmt)
Expand Down Expand Up @@ -102,17 +104,10 @@ endif()

find_package(libunicode)
if(libunicode_FOUND)
set(THIRDPARTY_BUILTIN_unicode_core "system package")
set(LIBUNICODE_LIBS unicode::unicode)
set(THIRDPARTY_BUILTIN_unicode_core "system package (${libunicode_VERSION})")
else()
ContourThirdParties_Embed_libunicode()
if (TARGET unicode::core)
set(THIRDPARTY_BUILTIN_unicode_core "embedded")
set(LIBUNICODE_LIBS unicode::core)
elseif(TARGET unicode::unicode)
set(THIRDPARTY_BUILTIN_unicode_core "system package (pre-provided)")
set(LIBUNICODE_LIBS unicode::unicode)
endif()
set(THIRDPARTY_BUILTIN_unicode_core "embedded")
endif()

if(LIBTERMINAL_BUILD_BENCH_HEADLESS)
Expand Down Expand Up @@ -146,7 +141,7 @@ macro(ContourThirdPartiesSummary2)
message(STATUS "harfbuzz ${THIRDPARTY_BUILTIN_harfbuzz}")
message(STATUS "range-v3 ${THIRDPARTY_BUILTIN_range_v3}")
message(STATUS "termbench-pro ${THIRDPARTY_BUILTIN_termbench}")
message(STATUS "libunicode ${THIRDPARTY_BUILTIN_unicode_core} (${LIBUNICODE_LIBS})")
message(STATUS "libunicode ${THIRDPARTY_BUILTIN_unicode_core}")
message(STATUS "yaml-cpp ${THIRDPARTY_BUILTIN_yaml_cpp}")
message(STATUS "boxed-cpp ${THIRDPARTY_BUILTIN_boxed_cpp}")
message(STATUS "------------------------------------------------------------------------------")
Expand Down
1 change: 1 addition & 0 deletions scripts/ci-prepare-contour.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ prepare_build_ubuntu()
{
cmake \
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
-DCONTOUR_TESTING=ON \
-S . -B ${BUILD_DIR} \
${EXTRA_CMAKE_FLAGS}
}
Expand Down
12 changes: 6 additions & 6 deletions scripts/install-deps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ $ThirdParties =
Macro = ""
};
[ThirdParty]@{
Folder = "Catch2-2.13.10";
Archive = "Catch2-2.13.10.zip";
URI = "https://github.com/catchorg/Catch2/archive/refs/tags/v2.13.10.zip";
Folder = "Catch2-3.4.0";
Archive = "Catch2-3.4.0.zip";
URI = "https://github.com/catchorg/Catch2/archive/refs/tags/v3.4.0.zip";
Macro = ""
};
[ThirdParty]@{
Folder = "libunicode-b1b017c466038655872e1968acfc6a9880cf5d9f";
Archive = "libunicode-b1b017c466038655872e1968acfc6a9880cf5d9f.zip";
URI = "https://github.com/contour-terminal/libunicode/archive/b1b017c466038655872e1968acfc6a9880cf5d9f.zip";
Folder = "libunicode-c1474ddc3a90366629d61863628b8d41cd764fa8";
Archive = "libunicode-c1474ddc3a90366629d61863628b8d41cd764fa8.zip";
URI = "https://github.com/contour-terminal/libunicode/archive/c1474ddc3a90366629d61863628b8d41cd764fa8.zip";
Macro = "libunicode"
};
[ThirdParty]@{
Expand Down
8 changes: 4 additions & 4 deletions scripts/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ fetch_and_unpack()
fetch_and_unpack_Catch2()
{
fetch_and_unpack \
Catch2-2.13.10 \
Catch2-2.13.10.tar.gz \
https://github.com/catchorg/Catch2/archive/refs/tags/v2.13.10.tar.gz
Catch2-3.4.0 \
Catch2-3.4.0.tar.gz \
https://github.com/catchorg/Catch2/archive/refs/tags/v3.4.0.tar.gz
}

fetch_and_unpack_fmtlib()
Expand Down Expand Up @@ -121,7 +121,7 @@ fetch_and_unpack_boxed()
fetch_and_unpack_libunicode()
{
if test x$LIBUNICODE_SRC_DIR = x; then
local libunicode_git_sha="b1b017c466038655872e1968acfc6a9880cf5d9f"
local libunicode_git_sha="c1474ddc3a90366629d61863628b8d41cd764fa8"
fetch_and_unpack \
libunicode-$libunicode_git_sha \
libunicode-$libunicode_git_sha.tar.gz \
Expand Down
2 changes: 1 addition & 1 deletion src/crispy/BufferObject_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
#include <crispy/BufferObject.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

TEST_CASE("buffer_object", "[buffer_object]")
{
Expand Down
2 changes: 1 addition & 1 deletion src/crispy/CLI_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <fmt/format.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

// TODO API / impl:
//
Expand Down
5 changes: 2 additions & 3 deletions src/crispy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if(MSVC)
target_compile_definitions(crispy-core PUBLIC NOMINMAX)
endif()

set(CRISPY_CORE_LIBS range-v3::range-v3 fmt::fmt-header-only unicode Microsoft.GSL::GSL boxed-cpp::boxed-cpp)
set(CRISPY_CORE_LIBS range-v3::range-v3 fmt::fmt-header-only unicode::unicode Microsoft.GSL::GSL boxed-cpp::boxed-cpp)

if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL amd64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL AMD64)
target_compile_options(crispy-core PUBLIC -maes)
Expand Down Expand Up @@ -127,10 +127,9 @@ if(CRISPY_TESTING)
utils_test.cpp
ring_test.cpp
sort_test.cpp
test_main.cpp
times_test.cpp
)
target_link_libraries(crispy_test fmt::fmt-header-only range-v3::range-v3 Catch2::Catch2 crispy::core)
target_link_libraries(crispy_test fmt::fmt-header-only range-v3::range-v3 Catch2::Catch2WithMain crispy::core)
add_test(crispy_test ./crispy_test)
endif()
message(STATUS "[crispy] Compile unit tests: ${CRISPY_TESTING}")
Expand Down
2 changes: 1 addition & 1 deletion src/crispy/LRUCache_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <fmt/format.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

#include <functional>
#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion src/crispy/Size_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
#include <vtbackend/Size.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

#include <array>
#include <string_view>
Expand Down
2 changes: 1 addition & 1 deletion src/crispy/StrongLRUCache_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <crispy/StrongLRUCache.h>
#include <crispy/utils.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

#include <iostream>
#include <string_view>
Expand Down
4 changes: 2 additions & 2 deletions src/crispy/StrongLRUHashtable_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <crispy/StrongLRUHashtable.h>
#include <crispy/utils.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

#include <iostream>
#include <string_view>
Expand Down Expand Up @@ -406,7 +406,7 @@ TEST_CASE("strong_lru_hashtable.peek", "")

for (int i = 1; i <= 4; ++i)
{
INFO(fmt::format("i: {}", i))
INFO(fmt::format("i: {}", i));
REQUIRE(cache.peek(h(1)) == 2);
REQUIRE(joinHumanReadable(cache.hashes()) == sh(4, 3, 2, 1));
}
Expand Down
2 changes: 1 addition & 1 deletion src/crispy/TrieMap_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
#include <crispy/TrieMap.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

#include <cassert>
#include <exception>
Expand Down
2 changes: 1 addition & 1 deletion src/crispy/base64_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
#include <crispy/base64.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

using namespace crispy;

Expand Down
2 changes: 1 addition & 1 deletion src/crispy/compose_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
#include <crispy/compose.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

TEST_CASE("compose.simple")
{
Expand Down
2 changes: 1 addition & 1 deletion src/crispy/indexed_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <fmt/format.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

#include <array>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion src/crispy/ring_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <fmt/format.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

#include <array>

Expand Down
2 changes: 1 addition & 1 deletion src/crispy/sort_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
#include <crispy/sort.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

#include <array>

Expand Down
2 changes: 1 addition & 1 deletion src/crispy/test_main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
#define CATCH_CONFIG_RUNNER
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

int main(int argc, char const* argv[])
{
Expand Down
2 changes: 1 addition & 1 deletion src/crispy/times_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
#include <crispy/times.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

TEST_CASE("times.count-simple")
{
Expand Down
2 changes: 1 addition & 1 deletion src/crispy/utils_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
#include <crispy/utils.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

using std::string;
using std::string_view;
Expand Down
2 changes: 1 addition & 1 deletion src/text_shaper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ endif()
add_library(text_shaper STATIC ${text_shaper_SRC})
set_target_properties(text_shaper PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE}")

set(TEXT_SHAPER_LIBS unicode boxed-cpp::boxed-cpp)
set(TEXT_SHAPER_LIBS unicode::unicode boxed-cpp::boxed-cpp)
list(APPEND TEXT_SHAPER_LIBS fmt::fmt-header-only)
list(APPEND TEXT_SHAPER_LIBS range-v3::range-v3)
list(APPEND TEXT_SHAPER_LIBS Microsoft.GSL::GSL)
Expand Down
5 changes: 2 additions & 3 deletions src/vtbackend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ target_link_libraries(vtbackend PUBLIC
crispy::core
fmt::fmt-header-only
range-v3::range-v3
${LIBUNICODE_LIBS}
unicode::unicode
vtparser
vtpty
)
Expand All @@ -123,7 +123,6 @@ endif()
if(LIBTERMINAL_TESTING)
enable_testing()
add_executable(vtbackend_test
test_main.cpp
Capabilities_test.cpp
Color_test.cpp
InputGenerator_test.cpp
Expand All @@ -137,7 +136,7 @@ if(LIBTERMINAL_TESTING)
SixelParser_test.cpp
ViCommands_test.cpp
)
target_link_libraries(vtbackend_test fmt::fmt-header-only Catch2::Catch2 vtbackend)
target_link_libraries(vtbackend_test fmt::fmt-header-only Catch2::Catch2WithMain vtbackend)
add_test(vtbackend_test ./vtbackend_test)

if (LIBTERMINAL_BUILD_BENCH_HEADLESS)
Expand Down
2 changes: 1 addition & 1 deletion src/vtbackend/Capabilities_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <fmt/format.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

using namespace std::string_view_literals;
using crispy::fromHexString;
Expand Down
2 changes: 1 addition & 1 deletion src/vtbackend/Color_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
#include <vtbackend/Color.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

using namespace vtbackend;

Expand Down
2 changes: 1 addition & 1 deletion src/vtbackend/Functions_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <fmt/format.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

namespace vtbackend
{
Expand Down
2 changes: 1 addition & 1 deletion src/vtbackend/Grid_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <fmt/format.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

using namespace vtbackend;
using namespace std::string_literals;
Expand Down
2 changes: 1 addition & 1 deletion src/vtbackend/InputGenerator_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <libunicode/convert.h>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

#include <string>

Expand Down
Loading