Skip to content

Commit

Permalink
Update of termbench with scripts to create plots
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaraslaut committed Mar 17, 2024
1 parent 7f86c88 commit 6d2824f
Show file tree
Hide file tree
Showing 14 changed files with 707 additions and 358 deletions.
81 changes: 81 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
BasedOnStyle: Microsoft
AccessModifierOffset: '-2'
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: 'true'
AlignConsecutiveDeclarations: 'false'
AlignEscapedNewlines: Left
AlignOperands: 'true'
AlignTrailingComments: 'true'
AllowAllArgumentsOnNextLine: 'true'
AllowAllConstructorInitializersOnNextLine: 'true'
AllowAllParametersOfDeclarationOnNextLine: 'true'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'true'
AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: 'false'
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: 'false'
AlwaysBreakTemplateDeclarations: 'Yes'
BinPackArguments: 'false'
BinPackParameters: 'false'
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: 'true'
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakStringLiterals: 'true'
ColumnLimit: '110'
CompactNamespaces: 'false'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
ConstructorInitializerIndentWidth: '4'
ContinuationIndentWidth: '4'
Cpp11BracedListStyle: 'false'
DerivePointerAlignment: 'false'
FixNamespaceComments: 'true'
IncludeBlocks: Regroup
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
IndentWidth: '4'
IndentWrappedFunctionNames: 'false'
Language: Cpp
MaxEmptyLinesToKeep: '1'
NamespaceIndentation: Inner
PenaltyBreakAssignment: '0'
PointerAlignment: Left
ReflowComments: 'true'
SortIncludes: 'true'
SortUsingDeclarations: 'true'
SpaceAfterCStyleCast: 'true'
SpaceAfterLogicalNot: 'false'
SpaceAfterTemplateKeyword: 'true'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeCpp11BracedList: 'true'
SpaceBeforeCtorInitializerColon: 'false'
SpaceBeforeInheritanceColon: 'false'
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: 'false'
SpaceInEmptyParentheses: 'false'
SpacesInAngles: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInContainerLiterals: 'false'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
Standard: Cpp11
TabWidth: '4'
UseTab: Never
IncludeCategories:
- Regex: '^<(tb)/'
Priority: 0
- Regex: '^<(libtermbench)/'
Priority: 1
- Regex: '^<sys/'
Priority: 80
- Regex: '^<[[:alnum:]_]+>'
Priority: 81
- Regex: '<[[:alnum:]_]+\.h>'
Priority: 82
- Regex: '.*'
Priority: 99
10 changes: 10 additions & 0 deletions .github/mock-font-locator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

mock_font_locator:
# Ubuntu 20.04
- { family: "monospace", slant: normal, weight: normal, path: "/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf" }
- { family: "emoji", slant: normal, weight: normal, path: "/usr/share/fonts/truetype/noto/NotoColorEmoji.ttf" }

# That would be it for macOS
# - { family: "monospace", slant: normal, weight: normal, path: "/Users/trapni/Library/Fonts/JetBrains Mono Regular Nerd Font Complete Mono.ttf" }
# - { family: "emoji", slant: normal, weight: normal, path: "/System/Library/Fonts/Apple Color Emoji.ttc" }

120 changes: 67 additions & 53 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,26 @@ env:
CTEST_OUTPUT_ON_FAILURE: 1

jobs:


check_clang_format:
name: "Check C++ style"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17
sudo apt-get install clang-format-17
- name: "Clang-format libtermbench"
run: find ./libtermbench -name "*.cpp" -o -name "*.h" | xargs clang-format-17 --Werror --dry-run
- name: "Clang-format tb1"
run: find ./tb -name "*.cpp" -o -name "*.h" | xargs clang-format-17 --Werror --dry-run
- name: "Check includes"
run: ./scripts/check-includes.sh

ubuntu_linux:
name: "Ubuntu Linux 22.04"
runs-on: ubuntu-22.04
Expand All @@ -43,62 +63,56 @@ jobs:
set -ex
sudo apt -q update
sudo ./scripts/install-deps.sh
- name: "Install GCC 13"
run: sudo apt install g++-13
- name: "cmake"
run: cmake -S . -B build -DCMAKE_BUILD_TYPE="RelWithDebInfo"
run: cmake -S . -B build -DCMAKE_BUILD_TYPE="RelWithDebInfo" -D CMAKE_CXX_COMPILER="g++-13"
- name: "build"
run: cmake --build build/ -- -j3

osx:
name: "OS/X"
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: "**/cpm_modules"
key: ${{github.workflow}}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
- name: set variables
id: set_vars
run: ./scripts/ci-set-vars.sh
env:
REPOSITORY: ${{ github.event.repository.name }}
- name: "Install dependencies"
- name: "install dependencies"
run: ./scripts/xvfb-deps.sh
- name: "Install contour"
run: |
wget https://github.com/contour-terminal/contour/releases/download/v0.4.3.6442/contour-0.4.3.6442-ubuntu22.04-amd64.deb
sudo dpkg -i contour-0.4.3.6442-ubuntu22.04-amd64.deb
- name: "create and patch contour.yml config file"
run: |
set -ex
#brew update
./scripts/install-deps.sh
- name: "Create build directory"
run: mkdir build
- name: "Generate build files"
run: cmake -S . -B build -DCMAKE_BUILD_TYPE="RelWithDebInfo"
- name: "Build"
run: cmake --build build/

windows:
name: "Windows"
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: setup environment
shell: powershell
id: set_vars
run: .\scripts\ci-set-vars.ps1
env:
REPOSITORY: ${{ github.event.repository.name }}
- name: "vcpkg: Install dependencies"
uses: lukka/[email protected]
id: runvcpkg
mkdir -p ~/.config/contour/
contour generate config to ~/.config/contour/contour.yml
sed -i -e 's/locator: native/locator: mock/' ~/.config/contour/contour.yml
sed -i -e 's/strict_spacing: true/strict_spacing: false/' ~/.config/contour/contour.yml
sed -i -e 's/columns: 80/columns: 100/' ~/.config/contour/contour.yml
cat .github/mock-font-locator.yml >> ~/.config/contour/contour.yml
cat ~/.config/contour/contour.yml
- name: "Install alacritty"
run: cargo install alacritty
- name: "Install kitty and xterm"
run: sudo apt install -y kitty xterm xvfb
- name: "run benchmarks"
run: ./scripts/Xvfb-bench-run.sh
- name: "ls"
run: ls -la
- name: "cat contour_results"
run: cat contour_results
- name: "cat kitty_results"
run: cat kitty_results
- name: "cat xterm_results"
run: cat xterm_results
- name: "cat alacritty_results"
run: cat alacritty_results
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
- name: "Create Plots"
run: julia ./scripts/plot_results.jl
- name: "Upload results and plot"
uses: actions/upload-artifact@v3
with:
vcpkgDirectory: ${{ runner.workspace }}/vcpkg/
vcpkgGitCommitId: 3e93bb69a1cadeb36fe9eca3b6f3912d84f618d5
- name: "create build directory"
shell: powershell
run: |
If (!(Test-Path build))
{
New-Item -ItemType Directory -Force -Path build
}
- name: "Generate build files"
run: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="${{ runner.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows -B build .
- name: "Build"
run: cmake --build build/ --config Release
name: benchmark_results
path: |
results_full.png
results_ascii.png
contour_results
alacritty_results
xterm_results
kitty_results
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ if(DEFINED MSVC)
add_definitions(-D_USE_MATH_DEFINES)
endif()

if(NOT TARGET fmt)
find_package(fmt REQUIRED)
endif()

add_subdirectory(libtermbench)
add_subdirectory(tb)
1 change: 0 additions & 1 deletion libtermbench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ set_target_properties(termbench PROPERTIES
VERSION "${PROJECT_VERSION}"
SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
)
target_link_libraries(termbench PUBLIC fmt::fmt-header-only)

target_include_directories(termbench PUBLIC $<BUILD_INTERFACE:${${PROJECT_NAME}_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
Expand Down
Loading

0 comments on commit 6d2824f

Please sign in to comment.