From 23d6a74edfa2e7bfa5c0b9092edc260f394d89c9 Mon Sep 17 00:00:00 2001 From: BELLIER Sacha Date: Sun, 27 Oct 2024 19:04:49 +0100 Subject: [PATCH] wip: winlibs doesn't support cc_test... ? --- .github/workflows/StreamFormat.yml | 10 ++++++---- BUILD.bazel | 1 - Examples/.bazelrc | 4 ++++ Examples/MODULE.bazel | 9 ++++----- Tests/Tests.cpp | 1 + 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/StreamFormat.yml b/.github/workflows/StreamFormat.yml index fece995..9fa1c12 100644 --- a/.github/workflows/StreamFormat.yml +++ b/.github/workflows/StreamFormat.yml @@ -34,10 +34,12 @@ jobs: with: path: "~/.cache/bazel" key: bazel - - name: Build And Test Winlibs/clang... - run: bazelisk test --config=winlibs-clang //:StreamFormatTests - - name: Build And Test Winlibs/gcc... - run: bazelisk test --config=winlibs-gcc //:StreamFormatTests + - name: Build Winlibs/clang... + run: bazelisk build --config=winlibs-clang //:StreamFormatTests + - name: Test Winlibs/clang... + run: bazel-bin/StreamFormatTests.exe + - name: Build Winlibs/gcc... + run: bazelisk build --config=winlibs-gcc //:StreamFormatTests ubuntu-latest-gcc: runs-on: ubuntu-latest diff --git a/BUILD.bazel b/BUILD.bazel index 1c21d89..2d3733d 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -19,7 +19,6 @@ cc_library( cc_test( name = "StreamFormatTests", - includes = [ "src/" ], srcs = glob([ "Tests/**/*.h", "Tests/**/*.cpp" ]), copts = select({ "@rules_cc//cc/compiler:msvc-cl": ["/std:c++20"], diff --git a/Examples/.bazelrc b/Examples/.bazelrc index 39ef8d3..0cd88d0 100644 --- a/Examples/.bazelrc +++ b/Examples/.bazelrc @@ -4,3 +4,7 @@ common --incompatible_strict_action_env common --show_timestamps common --verbose_failures test --test_output=errors + +# Winlibs +common:winlibs-gcc --extra_toolchains=@ex_winlibs//:gcc-toolchain +common:winlibs-clang --extra_toolchains=@pthread-ex_winlibs//:clang-toolchain diff --git a/Examples/MODULE.bazel b/Examples/MODULE.bazel index 4278094..4c1607f 100644 --- a/Examples/MODULE.bazel +++ b/Examples/MODULE.bazel @@ -20,8 +20,7 @@ bazel_dep(name = "streamformat") winlibs_toolchain_extension = use_extension("@bazel_winlibs//:rules.bzl", "winlibs_toolchain_extension") inject_repo(winlibs_toolchain_extension, "platforms", "bazel_utilities") -winlibs_toolchain_extension.winlibs_toolchain(name = "winlibs") -winlibs_toolchain_extension.winlibs_toolchain(name = "pthread-winlibs", linklibs = [ "pthread" ]) -use_repo(winlibs_toolchain_extension, "winlibs") -use_repo(winlibs_toolchain_extension, "pthread-winlibs") -# register_toolchains("@winlibs//:clang-toolchain") \ No newline at end of file +winlibs_toolchain_extension.winlibs_toolchain(name = "ex_winlibs") +winlibs_toolchain_extension.winlibs_toolchain(name = "pthread-ex_winlibs", linklibs = [ "pthread" ]) +use_repo(winlibs_toolchain_extension, "ex_winlibs") +use_repo(winlibs_toolchain_extension, "pthread-ex_winlibs") \ No newline at end of file diff --git a/Tests/Tests.cpp b/Tests/Tests.cpp index ad2d7f5..b5d3dd8 100644 --- a/Tests/Tests.cpp +++ b/Tests/Tests.cpp @@ -1,5 +1,6 @@ #include "StreamFormat/Tester/TestSuite/AllTestSuite.h" +#include "StreamFormat/FLog/DefaultLogger.h" int main() {