guardsquare / mocxx Goto Github PK
View Code? Open in Web Editor NEWA versatile C++ function mocking framework.
License: GNU General Public License v3.0
A versatile C++ function mocking framework.
License: GNU General Public License v3.0
Trying to compile mocxx on debian buster (latest stable) as described in README.md fails at either compiling or linking stage (both gcc or clang):
flo@tietokone:~/src/foreign/mocxx/build$ cmake ../ -GNinja -DCMAKE_BUILD_TYPE=Debug
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Mocxx 0.1.0
-- Configuring done
-- Generating done
-- Build files have been written to: /home/flo/src/foreign/mocxx/build
flo@tietokone:~/src/foreign/mocxx/build$ ninja
[1/3] Building CXX object test/CMakeFiles/test_mocxx.dir/TestBasics.cpp.o
FAILED: test/CMakeFiles/test_mocxx.dir/TestBasics.cpp.o
/usr/bin/c++ -I../include -I../test/include -I../vendor/catch/include -I../vendor/frida/linux/include -g -fdiagnostics-color=always -O0 -g -fno-inline-functions -fno-inline -std=gnu++17 -MD -MT test/CMakeFiles/test_mocxx.dir/TestBasics.cpp.o -MF test/CMakeFiles/test_mocxx.dir/TestBasics.cpp.o.d -o test/CMakeFiles/test_mocxx.dir/TestBasics.cpp.o -c ../test/TestBasics.cpp
In file included from ../test/TestBasics.cpp:3:
../include/mocxx/Mocxx.hpp:653:8: error: declaration of ‘bool mocxx::Mocxx::ResultGenerator(ResultGenerator&&, TargetResult (*)(TargetArgs ...))’ shadows template parameter
bool ResultGenerator(ResultGenerator&& generator,
^~~~~~~~~~~~~~~
../include/mocxx/Mocxx.hpp:650:12: note: template parameter ‘ResultGenerator’ declared here
template<typename ResultGenerator,
^~~~~~~~
../include/mocxx/Mocxx.hpp:686:8: error: declaration of ‘bool mocxx::Mocxx::ResultConstructor(TargetResult (*)(TargetArgs ...))’ shadows template parameter
bool ResultConstructor(TargetResult (*target)(TargetArgs...))
^~~~~~~~~~~~~~~~~
../include/mocxx/Mocxx.hpp:683:12: note: template parameter ‘ResultConstructor’ declared here
template<typename ResultConstructor,
^~~~~~~~
In file included from ../test/TestBasics.cpp:1:
../test/TestBasics.cpp: In function ‘void ____C_A_T_C_H____T_E_S_T____8()’:
../test/TestBasics.cpp:216:24: error: ‘std::filesystem’ has not been declared
REQUIRE_FALSE(std::filesystem::exists("doesn't exist"));
^~~~~~~~~~
../test/TestBasics.cpp:216:24: error: ‘std::filesystem’ has not been declared
REQUIRE_FALSE(std::filesystem::exists("doesn't exist"));
^~~~~~~~~~
../test/TestBasics.cpp:219:41: error: ‘filesystem’ in namespace ‘std’ does not name a type
REQUIRE(mocxx.Replace([](const std::filesystem::path& p) { return true; },
^~~~~~~~~~
../test/TestBasics.cpp:220:32: error: ‘std::filesystem’ has not been declared
std::filesystem::exists));
^~~~~~~~~~
../test/TestBasics.cpp: In lambda function:
../test/TestBasics.cpp:219:5: error: expected ‘{’ before ‘)’ token
REQUIRE(mocxx.Replace([](const std::filesystem::path& p) { return true; },
^~~~~~~
../test/TestBasics.cpp: In function ‘void ____C_A_T_C_H____T_E_S_T____8()’:
../test/TestBasics.cpp:219:5: error: no matching function for call to ‘mocxx::Mocxx::Replace(____C_A_T_C_H____T_E_S_T____8()::<lambda(int, int)>)’
In file included from ../test/TestBasics.cpp:3:
../include/mocxx/Mocxx.hpp:445:8: note: candidate: ‘template<bool isMember, class Replacement> bool mocxx::Mocxx::Replace(Replacement&&, std::conditional_t<isMember, decltype (mocxx::details::LambdaToMemberFunctionImpl((& Replacement::operator()))), decltype (mocxx::details::LambdaToFreeFunctionImpl((& Replacement::operator())))>)’
bool Replace(
^~~~~~~
../include/mocxx/Mocxx.hpp:445:8: note: template argument deduction/substitution failed:
In file included from ../test/TestBasics.cpp:1:
../test/TestBasics.cpp:219:5: note: candidate expects 2 arguments, 1 provided
REQUIRE(mocxx.Replace([](const std::filesystem::path& p) { return true; },
^~~~~~~
In file included from ../test/TestBasics.cpp:3:
../include/mocxx/Mocxx.hpp:495:8: note: candidate: ‘template<bool isMember, class Replacement> bool mocxx::Mocxx::Replace(Replacement&&, const string&)’
bool Replace(Replacement&& replacement, const std::string& target)
^~~~~~~
../include/mocxx/Mocxx.hpp:495:8: note: template argument deduction/substitution failed:
In file included from ../test/TestBasics.cpp:1:
../test/TestBasics.cpp:219:5: note: candidate expects 2 arguments, 1 provided
REQUIRE(mocxx.Replace([](const std::filesystem::path& p) { return true; },
^~~~~~~
../test/TestBasics.cpp:219:41: error: ‘filesystem’ in namespace ‘std’ does not name a type
REQUIRE(mocxx.Replace([](const std::filesystem::path& p) { return true; },
^~~~~~~~~~
../test/TestBasics.cpp:220:32: error: ‘std::filesystem’ has not been declared
std::filesystem::exists));
^~~~~~~~~~
../test/TestBasics.cpp: In lambda function:
../test/TestBasics.cpp:219:5: error: expected ‘{’ before ‘)’ token
REQUIRE(mocxx.Replace([](const std::filesystem::path& p) { return true; },
^~~~~~~
../test/TestBasics.cpp: In function ‘void ____C_A_T_C_H____T_E_S_T____8()’:
../test/TestBasics.cpp:219:5: error: no matching function for call to ‘mocxx::Mocxx::Replace(____C_A_T_C_H____T_E_S_T____8()::<lambda(int, int)>)’
In file included from ../test/TestBasics.cpp:3:
../include/mocxx/Mocxx.hpp:445:8: note: candidate: ‘template<bool isMember, class Replacement> bool mocxx::Mocxx::Replace(Replacement&&, std::conditional_t<isMember, decltype (mocxx::details::LambdaToMemberFunctionImpl((& Replacement::operator()))), decltype (mocxx::details::LambdaToFreeFunctionImpl((& Replacement::operator())))>)’
bool Replace(
^~~~~~~
../include/mocxx/Mocxx.hpp:445:8: note: template argument deduction/substitution failed:
In file included from ../test/TestBasics.cpp:1:
../test/TestBasics.cpp:219:5: note: candidate expects 2 arguments, 1 provided
REQUIRE(mocxx.Replace([](const std::filesystem::path& p) { return true; },
^~~~~~~
In file included from ../test/TestBasics.cpp:3:
../include/mocxx/Mocxx.hpp:495:8: note: candidate: ‘template<bool isMember, class Replacement> bool mocxx::Mocxx::Replace(Replacement&&, const string&)’
bool Replace(Replacement&& replacement, const std::string& target)
^~~~~~~
../include/mocxx/Mocxx.hpp:495:8: note: template argument deduction/substitution failed:
In file included from ../test/TestBasics.cpp:1:
../test/TestBasics.cpp:219:5: note: candidate expects 2 arguments, 1 provided
REQUIRE(mocxx.Replace([](const std::filesystem::path& p) { return true; },
^~~~~~~
../test/TestBasics.cpp:220:52: error: expected ‘)’ before ‘;’ token
std::filesystem::exists));
^
In file included from ../test/TestBasics.cpp:1:
../test/TestBasics.cpp:219:5: note: to match this ‘(’
REQUIRE(mocxx.Replace([](const std::filesystem::path& p) { return true; },
^~~~~~~
../test/TestBasics.cpp:222:18: error: ‘std::filesystem’ has not been declared
REQUIRE(std::filesystem::exists("how about now?"));
^~~~~~~~~~
../test/TestBasics.cpp:222:18: error: ‘std::filesystem’ has not been declared
REQUIRE(std::filesystem::exists("how about now?"));
^~~~~~~~~~
../test/TestBasics.cpp:226:12: error: ‘std::filesystem’ has not been declared
std::filesystem::exists("another overload still active", error));
^~~~~~~~~~
../test/TestBasics.cpp:226:12: error: ‘std::filesystem’ has not been declared
std::filesystem::exists("another overload still active", error));
^~~~~~~~~~
[2/3] Building CXX object test/CMakeFiles/test_mocxx.dir/Main.cpp.o
ninja: build stopped: subcommand failed.
flo@tietokone:~/src/foreign/mocxx/build$ cd ..
flo@tietokone:~/src/foreign/mocxx$ rm -r build
flo@tietokone:~/src/foreign/mocxx$ mkdir build; cd build
flo@tietokone:~/src/foreign/mocxx/build$ export CC=/usr/bin/clang
flo@tietokone:~/src/foreign/mocxx/build$ export CXX=/usr/bin/clang++
flo@tietokone:~/src/foreign/mocxx/build$ cmake ../ -GNinja -DCMAKE_BUILD_TYPE=Debug
-- The C compiler identification is Clang 7.0.1
-- The CXX compiler identification is Clang 7.0.1
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Mocxx 0.1.0
-- Configuring done
-- Generating done
-- Build files have been written to: /home/flo/src/foreign/mocxx/build
flo@tietokone:~/src/foreign/mocxx/build$ ninja
[3/3] Linking CXX executable test/test_mocxx
FAILED: test/test_mocxx
: && /usr/bin/clang++ -g -lresolv -lpthread -ldl test/CMakeFiles/test_mocxx.dir/Main.cpp.o test/CMakeFiles/test_mocxx.dir/TestBasics.cpp.o -o test/test_mocxx ../vendor/frida/linux/lib/libfrida-gum.a && :
/usr/bin/ld: test/CMakeFiles/test_mocxx.dir/TestBasics.cpp.o: in function `std::filesystem::exists(std::filesystem::__cxx11::path const&)':
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/fs_ops.h:121: undefined reference to `std::filesystem::status(std::filesystem::__cxx11::path const&)'
/usr/bin/ld: test/CMakeFiles/test_mocxx.dir/TestBasics.cpp.o: in function `path<char [14], std::filesystem::__cxx11::path>':
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/fs_path.h:184: undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/usr/bin/ld: test/CMakeFiles/test_mocxx.dir/TestBasics.cpp.o: in function `path<char [15], std::filesystem::__cxx11::path>':
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/fs_path.h:184: undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/usr/bin/ld: test/CMakeFiles/test_mocxx.dir/TestBasics.cpp.o: in function `std::filesystem::exists(std::filesystem::__cxx11::path const&, std::error_code&)':
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/fs_ops.h:126: undefined reference to `std::filesystem::status(std::filesystem::__cxx11::path const&, std::error_code&)'
/usr/bin/ld: test/CMakeFiles/test_mocxx.dir/TestBasics.cpp.o: in function `path<char [30], std::filesystem::__cxx11::path>':
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/fs_path.h:184: undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
# git clone [email protected]:Guardsquare/mocxx.git; cd mocxx
Cloning into 'mocxx'...
remote: Enumerating objects: 80, done.
remote: Counting objects: 100% (80/80), done.
remote: Compressing objects: 100% (51/51), done.
remote: Total 80 (delta 24), reused 63 (delta 13), pack-reused 0
Receiving objects: 100% (80/80), 9.12 MiB | 16.27 MiB/s, done.
Resolving deltas: 100% (24/24), done.
# mkdir build; cd build
# cmake ../ -GNinja -DCMAKE_BUILD_TYPE=Debug
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/root/src/mocxx/build/CMakeFiles/CMakeOutput.log".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.