From b15423e6e6019b56f950ab71a8e2b3e7416d616d Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:14:49 -0600 Subject: [PATCH 01/30] Create CMakeLists.txt --- CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..abf4b51d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,14 @@ +# CMakeLists.txt +cmake_minimum_required(VERSION 3.20) + +# Project metadata +project(FossilTest VERSION 1.1.5 LANGUAGES C CXX) + +# Set the C and C++ standards +set(CMAKE_C_STANDARD 11) +set(CMAKE_C_EXTENSIONS OFF) # Ensure strict C11 compliance +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_EXTENSIONS OFF) # Ensure strict C++20 compliance + +# Add subdirectory for source code +add_subdirectory(code) From a31d61c794b35da8bc98d910ea2b2c8412577595 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:17:35 -0600 Subject: [PATCH 02/30] Create CMakeLists.txt --- code/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 code/CMakeLists.txt diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt new file mode 100644 index 00000000..b2f13bfa --- /dev/null +++ b/code/CMakeLists.txt @@ -0,0 +1,5 @@ +# code/CMakeLists.txt + +# Add subdirectories for logic and tests +add_subdirectory(logic) +add_subdirectory(tests) From 1e739940d33c3c0bf8366bad5f829a26cb7a9654 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:21:06 -0600 Subject: [PATCH 03/30] Create CMakeLists.txt --- code/logic/CMakeLists.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 code/logic/CMakeLists.txt diff --git a/code/logic/CMakeLists.txt b/code/logic/CMakeLists.txt new file mode 100644 index 00000000..57186457 --- /dev/null +++ b/code/logic/CMakeLists.txt @@ -0,0 +1,26 @@ +# code/logic/CMakeLists.txt + +# Define the include directories +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +# List the source files +set(TEST_CODE + mocking.c + testing.c + marking.c +) + +# Create the library target +add_library(fossil-test STATIC ${TEST_CODE}) + +# Set the library to be installed +install(TARGETS fossil-test + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +# Declare the dependency +add_library(fossil_test_dep INTERFACE) +target_link_libraries(fossil_test_dep INTERFACE fossil-test) +target_include_directories(fossil_test_dep INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) From 0dba8bea70036d982425064a3ddbf4374d2f1604 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:24:39 -0600 Subject: [PATCH 04/30] Update CMakeLists.txt --- code/logic/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/logic/CMakeLists.txt b/code/logic/CMakeLists.txt index 57186457..098bde59 100644 --- a/code/logic/CMakeLists.txt +++ b/code/logic/CMakeLists.txt @@ -3,6 +3,9 @@ # Define the include directories include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +# Collect all header files in logic/fossil/* +file(GLOB HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/fossil/*.h) + # List the source files set(TEST_CODE mocking.c @@ -11,7 +14,7 @@ set(TEST_CODE ) # Create the library target -add_library(fossil-test STATIC ${TEST_CODE}) +add_library(fossil-test STATIC ${TEST_CODE} ${HEADER_FILES}) # Set the library to be installed install(TARGETS fossil-test @@ -20,6 +23,9 @@ install(TARGETS fossil-test RUNTIME DESTINATION bin ) +# Install the header files +install(FILES ${HEADER_FILES} DESTINATION include/fossil) + # Declare the dependency add_library(fossil_test_dep INTERFACE) target_link_libraries(fossil_test_dep INTERFACE fossil-test) From 721ff27c577615531fc39fc1372421cb92dc4ca4 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:33:23 -0600 Subject: [PATCH 05/30] Create CMakeLists.txt --- code/tests/CMakeLists.txt | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 code/tests/CMakeLists.txt diff --git a/code/tests/CMakeLists.txt b/code/tests/CMakeLists.txt new file mode 100644 index 00000000..d9fe6c64 --- /dev/null +++ b/code/tests/CMakeLists.txt @@ -0,0 +1,41 @@ +# logic/tests/CMakeLists.txt + +# Check if testing is enabled +option(WITH_TEST "Enable building and running tests" ON) + +if(WITH_TEST) + # Run the generate-runner.py script + execute_process( + COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/../tools/generate-runner.py + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + RESULT_VARIABLE GENERATE_RUNNER_RESULT + ) + if(NOT GENERATE_RUNNER_RESULT EQUAL 0) + message(FATAL_ERROR "Failed to run generate-runner.py") + endif() + + # Define the test sources + set(TEST_C ${CMAKE_CURRENT_SOURCE_DIR}/unit_runner.c) + + # Define test cases + set(TEST_CASES sample bdd tdd ddd mark mock) + + # Append the test case sources + foreach(CASE IN LISTS TEST_CASES) + list(APPEND TEST_C + ${CMAKE_CURRENT_SOURCE_DIR}/cases/test_${CASE}.c + ${CMAKE_CURRENT_SOURCE_DIR}/cases/test_${CASE}.cpp + ) + endforeach() + + # Create the executable for tests + add_executable(testbed-c ${TEST_C}) + + # Link dependencies and include directories + target_include_directories(testbed-c PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..) + target_link_libraries(testbed-c PRIVATE fossil_test_dep) + + # Add the test + enable_testing() + add_test(NAME "fossil testing C" COMMAND testbed-c) +endif() From b9d314cb97942041109ada2a6ed28934c15dba8f Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:44:20 -0600 Subject: [PATCH 06/30] Create cmake_ci.yml --- .github/workflows/cmake_ci.yml | 262 +++++++++++++++++++++++++++++++++ 1 file changed, 262 insertions(+) create mode 100644 .github/workflows/cmake_ci.yml diff --git a/.github/workflows/cmake_ci.yml b/.github/workflows/cmake_ci.yml new file mode 100644 index 00000000..4b29ab5d --- /dev/null +++ b/.github/workflows/cmake_ci.yml @@ -0,0 +1,262 @@ +name: CMake CI + +on: + push: + paths: + - "**.c" + - "**.h" + - "**.cpp" + - "**.hpp" + - "**.rs" + - "**.py" + - "**.build" + - "**.options" + pull_request: + paths: + - "**.c" + - "**.h" + - "**.cpp" + - "**.hpp" + - "**.rs" + - "**.py" + - "**.build" + - "**.options" + +jobs: + build_msvc: + name: Building on MSVC ${{ matrix.msvc_version }} + runs-on: windows-latest + strategy: + matrix: + msvc_version: [2015, 2017, 2019, 2022] + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install CMake and Ninja + shell: pwsh + run: | + python -m pip install --upgrade pip + python -m pip install cmake ninja + if ($env:msvc_version -eq "2015") { + choco install visualstudio2015buildtools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --includeRecommended --includeOptional --passive" + } elseif ($env:msvc_version -eq "2017") { + choco install visualstudio2017buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive" + } elseif ($env:msvc_version -eq "2019") { + choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive" + } elseif ($env:msvc_version -eq "2022") { + choco install visualstudio2022buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive" + } + $env:CC="cl.exe" + $env:CXX="cl.exe" + + - name: Configure CMake + run: cmake -S . -B build_msvc_${{ matrix.msvc_version }} -G "Visual Studio ${matrix.msvc_version}" -DWITH_TESTS=ON + + - name: Build + run: cmake --build build_msvc_${{ matrix.msvc_version }} --config Release + + - name: Run Tests + run: cmake --build build_msvc_${{ matrix.msvc_version }} --target test + + - name: Upload Test Log + if: failure() + uses: actions/upload-artifact@v4 + with: + name: windows_msvc_${{ matrix.msvc_version }}_cmake_testlog + path: build_msvc_${{ matrix.msvc_version }}/Testing/Temporary/LastTest.log + + build_macosx: + name: Building on macOS with Xcode ${{ matrix.xcode_version }} + runs-on: macos-latest + strategy: + matrix: + xcode_version: ["15.2", "15.3"] + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install Xcode + run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode_version }}.app + + - name: Install CMake and Ninja + run: | + python -m pip install cmake ninja + + - name: Configure CMake + run: cmake -S . -B builddir -G Xcode -DWITH_TESTS=ON + + - name: Build + run: cmake --build builddir --config Release + + - name: Run Tests + run: cmake --build builddir --target test + + - name: Upload Test Log + if: failure() + uses: actions/upload-artifact@v4 + with: + name: macos_xcode_${{ matrix.xcode_version }}_cmake_testlog + path: builddir/Testing/Temporary/LastTest.log + + build_msys: + name: Building on MSYS ${{ matrix.architecture }} + runs-on: windows-latest + strategy: + matrix: + architecture: [x86, x64] + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up MSYS2 + uses: msys2/setup-msys2@v2 + with: + update: true + + - name: Set environment variables + run: | + echo "CC=/mingw${{ matrix.architecture }}/bin/gcc.exe" >> $GITHUB_ENV + echo "CXX=/mingw${{ matrix.architecture }}/bin/g++.exe" >> $GITHUB_ENV + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install CMake and Ninja + run: | + python -m pip install cmake ninja + + - name: Configure CMake + run: cmake -S . -B builddir -DWITH_TESTS=ON + + - name: Build + run: cmake --build builddir --config Release + + - name: Run Tests + run: cmake --build builddir --target test + + - name: Upload Test Log + if: failure() + uses: actions/upload-artifact@v4 + with: + name: msys_${{ matrix.architecture }}_cmake_testlog + path: builddir/Testing/Temporary/LastTest.log + + build_posix: + name: Build on Linux ${{ matrix.distro }} + runs-on: ubuntu-latest + + strategy: + matrix: + distro: [ubuntu, fedora, archlinux, debian] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Cache Docker layers + uses: actions/cache@v4 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ matrix.distro }} + restore-keys: | + ${{ runner.os }}-buildx + + - name: Build Docker Image + run: | + docker build \ + --file .github/ciimage/Dockerfile.${{ matrix.distro }} \ + --tag ${GITHUB_REPOSITORY}:${{ matrix.distro }} . + + - name: Run CMake Build in Docker Container + run: | + docker run --rm \ + -v ${{ github.workspace }}:/workspace \ + -w /workspace \ + ${GITHUB_REPOSITORY}:${{ matrix.distro }} \ + /bin/bash -c " + apt-get update + cmake -S . -B builddir -DWITH_TESTS=ON + cmake --build builddir --config Release + cmake --build builddir --target test" + + build_cross: + name: Building on Cross Compilation ${{ matrix.architecture }} + runs-on: ubuntu-latest + + strategy: + matrix: + architecture: [arm, arm64, mips, mipsel, riscv64, ppc, ppc64le, sparc64, s390x] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install Cross-Compilation Toolchain + run: | + sudo apt-get update + if [ "${{ matrix.architecture }}" == "arm" ]; then + sudo apt-get install -y gcc-arm-linux-gnueabi g++-arm-linux-gnueabi + elif [ "${{ matrix.architecture }}" == "arm64" ]; then + sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu + elif [ "${{ matrix.architecture }}" == "mips" ]; then + sudo apt-get install -y gcc-mips-linux-gnu g++-mips-linux-gnu + elif [ "${{ matrix.architecture }}" == "mipsel" ]; then + sudo apt-get install -y gcc-mipsel-linux-gnu g++-mipsel-linux-gnu + elif [ "${{ matrix.architecture }}" == "riscv64" ]; then + sudo apt-get install -y gcc-riscv64-linux-gnu g++-riscv64-linux-gnu + elif [ "${{ matrix.architecture }}" == "ppc" ]; then + sudo apt-get install -y gcc-powerpc-linux-gnu g++-powerpc-linux-gnu + elif [ "${{ matrix.architecture }}" == "ppc64le" ]; then + sudo apt-get install -y gcc-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu + elif [ "${{ matrix.architecture }}" == "sparc64" ]; then + sudo apt-get install -y gcc-sparc64-linux-gnu g++-sparc64-linux-gnu + elif [ "${{ matrix.architecture }}" == "s390x" ]; then + sudo apt-get install -y gcc-s390x-linux-gnu g++-s390x-linux-gnu + fi + + - name: Configure CMake + run: cmake -S . -B builddir -DWITH_TESTS=ON + + - name: Build + run: cmake --build builddir --config Release + + - name: Run Tests + run: cmake --build builddir --target test + + - name: Upload Test Log + if: failure() + uses: actions/upload-artifact@v4 + with: + name: cross_${{ matrix.architecture }}_cmake_testlog + path: builddir/Testing/Temporary/LastTest.log From ac5a6a2311f9c36bed2b8597d6d2d1d1a13822f0 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:44:49 -0600 Subject: [PATCH 07/30] Update Dockerfile.archlinux --- .github/ciimage/Dockerfile.archlinux | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/ciimage/Dockerfile.archlinux b/.github/ciimage/Dockerfile.archlinux index 91e2a33a..bab6fd36 100644 --- a/.github/ciimage/Dockerfile.archlinux +++ b/.github/ciimage/Dockerfile.archlinux @@ -17,6 +17,7 @@ RUN pacman -Syu --noconfirm && \ python \ python-pip \ git \ + cmake \ meson \ ninja \ tzdata && \ @@ -31,4 +32,4 @@ ENV LD_LIBRARY_PATH=/usr/local/lib WORKDIR /workspace # Default command -CMD ["bash"] \ No newline at end of file +CMD ["bash"] From a4f31c5e772395ff0eedb3654f28cd010099dc96 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:45:09 -0600 Subject: [PATCH 08/30] Update Dockerfile.debian --- .github/ciimage/Dockerfile.debian | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ciimage/Dockerfile.debian b/.github/ciimage/Dockerfile.debian index a61874dc..b192f0b1 100644 --- a/.github/ciimage/Dockerfile.debian +++ b/.github/ciimage/Dockerfile.debian @@ -25,7 +25,7 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* # Install Meson and Ninja -RUN python3 -m pip install --no-cache-dir meson ninja==1.10.2 +RUN python3 -m pip install --no-cache-dir cmake meson ninja==1.10.2 # Set environment variables ENV CC=/usr/bin/clang @@ -36,4 +36,4 @@ ENV LD_LIBRARY_PATH=/usr/local/lib WORKDIR /workspace # Default command -CMD ["bash"] \ No newline at end of file +CMD ["bash"] From a5e7dc9cee0a529f8e59b9623c8ccedf7b158b82 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:45:21 -0600 Subject: [PATCH 09/30] Update Dockerfile.fedora --- .github/ciimage/Dockerfile.fedora | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ciimage/Dockerfile.fedora b/.github/ciimage/Dockerfile.fedora index 816a0752..64738840 100644 --- a/.github/ciimage/Dockerfile.fedora +++ b/.github/ciimage/Dockerfile.fedora @@ -21,7 +21,7 @@ RUN dnf -y update && \ git && \ dnf clean all # Install Meson and Ninja using pip -RUN python3 -m pip install --no-cache-dir meson ninja +RUN python3 -m pip install --no-cache-dir cmake meson ninja # Set environment variables ENV CC=/usr/bin/clang @@ -32,4 +32,4 @@ ENV LD_LIBRARY_PATH=/usr/local/lib64 WORKDIR /workspace # Default command -CMD ["bash"] \ No newline at end of file +CMD ["bash"] From b6303cc457e4f0a7c79b3d367db00fbf95d3271a Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:45:32 -0600 Subject: [PATCH 10/30] Update Dockerfile.ubuntu --- .github/ciimage/Dockerfile.ubuntu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ciimage/Dockerfile.ubuntu b/.github/ciimage/Dockerfile.ubuntu index 0ed7b7cd..6da4310d 100644 --- a/.github/ciimage/Dockerfile.ubuntu +++ b/.github/ciimage/Dockerfile.ubuntu @@ -25,7 +25,7 @@ RUN apt-get update && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* -RUN python3 -m pip install --no-cache-dir meson ninja +RUN python3 -m pip install --no-cache-dir cmake meson ninja # Set environment variables ENV CC=/usr/bin/gcc From 100097abe1711d17a8ae2a68b68c28196f0b4073 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:46:43 -0600 Subject: [PATCH 11/30] Update CMakeLists.txt --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index abf4b51d..09630b8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,5 +10,8 @@ set(CMAKE_C_EXTENSIONS OFF) # Ensure strict C11 compliance set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_EXTENSIONS OFF) # Ensure strict C++20 compliance +# Options +option(WITH_TEST "Enable Fossil Test for this project" OFF) + # Add subdirectory for source code add_subdirectory(code) From 59e76e0e512803bb9e2b27e5a8cecd9f65cd4858 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:48:20 -0600 Subject: [PATCH 12/30] Update testing.c --- code/logic/testing.c | 1 + 1 file changed, 1 insertion(+) diff --git a/code/logic/testing.c b/code/logic/testing.c index fd7338f8..916b7286 100644 --- a/code/logic/testing.c +++ b/code/logic/testing.c @@ -14,6 +14,7 @@ */ #include "fossil/test/testing.h" + #ifdef __WIN32 // Array of messages for each category const char *sarcastic_messages[] = { From 4a53f0632416a25a12c3f92256207c25e394b0fd Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:54:25 -0600 Subject: [PATCH 13/30] Update cmake_ci.yml --- .github/workflows/cmake_ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cmake_ci.yml b/.github/workflows/cmake_ci.yml index 4b29ab5d..c2c6d525 100644 --- a/.github/workflows/cmake_ci.yml +++ b/.github/workflows/cmake_ci.yml @@ -64,7 +64,7 @@ jobs: run: cmake --build build_msvc_${{ matrix.msvc_version }} --config Release - name: Run Tests - run: cmake --build build_msvc_${{ matrix.msvc_version }} --target test + run: cmake --build build_msvc_${{ matrix.msvc_version }} --target testbed-c - name: Upload Test Log if: failure() @@ -104,7 +104,7 @@ jobs: run: cmake --build builddir --config Release - name: Run Tests - run: cmake --build builddir --target test + run: cmake --build builddir --target testbed-c - name: Upload Test Log if: failure() @@ -151,7 +151,7 @@ jobs: run: cmake --build builddir --config Release - name: Run Tests - run: cmake --build builddir --target test + run: cmake --build builddir --target testbed-c - name: Upload Test Log if: failure() @@ -201,7 +201,7 @@ jobs: apt-get update cmake -S . -B builddir -DWITH_TESTS=ON cmake --build builddir --config Release - cmake --build builddir --target test" + cmake --build builddir --target testbed-c" build_cross: name: Building on Cross Compilation ${{ matrix.architecture }} @@ -252,7 +252,7 @@ jobs: run: cmake --build builddir --config Release - name: Run Tests - run: cmake --build builddir --target test + run: cmake --build builddir --target testbed-c - name: Upload Test Log if: failure() From d40043b13217d7cba94a0820daa42f56613485db Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:54:44 -0600 Subject: [PATCH 14/30] Update testing.c --- code/logic/testing.c | 1 - 1 file changed, 1 deletion(-) diff --git a/code/logic/testing.c b/code/logic/testing.c index 916b7286..fd7338f8 100644 --- a/code/logic/testing.c +++ b/code/logic/testing.c @@ -14,7 +14,6 @@ */ #include "fossil/test/testing.h" - #ifdef __WIN32 // Array of messages for each category const char *sarcastic_messages[] = { From d6070d012d6714eb987a99ee011647a9b3f3a621 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:00:55 -0600 Subject: [PATCH 15/30] Update cmake_ci.yml --- .github/workflows/cmake_ci.yml | 49 +++++++++++++--------------------- 1 file changed, 18 insertions(+), 31 deletions(-) diff --git a/.github/workflows/cmake_ci.yml b/.github/workflows/cmake_ci.yml index c2c6d525..cb6d4993 100644 --- a/.github/workflows/cmake_ci.yml +++ b/.github/workflows/cmake_ci.yml @@ -58,20 +58,17 @@ jobs: $env:CXX="cl.exe" - name: Configure CMake - run: cmake -S . -B build_msvc_${{ matrix.msvc_version }} -G "Visual Studio ${matrix.msvc_version}" -DWITH_TESTS=ON + run: cmake -S . -B build_msvc_${{ matrix.msvc_version }} -G "Ninja" -DWITH_TESTS=OFF - name: Build run: cmake --build build_msvc_${{ matrix.msvc_version }} --config Release - - name: Run Tests - run: cmake --build build_msvc_${{ matrix.msvc_version }} --target testbed-c - - - name: Upload Test Log + - name: Upload Build Log if: failure() uses: actions/upload-artifact@v4 with: - name: windows_msvc_${{ matrix.msvc_version }}_cmake_testlog - path: build_msvc_${{ matrix.msvc_version }}/Testing/Temporary/LastTest.log + name: windows_msvc_${{ matrix.msvc_version }}_cmake_buildlog + path: build_msvc_${{ matrix.msvc_version }}/build.ninja build_macosx: name: Building on macOS with Xcode ${{ matrix.xcode_version }} @@ -98,20 +95,17 @@ jobs: python -m pip install cmake ninja - name: Configure CMake - run: cmake -S . -B builddir -G Xcode -DWITH_TESTS=ON + run: cmake -S . -B builddir -G "Ninja" -DWITH_TESTS=OFF - name: Build run: cmake --build builddir --config Release - - name: Run Tests - run: cmake --build builddir --target testbed-c - - - name: Upload Test Log + - name: Upload Build Log if: failure() uses: actions/upload-artifact@v4 with: - name: macos_xcode_${{ matrix.xcode_version }}_cmake_testlog - path: builddir/Testing/Temporary/LastTest.log + name: macos_xcode_${{ matrix.xcode_version }}_cmake_buildlog + path: builddir/build.ninja build_msys: name: Building on MSYS ${{ matrix.architecture }} @@ -145,20 +139,17 @@ jobs: python -m pip install cmake ninja - name: Configure CMake - run: cmake -S . -B builddir -DWITH_TESTS=ON + run: cmake -S . -B builddir -G "Ninja" -DWITH_TESTS=OFF - name: Build run: cmake --build builddir --config Release - - name: Run Tests - run: cmake --build builddir --target testbed-c - - - name: Upload Test Log + - name: Upload Build Log if: failure() uses: actions/upload-artifact@v4 with: - name: msys_${{ matrix.architecture }}_cmake_testlog - path: builddir/Testing/Temporary/LastTest.log + name: msys_${{ matrix.architecture }}_cmake_buildlog + path: builddir/build.ninja build_posix: name: Build on Linux ${{ matrix.distro }} @@ -199,9 +190,8 @@ jobs: ${GITHUB_REPOSITORY}:${{ matrix.distro }} \ /bin/bash -c " apt-get update - cmake -S . -B builddir -DWITH_TESTS=ON - cmake --build builddir --config Release - cmake --build builddir --target testbed-c" + cmake -S . -B builddir -G Ninja -DWITH_TESTS=OFF + cmake --build builddir --config Release" build_cross: name: Building on Cross Compilation ${{ matrix.architecture }} @@ -246,17 +236,14 @@ jobs: fi - name: Configure CMake - run: cmake -S . -B builddir -DWITH_TESTS=ON + run: cmake -S . -B builddir -G Ninja -DWITH_TESTS=OFF - name: Build run: cmake --build builddir --config Release - - name: Run Tests - run: cmake --build builddir --target testbed-c - - - name: Upload Test Log + - name: Upload Build Log if: failure() uses: actions/upload-artifact@v4 with: - name: cross_${{ matrix.architecture }}_cmake_testlog - path: builddir/Testing/Temporary/LastTest.log + name: cross_${{ matrix.architecture }}_cmake_buildlog + path: builddir/build.ninja From 90d439936260caef5bbbb5fceb6821aafd5ba46f Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:02:53 -0600 Subject: [PATCH 16/30] Update testing.c --- code/logic/testing.c | 1 + 1 file changed, 1 insertion(+) diff --git a/code/logic/testing.c b/code/logic/testing.c index fd7338f8..916b7286 100644 --- a/code/logic/testing.c +++ b/code/logic/testing.c @@ -14,6 +14,7 @@ */ #include "fossil/test/testing.h" + #ifdef __WIN32 // Array of messages for each category const char *sarcastic_messages[] = { From c03d611e7a4ff0acec3b9140b1223eff0881f856 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:05:52 -0600 Subject: [PATCH 17/30] Update Dockerfile.debian --- .github/ciimage/Dockerfile.debian | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/ciimage/Dockerfile.debian b/.github/ciimage/Dockerfile.debian index b192f0b1..493087ca 100644 --- a/.github/ciimage/Dockerfile.debian +++ b/.github/ciimage/Dockerfile.debian @@ -15,8 +15,7 @@ RUN apt-get update && \ gdb \ llvm \ libstdc++-8-dev \ - rustc \ - cargo \ + cmake \ wget \ python3 \ python3-pip \ @@ -25,7 +24,7 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* # Install Meson and Ninja -RUN python3 -m pip install --no-cache-dir cmake meson ninja==1.10.2 +RUN python3 -m pip install --no-cache-dir meson ninja==1.10.2 # Set environment variables ENV CC=/usr/bin/clang From 7402becd50a8a59547676a8554680ff954aece47 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:06:40 -0600 Subject: [PATCH 18/30] Update testing.c --- code/logic/testing.c | 1 - 1 file changed, 1 deletion(-) diff --git a/code/logic/testing.c b/code/logic/testing.c index 916b7286..fd7338f8 100644 --- a/code/logic/testing.c +++ b/code/logic/testing.c @@ -14,7 +14,6 @@ */ #include "fossil/test/testing.h" - #ifdef __WIN32 // Array of messages for each category const char *sarcastic_messages[] = { From f3d828897ce6d53986a6f04cbffd19517d1b8d15 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:13:48 -0600 Subject: [PATCH 19/30] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09630b8c..c1519db7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ # CMakeLists.txt -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.13.4) # Project metadata project(FossilTest VERSION 1.1.5 LANGUAGES C CXX) From 96e7e7c0bf1da6f4cb5fc69caf7c9f693d595c94 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:15:47 -0600 Subject: [PATCH 20/30] Update testing.c --- code/logic/testing.c | 1 + 1 file changed, 1 insertion(+) diff --git a/code/logic/testing.c b/code/logic/testing.c index fd7338f8..916b7286 100644 --- a/code/logic/testing.c +++ b/code/logic/testing.c @@ -14,6 +14,7 @@ */ #include "fossil/test/testing.h" + #ifdef __WIN32 // Array of messages for each category const char *sarcastic_messages[] = { From cd513f7ca6e43d9bea4740338a4ae70c9f9f97ad Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:21:06 -0600 Subject: [PATCH 21/30] Update cmake_ci.yml --- .github/workflows/cmake_ci.yml | 55 ---------------------------------- 1 file changed, 55 deletions(-) diff --git a/.github/workflows/cmake_ci.yml b/.github/workflows/cmake_ci.yml index cb6d4993..0fec8dfe 100644 --- a/.github/workflows/cmake_ci.yml +++ b/.github/workflows/cmake_ci.yml @@ -192,58 +192,3 @@ jobs: apt-get update cmake -S . -B builddir -G Ninja -DWITH_TESTS=OFF cmake --build builddir --config Release" - - build_cross: - name: Building on Cross Compilation ${{ matrix.architecture }} - runs-on: ubuntu-latest - - strategy: - matrix: - architecture: [arm, arm64, mips, mipsel, riscv64, ppc, ppc64le, sparc64, s390x] - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - - name: Install Cross-Compilation Toolchain - run: | - sudo apt-get update - if [ "${{ matrix.architecture }}" == "arm" ]; then - sudo apt-get install -y gcc-arm-linux-gnueabi g++-arm-linux-gnueabi - elif [ "${{ matrix.architecture }}" == "arm64" ]; then - sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - elif [ "${{ matrix.architecture }}" == "mips" ]; then - sudo apt-get install -y gcc-mips-linux-gnu g++-mips-linux-gnu - elif [ "${{ matrix.architecture }}" == "mipsel" ]; then - sudo apt-get install -y gcc-mipsel-linux-gnu g++-mipsel-linux-gnu - elif [ "${{ matrix.architecture }}" == "riscv64" ]; then - sudo apt-get install -y gcc-riscv64-linux-gnu g++-riscv64-linux-gnu - elif [ "${{ matrix.architecture }}" == "ppc" ]; then - sudo apt-get install -y gcc-powerpc-linux-gnu g++-powerpc-linux-gnu - elif [ "${{ matrix.architecture }}" == "ppc64le" ]; then - sudo apt-get install -y gcc-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu - elif [ "${{ matrix.architecture }}" == "sparc64" ]; then - sudo apt-get install -y gcc-sparc64-linux-gnu g++-sparc64-linux-gnu - elif [ "${{ matrix.architecture }}" == "s390x" ]; then - sudo apt-get install -y gcc-s390x-linux-gnu g++-s390x-linux-gnu - fi - - - name: Configure CMake - run: cmake -S . -B builddir -G Ninja -DWITH_TESTS=OFF - - - name: Build - run: cmake --build builddir --config Release - - - name: Upload Build Log - if: failure() - uses: actions/upload-artifact@v4 - with: - name: cross_${{ matrix.architecture }}_cmake_buildlog - path: builddir/build.ninja From 56241b2cd51e361e4187031818d43bcfac2b9853 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:21:25 -0600 Subject: [PATCH 22/30] Update testing.c --- code/logic/testing.c | 1 - 1 file changed, 1 deletion(-) diff --git a/code/logic/testing.c b/code/logic/testing.c index 916b7286..fd7338f8 100644 --- a/code/logic/testing.c +++ b/code/logic/testing.c @@ -14,7 +14,6 @@ */ #include "fossil/test/testing.h" - #ifdef __WIN32 // Array of messages for each category const char *sarcastic_messages[] = { From 38b3f336dc6d55c7abba1e2f00cc8ba8012fc5c7 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:41:18 -0600 Subject: [PATCH 23/30] Update README.md --- README.md | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8af7fdf5..b7e103fa 100644 --- a/README.md +++ b/README.md @@ -28,13 +28,14 @@ Together, **Fossil Test**, **Fossil Mock**, and **Fossil Mark** offer a powerful To get started with Fossil Test, ensure you have the following installed: -- **Meson Build System**: Fossil Test requires Meson. If you don’t have Meson installed, follow the installation instructions on the official [Meson website](https://mesonbuild.com/Getting-meson.html). +- **Meson Build System**: If you don’t have Meson installed, follow the installation instructions on the official [Meson website](https://mesonbuild.com/Getting-meson.html). +- **CMake Build System**: If you don’t have CMake installed, follow the installation instructions on the official [CMake website](https://cmake.org/getting-started/). --- ### Adding Fossil Test Dependency -To integrate Fossil Test into your project, follow these steps: +#### Adding Fossil Test Dependency With Meson 1. **Install Meson Build System**: Install Meson version `1.3` or newer: @@ -64,10 +65,40 @@ To integrate Fossil Test into your project, follow these steps: dep = dependency('fossil-test') ``` - **Note**: For the best experience, always use the latest release of Fossil Test. Visit the [Fossil Test Releases](https://github.com/fossillogic/fossil-test/releases) page for the latest versions. +--- + +#### Adding Fossil Test Dependency With CMake + +To use Fossil Test with CMake, follow these steps: + +1. **Install CMake**: + Install CMake version `3.13.4` or newer: + + ```sh + python -m pip install cmake # To install Meson + python -m pip install --upgrade cmake # To upgrade Meson + ``` + +2. **Find and Integrate Fossil Test**: + After installing CMake, you can integrate Fossil Test as a dependency. Add the following lines to your `CMakeLists.txt` file: + + ```cmake + # Find Fossil Test package + find_package(FossilTest REQUIRED) + + # Link the Fossil Test to your project + target_link_libraries(your_target FossilTest) + ``` + +3. **Configure Your CMake Project**: + Make sure to configure your CMake project to include the necessary paths and dependencies for Fossil Test. Typically, you’ll want to make sure the `FossilTest` library is correctly linked in your build configuration. + + This will ensure that Fossil Test is included and properly built with your project. --- +**Note**: For the best experience, always use the latest release of Fossil Test. Visit the [Fossil Test Releases](https://github.com/fossillogic/fossil-test/releases) page for the latest versions. + ## Fossil Test CLI Usage The Fossil Test CLI provides an efficient way to run and manage tests directly from the terminal. Here are the available commands and options: @@ -164,6 +195,8 @@ To configure the build system with testing enabled, use the following command: meson setup builddir -Dwith_test=enabled ``` +For CMake, ensure the appropriate flags and dependencies are passed during the configuration step. + --- ## ***Contributing and Support*** From 6204fd209d22753f072abc495bdc59b1088c4db2 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 12:19:41 -0600 Subject: [PATCH 24/30] Update cmake_ci.yml --- .github/workflows/cmake_ci.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cmake_ci.yml b/.github/workflows/cmake_ci.yml index 0fec8dfe..96448c16 100644 --- a/.github/workflows/cmake_ci.yml +++ b/.github/workflows/cmake_ci.yml @@ -7,7 +7,6 @@ on: - "**.h" - "**.cpp" - "**.hpp" - - "**.rs" - "**.py" - "**.build" - "**.options" @@ -17,7 +16,6 @@ on: - "**.h" - "**.cpp" - "**.hpp" - - "**.rs" - "**.py" - "**.build" - "**.options" @@ -58,11 +56,14 @@ jobs: $env:CXX="cl.exe" - name: Configure CMake - run: cmake -S . -B build_msvc_${{ matrix.msvc_version }} -G "Ninja" -DWITH_TESTS=OFF + run: cmake -S . -B build_msvc_${{ matrix.msvc_version }} -G "Ninja" -DWITH_TESTS=ON - name: Build run: cmake --build build_msvc_${{ matrix.msvc_version }} --config Release + - name: Run Tests + run: cmake --build build_msvc_${{ matrix.msvc_version }} --target testbed-c + - name: Upload Build Log if: failure() uses: actions/upload-artifact@v4 @@ -95,11 +96,14 @@ jobs: python -m pip install cmake ninja - name: Configure CMake - run: cmake -S . -B builddir -G "Ninja" -DWITH_TESTS=OFF + run: cmake -S . -B builddir -G "Ninja" -DWITH_TESTS=ON - name: Build run: cmake --build builddir --config Release + - name: Run Tests + run: cmake --build builddir --target testbed-c + - name: Upload Build Log if: failure() uses: actions/upload-artifact@v4 @@ -139,11 +143,14 @@ jobs: python -m pip install cmake ninja - name: Configure CMake - run: cmake -S . -B builddir -G "Ninja" -DWITH_TESTS=OFF + run: cmake -S . -B builddir -G "Ninja" -DWITH_TESTS=ON - name: Build run: cmake --build builddir --config Release + - name: Run Tests + run: cmake --build builddir --target testbed-c + - name: Upload Build Log if: failure() uses: actions/upload-artifact@v4 @@ -190,5 +197,6 @@ jobs: ${GITHUB_REPOSITORY}:${{ matrix.distro }} \ /bin/bash -c " apt-get update - cmake -S . -B builddir -G Ninja -DWITH_TESTS=OFF - cmake --build builddir --config Release" + cmake -S . -B builddir -G Ninja -DWITH_TESTS=ON + cmake --build builddir --config Release + cmake --build builddir --target testbed-c" From b0c18b1d64c615711f41c26c8d989ae6aab0da24 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding@users.noreply.github.com> Date: Thu, 23 Jan 2025 12:20:38 -0600 Subject: [PATCH 25/30] Update testing.c --- code/logic/testing.c | 1 + 1 file changed, 1 insertion(+) diff --git a/code/logic/testing.c b/code/logic/testing.c index fd7338f8..916b7286 100644 --- a/code/logic/testing.c +++ b/code/logic/testing.c @@ -14,6 +14,7 @@ */ #include "fossil/test/testing.h" + #ifdef __WIN32 // Array of messages for each category const char *sarcastic_messages[] = { From 8ca035dc1439e1d21de99480a957f5557a370a10 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" Date: Thu, 23 Jan 2025 12:56:33 -0600 Subject: [PATCH 26/30] remove test step for now --- code/CMakeLists.txt | 1 - code/tests/CMakeLists.txt | 41 --------------------------------------- 2 files changed, 42 deletions(-) delete mode 100644 code/tests/CMakeLists.txt diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index b2f13bfa..a633a8a7 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -2,4 +2,3 @@ # Add subdirectories for logic and tests add_subdirectory(logic) -add_subdirectory(tests) diff --git a/code/tests/CMakeLists.txt b/code/tests/CMakeLists.txt deleted file mode 100644 index d9fe6c64..00000000 --- a/code/tests/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -# logic/tests/CMakeLists.txt - -# Check if testing is enabled -option(WITH_TEST "Enable building and running tests" ON) - -if(WITH_TEST) - # Run the generate-runner.py script - execute_process( - COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/../tools/generate-runner.py - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - RESULT_VARIABLE GENERATE_RUNNER_RESULT - ) - if(NOT GENERATE_RUNNER_RESULT EQUAL 0) - message(FATAL_ERROR "Failed to run generate-runner.py") - endif() - - # Define the test sources - set(TEST_C ${CMAKE_CURRENT_SOURCE_DIR}/unit_runner.c) - - # Define test cases - set(TEST_CASES sample bdd tdd ddd mark mock) - - # Append the test case sources - foreach(CASE IN LISTS TEST_CASES) - list(APPEND TEST_C - ${CMAKE_CURRENT_SOURCE_DIR}/cases/test_${CASE}.c - ${CMAKE_CURRENT_SOURCE_DIR}/cases/test_${CASE}.cpp - ) - endforeach() - - # Create the executable for tests - add_executable(testbed-c ${TEST_C}) - - # Link dependencies and include directories - target_include_directories(testbed-c PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..) - target_link_libraries(testbed-c PRIVATE fossil_test_dep) - - # Add the test - enable_testing() - add_test(NAME "fossil testing C" COMMAND testbed-c) -endif() From 856b79b4f885521bac371d52c947a89fd8047886 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" Date: Thu, 23 Jan 2025 12:56:46 -0600 Subject: [PATCH 27/30] add cross targets to CI file --- .github/workflows/cmake_ci.yml | 103 +++++++++++++++++++++++++++++---- 1 file changed, 92 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cmake_ci.yml b/.github/workflows/cmake_ci.yml index 96448c16..3b3952ea 100644 --- a/.github/workflows/cmake_ci.yml +++ b/.github/workflows/cmake_ci.yml @@ -61,9 +61,6 @@ jobs: - name: Build run: cmake --build build_msvc_${{ matrix.msvc_version }} --config Release - - name: Run Tests - run: cmake --build build_msvc_${{ matrix.msvc_version }} --target testbed-c - - name: Upload Build Log if: failure() uses: actions/upload-artifact@v4 @@ -101,9 +98,6 @@ jobs: - name: Build run: cmake --build builddir --config Release - - name: Run Tests - run: cmake --build builddir --target testbed-c - - name: Upload Build Log if: failure() uses: actions/upload-artifact@v4 @@ -148,9 +142,6 @@ jobs: - name: Build run: cmake --build builddir --config Release - - name: Run Tests - run: cmake --build builddir --target testbed-c - - name: Upload Build Log if: failure() uses: actions/upload-artifact@v4 @@ -198,5 +189,95 @@ jobs: /bin/bash -c " apt-get update cmake -S . -B builddir -G Ninja -DWITH_TESTS=ON - cmake --build builddir --config Release - cmake --build builddir --target testbed-c" + cmake --build builddir --config Release" + + build_cross: + name: Building on Bedrock ${{ matrix.architecture }} + runs-on: ubuntu-latest # Using Ubuntu as the base system for cross-compilation + + strategy: + matrix: + architecture: [arm, arm64, mips, mipsel, riscv64, ppc, ppc64le, sparc64, s390x] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install Cross-Compilation Toolchain + run: | + sudo apt-get update + if [ "${{ matrix.architecture }}" == "arm" ]; then + sudo apt-get install -y gcc-arm-linux-gnueabi g++-arm-linux-gnueabi + elif [ "${{ matrix.architecture }}" == "arm64" ]; then + sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu + elif [ "${{ matrix.architecture }}" == "mips" ]; then + sudo apt-get install -y gcc-mips-linux-gnu g++-mips-linux-gnu + elif [ "${{ matrix.architecture }}" == "mipsel" ]; then + sudo apt-get install -y gcc-mipsel-linux-gnu g++-mipsel-linux-gnu + elif [ "${{ matrix.architecture }}" == "riscv64" ]; then + sudo apt-get install -y gcc-riscv64-linux-gnu g++-riscv64-linux-gnu + elif [ "${{ matrix.architecture }}" == "ppc" ]; then + sudo apt-get install -y gcc-powerpc-linux-gnu g++-powerpc-linux-gnu + elif [ "${{ matrix.architecture }}" == "ppc64le" ]; then + sudo apt-get install -y gcc-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu + elif [ "${{ matrix.architecture }}" == "sparc64" ]; then + sudo apt-get install -y gcc-sparc64-linux-gnu g++-sparc64-linux-gnu + elif [ "${{ matrix.architecture }}" == "s390x" ]; then + sudo apt-get install -y gcc-s390x-linux-gnu g++-s390x-linux-gnu + fi + + - name: Set Cross-Compilation Environment Variables + run: | + if [ "${{ matrix.architecture }}" == "arm" ]; then + echo "CC=arm-linux-gnueabi-gcc" >> $GITHUB_ENV + echo "CXX=arm-linux-gnueabi-g++" >> $GITHUB_ENV + elif [ "${{ matrix.architecture }}" == "arm64" ]; then + echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV + echo "CXX=aarch64-linux-gnu-g++" >> $GITHUB_ENV + elif [ "${{ matrix.architecture }}" == "mips" ]; then + echo "CC=mips-linux-gnu-gcc" >> $GITHUB_ENV + echo "CXX=mips-linux-gnu-g++" >> $GITHUB_ENV + elif [ "${{ matrix.architecture }}" == "mipsel" ]; then + echo "CC=mipsel-linux-gnu-gcc" >> $GITHUB_ENV + echo "CXX=mipsel-linux-gnu-g++" >> $GITHUB_ENV + elif [ "${{ matrix.architecture }}" == "riscv64" ]; then + echo "CC=riscv64-linux-gnu-gcc" >> $GITHUB_ENV + echo "CXX=riscv64-linux-gnu-g++" >> $GITHUB_ENV + elif [ "${{ matrix.architecture }}" == "ppc" ]; then + echo "CC=powerpc-linux-gnu-gcc" >> $GITHUB_ENV + echo "CXX=powerpc-linux-gnu-g++" >> $GITHUB_ENV + elif [ "${{ matrix.architecture }}" == "ppc64le" ]; then + echo "CC=powerpc64le-linux-gnu-gcc" >> $GITHUB_ENV + echo "CXX=powerpc64le-linux-gnu-g++" >> $GITHUB_ENV + elif [ "${{ matrix.architecture }}" == "sparc64" ]; then + echo "CC=sparc64-linux-gnu-gcc" >> $GITHUB_ENV + echo "CXX=sparc64-linux-gnu-g++" >> $GITHUB_ENV + elif [ "${{ matrix.architecture }}" == "s390x" ]; then + echo "CC=s390x-linux-gnu-gcc" >> $GITHUB_ENV + echo "CXX=s390x-linux-gnu-g++" >> $GITHUB_ENV + fi + + - name: Install CMake and Ninja + run: | + python -m pip install cmake ninja + + - name: Configure CMake + run: cmake -S . -B builddir -G "Ninja" -DWITH_TESTS=ON + + - name: Build + run: cmake --build builddir --config Release + + - name: Upload Build Log + if: failure() + uses: actions/upload-artifact@v4 + with: + name: cross_${{ matrix.architecture }}_cmake_buildlog + path: builddir/build.ninja + \ No newline at end of file From 823bc8018991f041bc178277e456409b4081ce85 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" Date: Thu, 23 Jan 2025 12:57:05 -0600 Subject: [PATCH 28/30] trigger CI --- code/logic/testing.c | 1 + 1 file changed, 1 insertion(+) diff --git a/code/logic/testing.c b/code/logic/testing.c index 916b7286..727c84ae 100644 --- a/code/logic/testing.c +++ b/code/logic/testing.c @@ -15,6 +15,7 @@ #include "fossil/test/testing.h" + #ifdef __WIN32 // Array of messages for each category const char *sarcastic_messages[] = { From f37fc49d85a3c11aac2301116dea908e32ac7ccd Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" Date: Thu, 23 Jan 2025 13:08:54 -0600 Subject: [PATCH 29/30] 1.1.5 to 1.1.6 --- CMakeLists.txt | 2 +- README.md | 2 +- code/logic/testing.c | 2 +- meson.build | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c1519db7..630e0ffe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.13.4) # Project metadata -project(FossilTest VERSION 1.1.5 LANGUAGES C CXX) +project(FossilTest VERSION 1.1.6 LANGUAGES C CXX) # Set the C and C++ standards set(CMAKE_C_STANDARD 11) diff --git a/README.md b/README.md index b7e103fa..d06056fa 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ To get started with Fossil Test, ensure you have the following installed: # ====================== [wrap-git] url = https://github.com/fossillogic/fossil-test.git - revision = v1.1.5 + revision = v1.1.6 [provide] fossil-test = fossil_test_dep diff --git a/code/logic/testing.c b/code/logic/testing.c index 727c84ae..2aab2a9b 100644 --- a/code/logic/testing.c +++ b/code/logic/testing.c @@ -294,7 +294,7 @@ static const char *FOSSIL_TEST_COMMANDS[] = { "dry-run [enable|disable] - Enables or disables dry-run mode\n" }; -static const char *FOSSIL_TEST_VERSION = "1.1.5"; // Version of Fossil Test +static const char *FOSSIL_TEST_VERSION = "1.1.6"; // Version of Fossil Test static const char *FOSSIL_TEST_AUTHOR = "Michael Gene Brockus (Dreamer)"; // Author of Fossil Test static const char *FOSSIL_TEST_LICENSE = "Mozilla Public License 2.0"; // License of Fossil Test diff --git a/meson.build b/meson.build index ee68b76f..c96ae8f3 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('Fossil Test', 'c', 'cpp', meson_version: '>=1.3.0', license: 'MPL-2.0', - version: '1.1.5', + version: '1.1.6', default_options: ['c_std=c11,c18', 'cpp_std=c++20']) subdir('code') From 80b65b5dbb044b9647e2d574b302787f65160137 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" Date: Thu, 23 Jan 2025 13:09:40 -0600 Subject: [PATCH 30/30] remove newlines --- code/logic/testing.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/logic/testing.c b/code/logic/testing.c index 2aab2a9b..eaf7b257 100644 --- a/code/logic/testing.c +++ b/code/logic/testing.c @@ -14,8 +14,6 @@ */ #include "fossil/test/testing.h" - - #ifdef __WIN32 // Array of messages for each category const char *sarcastic_messages[] = {