Skip to content

Commit 41c2af0

Browse files
committed
[Change] Sync test/archlinux/aur_poc/ with test/
1 parent 47e4c18 commit 41c2af0

File tree

11 files changed

+144
-16
lines changed

11 files changed

+144
-16
lines changed

test/archlinux/aur_poc/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ else()
132132
target_link_libraries(test_ezargs PRIVATE bux Catch2::Catch2WithMain stdc++ m)
133133
endif()
134134
add_test(NAME test_ezargs_All COMMAND test_ezargs)
135+
135136
add_executable(test_ezscape test_ezscape.cpp)
136137
target_include_directories(test_ezscape PRIVATE ../include)
137138
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
@@ -158,3 +159,12 @@ else()
158159
target_link_libraries(test_paralog PRIVATE bux Catch2::Catch2WithMain stdc++ m pthread)
159160
endif()
160161
add_test(NAME test_paralog_All COMMAND test_paralog)
162+
163+
add_executable(test_unicodecvt test_unicodecvt.cpp)
164+
target_include_directories(test_unicodecvt PRIVATE ../include)
165+
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
166+
target_link_libraries(test_unicodecvt PRIVATE bux Catch2::Catch2WithMain)
167+
else()
168+
target_link_libraries(test_unicodecvt PRIVATE bux Catch2::Catch2WithMain stdc++ m)
169+
endif()
170+
add_test(NAME test_unicodecvt_All COMMAND test_unicodecvt)

test/archlinux/aur_poc/smoke_cerrlog.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//#define TURN_OFF_LOGGER_
12
//#define LOGGER_USE_LOCAL_TIME_ std::chrono::get_tzdb().current_zone()
23
//#define LOGGER_USE_LOCAL_TIME_ std::chrono::get_tzdb().locate_zone("Asia/Taipei")
34
#include <bux/Logger.h> // DEF_LOGGER_CERR()

test/archlinux/aur_poc/smoke_coutlog.cpp

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,64 @@
1+
//#define TURN_OFF_LOGGER_
12
#include <bux/Logger.h> // DEF_LOGGER_COUT()
23
#include <iostream> // std::cout
34

45
DEF_LOGGER_COUT()
56
//DEF_LOGGER_COUT(LL_WARNING)
67

8+
void fun9()
9+
{
10+
FUNLOGX9('1','2','3','4','5','6','7','8','9');
11+
LOG1(LL_INFO, "End of indentation");
12+
}
13+
14+
void fun8()
15+
{
16+
FUNLOGX8('1','2','3','4','5','6','7','8');
17+
fun9();
18+
}
19+
20+
void fun7()
21+
{
22+
FUNLOGX7('1','2','3','4','5','6','7');
23+
fun8();
24+
}
25+
26+
void fun6()
27+
{
28+
FUNLOGX6('1','2','3','4','5','6');
29+
fun7();
30+
}
31+
32+
void fun5()
33+
{
34+
FUNLOGX5('1','2','3','4','5');
35+
fun6();
36+
}
37+
38+
void fun4()
39+
{
40+
FUNLOGX4('1','2','3','4');
41+
fun5();
42+
}
43+
44+
void fun3()
45+
{
46+
FUNLOGX3('1','2','3');
47+
fun4();
48+
}
49+
50+
void fun2()
51+
{
52+
FUNLOGX2('1','2');
53+
fun3();
54+
}
55+
56+
void fun1()
57+
{
58+
FUNLOGX1('1');
59+
fun2();
60+
}
61+
762
int main()
863
{
964
LOG(LL_FATAL, "Hello fatal");
@@ -13,4 +68,17 @@ int main()
1368
FUNLOG;
1469
LOG(LL_INFO, "Hello info");
1570
LOG(LL_VERBOSE, "Hello verbose");
71+
//---------------------------------
72+
LOG1(LL_INFO, "{}");
73+
//---------------------------------
74+
SCOPELOGX1("Indent", 1);
75+
SCOPELOGX2("Indent", 1, 2);
76+
SCOPELOGX3("Indent", 1, 2, 3);
77+
SCOPELOGX4("Indent", 1, 2, 3, 4);
78+
SCOPELOGX5("Indent", 1, 2, 3, 4, 5);
79+
SCOPELOGX6("Indent", 1, 2, 3, 4, 5, 6);
80+
SCOPELOGX7("Indent", 1, 2, 3, 4, 5, 6, 7);
81+
SCOPELOGX8("Indent", 1, 2, 3, 4, 5, 6, 7, 8);
82+
SCOPELOGX9("Indent", 1, 2, 3, 4, 5, 6, 7, 8, 9);
83+
fun1();
1684
}

test/archlinux/aur_poc/smoke_filelog.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//#define TURN_OFF_LOGGER_
12
//#define LOGGER_USE_LOCAL_TIME_ false
23
#include <bux/Logger.h> // DEF_LOGGER_FILE()
34
#include <fstream> // std::ofstream
@@ -6,9 +7,10 @@ DEF_LOGGER_FILE("log/test.log", LL_INFO)
67

78
int main()
89
{
10+
#ifndef TURN_OFF_LOGGER_
911
if (bux::C_UseLog u{bux::logger()})
1012
*u <<std::boolalpha <<"LOGGER_USE_LOCAL_TIME_: " <<LOGGER_USE_LOCAL_TIME_ <<"\n";
11-
13+
#endif
1214
LOG(LL_FATAL, "Hello fatal");
1315
FUNLOG;
1416
LOG(LL_ERROR, "Hello error");

test/archlinux/aur_poc/smoke_timelog.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//#define TURN_OFF_LOGGER_
12
//#define LOGGER_USE_LOCAL_TIME_ false
23
#include <bux/Logger.h> // DEF_LOGGER_FILES(), DEF_FALLBACK_LOGGER_FILES()
34
#include <bux/FileLog.h> // bux::C_PathFmtLogSnap
@@ -30,9 +31,10 @@ static const struct { bux::E_LogLevel ll; const char *msg; } LOG_SRC[] = {
3031

3132
int main(int argc, const char *argv[])
3233
{
34+
#ifndef TURN_OFF_LOGGER_
3335
if (bux::C_UseLog u{bux::logger()})
3436
*u <<std::boolalpha <<"LOGGER_USE_LOCAL_TIME_: " <<LOGGER_USE_LOCAL_TIME_ <<"\n";
35-
37+
#endif
3638
if (argc <= 1)
3739
{
3840
for (auto i: LOG_SRC)

test/archlinux/aur_poc/test_atomix.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
http://blog.wingman-sw.com/tdd-guided-by-zombies
44
*/
55
#include "bux/AtomiX.h"
6-
7-
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
86
#include <catch2/catch_test_macros.hpp>
97

108
TEST_CASE("Empty cache", "[Z]")

test/archlinux/aur_poc/test_ezargs.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33
http://blog.wingman-sw.com/tdd-guided-by-zombies
44
*/
55
#include <bux/EZArgs.h> // bux::C_EZArgs, bux::C_ErrorOrIndex
6-
7-
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
8-
#include <catch2/catch_test_macros.hpp>
9-
106
#include <charconv> // std::from_chars()
117
#include <filesystem> // std::filesystem::*
128
#include <ranges> // std::ranges::views::empty<>
9+
#include <catch2/catch_test_macros.hpp>
1310

1411
namespace {
1512

@@ -107,6 +104,7 @@ TEST_CASE("Scenario: Subcommand help", "[S]") // for commit 42ee62ad4e8c3139b978
107104
REQUIRE(std::getline(in, line));
108105
CHECK(line == "USAGE: test1.exe foo <eeny> [-h]");
109106
}
107+
110108
TEST_CASE("Scenario: Parse negative number as flag value", "[S]")
111109
{
112110
double x{};

test/archlinux/aur_poc/test_ezscape.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
http://blog.wingman-sw.com/tdd-guided-by-zombies
44
*/
55
#include <bux/EZScape.h> // bux::easy_escape(), bux::easy_unescape()
6-
7-
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
8-
#include <catch2/catch_test_macros.hpp>
9-
106
#include <curl/curl.h> // curl_easy_escape(), curl_easy_unescape()
7+
#include <catch2/catch_test_macros.hpp>
118

129
namespace {
1310

test/archlinux/aur_poc/test_logger.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
*/
77
#include <bux/Logger.h> // LOG(), LOG_RAW(), ...
88
#include <random> // std::mt19937
9-
10-
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
119
#include <catch2/catch_test_macros.hpp>
1210

1311
namespace {

test/archlinux/aur_poc/test_paralog.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
#include <bux/Logger.h> // DEF_LOGGER_TAIL_, LOG(), LOG_RAW()
66
#include <bux/ParaLog.h> // bux::C_ParaLog
77
#include <random> // std::mt19937
8-
9-
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
108
#include <catch2/catch_test_macros.hpp>
119

1210
namespace bux { namespace user { // Mildly modified from definition of DEF_PARA_LOGGER

0 commit comments

Comments
 (0)