Skip to content

Commit

Permalink
[MAJOR] ALPHA 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
nots1dd committed Jan 24, 2025
1 parent dee3e71 commit 36bf3ad
Show file tree
Hide file tree
Showing 21 changed files with 1,035 additions and 260 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/inLimbo-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and Test inLimbo Functions (x86 - GCC)

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
build:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v2

# Set up CMake
- name: Set up CMake
uses: scivision/cmake-action@v2
with:
cmake-version: '3.22'

# Install dependencies
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
g++ \
libgtest-dev \
pkg-config \
libglib2.0-dev \
libgio-2.0-dev \
libpthread-stubs0-dev
# Run initialization script (if needed)
- name: Run tests from Makefile
run: make build-tests

# Optionally, you can also clean up after the build if desired
- name: Clean up
run: rm -rf build
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.sync
*.out
build/
build-dbg/
build_emscripten/
Expand All @@ -14,3 +15,4 @@ src/parser/toml.hpp
src/music/miniaudio.h
src/ui/components/libs/CImg.h
docs/
.cache/
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -762,3 +762,46 @@ Sizeable commit with new fields, changes and features that bring the app togethe
- Centering of the image_view (NOT THAT BIG)

---

## [ALPHA 2.4] --- 24-01-2025

### Added
- Added tests/ directory to perform unit tests using GTest and subsequent new files and test suites

- `src/threads/` created to have a worker thread system for better concurrency handling

- Added a new screen to view current audio sinks (outputs)

- Added a destructor to ThreadManager class to properly join all non-detached threads

### Changed
- Cleanups in `src/ui` , `src/music` `src/dirsort`

- Changed ThreadManager drastically

- Modified Run function in ui_handler to NOT be detached

- Got rid of mutex unlock and used lock_guard instead + more concurrency changes

- New field in config.toml -> toggle_audio_devices (will change this name later)

- Made mpris_dbus_thread a unique thread

- PlayCurrentSong now uses the WorkerThread Pool to enqueue all tasks and has a more robust way to handle concurrency

- New workflow to build tests

### Fixed
**NIL**

### Removed
**NIL**

Huge commit (I have not mentioned a lot changes here do read the commit history)

### Known Issues to fix in immediate commits
- Runtime errors with respect to `PlayCurrentSong()` that may be due to detaching the audio thread (BIG) [Seems to be solvable]

- Centering of the image_view (NOT THAT BIG)

---
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

enable_testing()

add_library(tiv
${CMAKE_CURRENT_SOURCE_DIR}/src/ui/components/libs/tiv_lib.cpp
)
Expand Down Expand Up @@ -112,7 +114,7 @@ else()
endif()

# --- Handle Global Build ---------------------------------------------------------
if(BUILD_GLOBAL)
if(DEFINED GLOBAL_BUILD AND GLOBAL_BUILD)
set(CMAKE_INSTALL_PREFIX "/usr/")
message(STATUS "Starting GLOBAL_BUILD for inLimbo...")

Expand Down Expand Up @@ -184,3 +186,11 @@ endif()
if (NOT EXISTS "$ENV{HOME}/.cache/inLimbo/")
file(MAKE_DIRECTORY "$ENV{HOME}/.cache/inLimbo")
endif()

# --- Add Tests Directory Only if INLIMBO_TESTING is Defined ----------------------
if(DEFINED INLIMBO_TESTING AND INLIMBO_TESTING)
message("--> Enabling TESTING for INLIMBO...")
add_subdirectory(tests)
else()
message("--> TESTING is disabled for INLIMBO.")
endif()
25 changes: 18 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,36 @@

# Variables
BUILD_DIR := build
BUILD_DIR_DBG_ASAN := build-dbg-asan
BUILD_DIR_DBG_TSAN := build-dbg-tsan
BUILD_DBG_ASAN_DIR := build-dbg-asan
BUILD_DBG_TSAN_DIR :- build-dbg-tsan
BUILD_DBG_TSAN_DIR := build-dbg-tsan
EXECUTABLE := inLimbo
CMAKE := cmake
CMAKE_BUILD_TYPE := Release
SCRIPT := ./init.sh
VERBOSE_FLAG := VERBOSE=1
TESTING_FLAG := INLIMBO_TESTING

# Targets
.PHONY: all build clean rebuild build-all init asan tsan global_build
.PHONY: all build clean rebuild build-all init asan tsan global_build build-test

all: build-all

build-test:
@echo "==> Building inLimbo with script and tests using GTest..."
$(SCRIPT)
$(CMAKE) -S . -B $(BUILD_DIR) -D $(TESTING_FLAG)=ON
$(CMAKE) --build $(BUILD_DIR)

build-all:
@echo "==> Running initialization script..."
$(SCRIPT)
$(MAKE) build

build:
@echo "==> Fresh Building inLimbo with $(CMAKE_BUILD_TYPE)..."
$(CMAKE) -S . -B build $(BUILD_DIR)
$(CMAKE) -S . -B build $(BUILD_DIR) -D $(TESTING_FLAG)=OFF
$(CMAKE) --build $(BUILD_DIR)

rebuild:
Expand All @@ -31,17 +40,19 @@ rebuild:

asan:
@echo "==> Building in AddressSanitizer mode..."
mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR) && $(CMAKE) -DCMAKE_BUILD_TYPE=Debug-ASan .. && $(NINJA)
mkdir -p $(BUILD_DIR_DBG_ASAN)
cmake -S . -B $(BUILD_DIR_DBG_ASAN) -DCMAKE_BUILD_TYPE=Debug-ASan
cmake --build $(BUILD_DIR_DBG_ASAN)

asan_run: asan
@echo "==> Running AddressSanitizer build..."
$(BUILD_DIR)/inLimbo-DBG-Asan

tsan:
@echo "==> Building in ThreadSanitizer mode..."
mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR) && $(CMAKE) -DCMAKE_BUILD_TYPE=Debug-TSan .. && $(NINJA)
mkdir -p $(BUILD_DIR_DBG_TSAN)
cmake -S . -B $(BUILD_DIR_DBG_TSAN) -DCMAKE_BUILD_TYPE=Debug-TSan
cmake --build $(BUILD_DIR_DBG_TSAN)

tsan_run: tsan
@echo "==> Running ThreadSanitizer build..."
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ cmake --build build/
To build inLimbo **GLOBALLY**:

```bash
cmake -S . -B build -DBUILD_GLOBAL=ON
cmake -S . -B build -DGLOBAL_BUILD=ON
cmake --build build/
cd build
sudo make install # will put the binary in /usr/bin and respective inLimbo.desktop and logo in /usr/share
Expand Down
3 changes: 0 additions & 3 deletions src/dirsort/rbtree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@

#include "../parser/toml_parser.hpp"
#include "songmap.hpp"
#include <chrono>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <dirent.h>
#include <fstream>
#include <iostream>
#include <sys/stat.h>
#include <unordered_map>
#include <vector>
Expand Down
2 changes: 0 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#include "signal/signalHandler.hpp"
#include "ui/ui_handler.hpp"
#include "./arg-handler.hpp"
#include <memory>
#include <random>

int main(int argc, char* argv[])
{
Expand Down
Loading

0 comments on commit 36bf3ad

Please sign in to comment.