Skip to content

Commit 219158f

Browse files
committed
[Change] bux::expand_env() is unusable sometimes (eg. when APPLE is **TRUE**)
1 parent 60ef00b commit 219158f

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/StrUtil.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#elif defined(__unix__) || defined(__unix) || defined(__gnu_linux__)
1010
#include <wordexp.h> // wordexp(), wordfree()
1111
#else
12-
#error "Platform other than Windows and Unix-like not supported yet"
12+
#warning "Calling bux::expand_env() will get thrown an exception"
1313
#endif
1414
#ifdef __unix__
1515
#include <cxxabi.h> // abi::__cxa_demangle()

test/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ else()
7171
target_link_libraries(smoke_timestamp PRIVATE bux stdc++)
7272
endif()
7373

74+
if(NOT APPLE)
7475
add_executable(test_expand_env test_expand_env.cpp)
7576
#target_compile_options(test_expand_env PUBLIC -D_GLIBCXX_USE_CXX11_ABI=1)
7677
target_include_directories(test_expand_env PRIVATE ../include)
@@ -94,6 +95,7 @@ add_test(NAME test_pass_env
9495
COMMAND test_expand_env env "USER"
9596
)
9697
set_tests_properties(test_pass_env PROPERTIES PASS_REGULAR_EXPRESSION "$ENV{USER}")
98+
endif()
9799

98100
find_package(Catch2 REQUIRED)
99101
include(Catch)

test/archlinux/aur_poc/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ else()
7979
target_link_libraries(smoke_timestamp PRIVATE bux stdc++)
8080
endif()
8181

82+
if(NOT APPLE)
8283
add_executable(test_expand_env test_expand_env.cpp)
8384
#target_compile_options(test_expand_env PUBLIC -D_GLIBCXX_USE_CXX11_ABI=1)
8485
target_include_directories(test_expand_env PRIVATE ../include)
@@ -102,6 +103,7 @@ add_test(NAME test_pass_env
102103
COMMAND test_expand_env env "USER"
103104
)
104105
set_tests_properties(test_pass_env PROPERTIES PASS_REGULAR_EXPRESSION "$ENV{USER}")
106+
endif()
105107

106108
find_package(Catch2 REQUIRED)
107109
include(Catch)

0 commit comments

Comments
 (0)