From 97d2096df81ed7c19e0d06d7bc74730623ca2ea0 Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Fri, 17 Jun 2022 18:19:53 +0200 Subject: [PATCH] Delete performance test I never really used it, and it didn't even build any more --- CMakeLists.txt | 7 ---- tests/performance.c | 82 -------------------------------------------- tests/performance.sh | 6 ---- 3 files changed, 95 deletions(-) delete mode 100644 tests/performance.c delete mode 100755 tests/performance.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bfb476c2..9233ab112 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -477,13 +477,6 @@ target_link_libraries(flashfetch ################### if (BUILD_TESTS) - add_executable(fastfetch-test-performance - tests/performance.c - ) - target_link_libraries(fastfetch-test-performance - PRIVATE libfastfetch - ) - add_executable(fastfetch-test-strbuf tests/strbuf.c ) diff --git a/tests/performance.c b/tests/performance.c deleted file mode 100644 index c526a2106..000000000 --- a/tests/performance.c +++ /dev/null @@ -1,82 +0,0 @@ -#include "fastfetch.h" - -#include - -#define FASTFETCH_TEST_PERFORMANCE(func) \ - { \ - struct timespec start, end; \ - clock_gettime(CLOCK_REALTIME, &start); \ - func; \ - clock_gettime(CLOCK_REALTIME, &end); \ - long nanos = end.tv_nsec - start.tv_nsec; \ - printf("\033[F"); \ - for(uint8_t i = 0; i < 125; i++) printf("\033[C"); \ - printf("%08ldns\n", nanos); \ - } \ - -int main(int argc, char** argv) -{ - FF_UNUSED(argc, argv); - - FFinstance instance; - - FASTFETCH_TEST_PERFORMANCE( - puts("Initialization"); - ffInitInstance(&instance); - ) - - instance.config.showErrors = true; - instance.config.recache = argc == 1; - instance.config.cacheSave = false; - ffStrbufSetS(&instance.config.songFormat, "{}"); //Otherwise the line is too long - - FASTFETCH_TEST_PERFORMANCE( - puts("Thread starting"); - ffStartDetectionThreads(&instance); - ) - - FASTFETCH_TEST_PERFORMANCE( - puts("Starting"); - ffStart(&instance); - ) - - FASTFETCH_TEST_PERFORMANCE(ffPrintTitle(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintSeparator(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintOS(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintHost(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintKernel(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintUptime(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintProcesses(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintPackages(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintShell(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintResolution(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintDesktopEnvironment(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintWM(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintWMTheme(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintTheme(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintIcons(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintFont(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintTerminal(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintTerminalFont(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintCPU(&instance)) - //FASTFETCH_TEST_PERFORMANCE(ffPrintCPUUsage(&instance)) // Doesn't make sense, contains a sleep call - FASTFETCH_TEST_PERFORMANCE(ffPrintGPU(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintMemory(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintDisk(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintBattery(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintPlayer(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintSong(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintLocalIp(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintPublicIp(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintDateTime(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintLocale(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintBreak(&instance)) - FASTFETCH_TEST_PERFORMANCE(ffPrintColors(&instance)) - - FASTFETCH_TEST_PERFORMANCE( - puts("Finishing"); - ffFinish(&instance); - ) - - return 0; -} diff --git a/tests/performance.sh b/tests/performance.sh deleted file mode 100755 index df6eb7809..000000000 --- a/tests/performance.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/env sh -mkdir -p build/ -cd build -cmake .. -cmake --build . --target fastfetch-test-performance -j$(nproc) -./fastfetch-test-performance "$@"