From 1e77d14c052bb6488872ae7d4ee7b8c20fa07c77 Mon Sep 17 00:00:00 2001 From: Ken Matsui <26405363+ken-matsui@users.noreply.github.com> Date: Mon, 18 Dec 2023 00:21:08 -0800 Subject: [PATCH] Run tests with debug --- .github/workflows/linux.yml | 2 +- .github/workflows/macos.yml | 2 +- src/Cmd/Test.cc | 5 +++++ src/Logger.hpp | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 8445045e6..55708f383 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -65,7 +65,7 @@ jobs: run: ./poac-out/debug/poac test --verbose - name: Third Generation Build & Test - run: ./poac-out/debug/poac --verbose run --release test --verbose --release + run: ./poac-out/debug/poac --verbose run --release test --verbose # - name: Test Poac # run: ctest --output-on-failure --verbose diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index cebd29e00..6af2c00da 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -37,7 +37,7 @@ jobs: run: ./poac-out/debug/poac test --verbose - name: Third Generation Build & Test - run: ./poac-out/debug/poac --verbose run --release test --verbose --release + run: ./poac-out/debug/poac --verbose run --release test --verbose # - name: Test Poac # run: ctest --output-on-failure --verbose diff --git a/src/Cmd/Test.cc b/src/Cmd/Test.cc index fbec9d406..930e9165c 100644 --- a/src/Cmd/Test.cc +++ b/src/Cmd/Test.cc @@ -1,10 +1,15 @@ #include "Test.hpp" #include "../BuildConfig.hpp" +#include "../Logger.hpp" #include int test(Vec args) { + if (!args.empty() && (args[0] == "-r" || args[0] == "--release")) { + Logger::warn("The `--release` flag can disable assert macros."); + } + const String outDir = emitMakefile(args.empty() ? "" : args[0]); return std::system(("make -C " + outDir + " test").c_str()); } diff --git a/src/Logger.hpp b/src/Logger.hpp index b2531d640..d07d38b00 100644 --- a/src/Logger.hpp +++ b/src/Logger.hpp @@ -23,7 +23,7 @@ class Logger { getInstance().log(LogLevel::error, std::forward(message)...); } template - static void warning(Args... message) { + static void warn(Args... message) { getInstance().log(LogLevel::warning, std::forward(message)...); } template