diff --git a/test/run-tests.sh b/test/run-tests.sh index a8f301b5..34af8d07 100644 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -186,6 +186,77 @@ etl_version=$(echo $etl_version_raw | sed -e 's/\r//g') # Remove trailing \r gcc_compiler=$(g++ --version | grep g++) clang_compiler=$(clang++ --version | grep clang) +#****************************************************************************** +# GCC +#****************************************************************************** +if [ "$compiler_enabled" = "gcc" ] || [ "$compiler_enabled" = "All compilers" ]; then +compiler=$gcc_compiler +SetConfigurationName "STL" +PrintHeader +rm * -rf +cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF .. +cmake --build . +if [ $? -eq 0 ]; then + PassedCompilation +else + FailedCompilation + exit $? +fi +./etl_tests +if [ $? -eq 0 ]; then + PassedTests +else + FailedTests + exit $? +fi +fi + +#****************************************************************************** +if [ "$compiler_enabled" = "gcc" ] || [ "$compiler_enabled" = "All compilers" ]; then +compiler=$gcc_compiler +SetConfigurationName "STL - Non-virtual messages" +PrintHeader +rm * -rf +cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=ON .. +cmake --build . +if [ $? -eq 0 ]; then + PassedCompilation +else + FailedCompilation + exit $? +fi +./etl_tests +if [ $? -eq 0 ]; then + PassedTests +else + FailedTests + exit $? +fi +fi + +#****************************************************************************** +if [ "$compiler_enabled" = "gcc" ] || [ "$compiler_enabled" = "All compilers" ]; then +compiler=$gcc_compiler +SetConfigurationName "STL - Force C++03" +PrintHeader +rm * -rf +cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF .. +cmake --build . +if [ $? -eq 0 ]; then + PassedCompilation +else + FailedCompilation + exit $? +fi +./etl_tests +if [ $? -eq 0 ]; then + PassedTests +else + FailedTests + exit $? +fi +fi + #****************************************************************************** if [ "$compiler_enabled" = "gcc" ] || [ "$compiler_enabled" = "All compilers" ]; then compiler=$gcc_compiler @@ -235,6 +306,50 @@ fi #****************************************************************************** # CLANG #****************************************************************************** +if [ "$compiler_enabled" = "clang" ] || [ "$compiler_enabled" = "All compilers" ]; then +compiler=$clang_compiler +SetConfigurationName "STL" +PrintHeader +rm * -rf +cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF .. +cmake --build . +if [ $? -eq 0 ]; then + PassedCompilation +else + FailedCompilation + exit $? +fi +./etl_tests +if [ $? -eq 0 ]; then + PassedTests +else + FailedTests + exit $? +fi +fi + +#****************************************************************************** +if [ "$compiler_enabled" = "clang" ] || [ "$compiler_enabled" = "All compilers" ]; then +compiler=$clang_compiler +SetConfigurationName "STL - Force C++03" +PrintHeader +rm * -rf +cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF .. +cmake --build . +if [ $? -eq 0 ]; then + PassedCompilation +else + FailedCompilation + exit $? +fi +./etl_tests +if [ $? -eq 0 ]; then + PassedTests +else + FailedTests + exit $? +fi +fi #****************************************************************************** if [ "$compiler_enabled" = "clang" ] || [ "$compiler_enabled" = "All compilers" ]; then @@ -282,6 +397,262 @@ else fi fi +#****************************************************************************** +if [ "$compiler_enabled" = "gcc" ] || [ "$compiler_enabled" = "All compilers" ]; then +compiler=$gcc_compiler +SetConfigurationName "Initializer list test" +PrintHeader +cd ../etl_initializer_list/ +mkdir -p build-make || exit 1 +cd build-make || exit 1 +rm * -rf +cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize .. +cmake --build . +if [ $? -eq 0 ]; then + PassedCompilation +else + FailedCompilation + exit $? +fi +./etl_tests +if [ $? -eq 0 ]; then + PassedTests +else + FailedTests + exit $? +fi +fi + +#****************************************************************************** +if [ "$compiler_enabled" = "clang" ] || [ "$compiler_enabled" = "All compilers" ]; then +compiler=$clang_compiler +SetConfigurationName "Initializer list test" +PrintHeader +rm * -rf +cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize .. +cmake --build . +if [ $? -eq 0 ]; then + PassedCompilation +else + FailedCompilation + exit $? +fi +./etl_tests +if [ $? -eq 0 ]; then + PassedTests +else + FailedTests + exit $? +fi +fi + +#****************************************************************************** +if [ "$compiler_enabled" = "gcc" ] || [ "$compiler_enabled" = "All compilers" ]; then +compiler=$gcc_compiler +SetConfigurationName "Error macros 'log_errors' test" +PrintHeader +cd ../../etl_error_handler/log_errors +mkdir -p build-make || exit 1 +cd build-make || exit 1 +rm * -rf +cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize .. +cmake --build . +if [ $? -eq 0 ]; then + PassedCompilation +else + FailedCompilation + exit $? +fi +./etl_tests +if [ $? -eq 0 ]; then + PassedTests +else + FailedTests + exit $? +fi +fi + +#****************************************************************************** +if [ "$compiler_enabled" = "gcc" ] || [ "$compiler_enabled" = "All compilers" ]; then +compiler=$gcc_compiler +SetConfigurationName "Error macros 'exceptions' test" +PrintHeader +cd ../../../etl_error_handler/exceptions +mkdir -p build-make || exit 1 +cd build-make || exit 1 +rm * -rf +cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize .. +cmake --build . +if [ $? -eq 0 ]; then + PassedCompilation +else + FailedCompilation + exit $? +fi +./etl_tests +if [ $? -eq 0 ]; then + PassedTests +else + FailedTests + exit $? +fi +fi + +#****************************************************************************** +if [ "$compiler_enabled" = "gcc" ] || [ "$compiler_enabled" = "All compilers" ]; then +compiler=$gcc_compiler +SetConfigurationName "Error macros 'log_errors and exceptions' test" +PrintHeader +cd ../../../etl_error_handler/log_errors_and_exceptions +mkdir -p build-make || exit 1 +cd build-make || exit 1 +rm * -rf +cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize .. +cmake --build . +if [ $? -eq 0 ]; then + PassedCompilation +else + FailedCompilation + exit $? +fi +./etl_tests +if [ $? -eq 0 ]; then + PassedTests +else + FailedTests + exit $? +fi +fi + +#****************************************************************************** +if [ "$compiler_enabled" = "gcc" ] || [ "$compiler_enabled" = "All compilers" ]; then +compiler=$gcc_compiler +SetConfigurationName "Error macros 'assert function' test" +PrintHeader +cd ../../../etl_error_handler/assert_function +mkdir -p build-make || exit 1 +cd build-make || exit 1 +rm * -rf +cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize .. +cmake --build . +if [ $? -eq 0 ]; then + PassedCompilation +else + FailedCompilation + exit $? +fi +./etl_tests +if [ $? -eq 0 ]; then + PassedTests +else + FailedTests + exit $? +fi +fi + +#****************************************************************************** +if [ "$compiler_enabled" = "clang" ] || [ "$compiler_enabled" = "All compilers" ]; then +compiler=$clang_compiler +SetConfigurationName "Error macros 'log_errors' test" +PrintHeader +cd ../../../etl_error_handler/log_errors +mkdir -p build-make || exit 1 +cd build-make || exit 1 +rm * -rf +cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize .. +cmake --build . +if [ $? -eq 0 ]; then + PassedCompilation +else + FailedCompilation + exit $? +fi +./etl_tests +if [ $? -eq 0 ]; then + PassedTests +else + FailedTests + exit $? +fi +fi + +#****************************************************************************** +if [ "$compiler_enabled" = "clang" ] || [ "$compiler_enabled" = "All compilers" ]; then +compiler=$clang_compiler +SetConfigurationName "Error macros 'exceptions' test" +PrintHeader +cd ../../../etl_error_handler/exceptions +mkdir -p build-make || exit 1 +cd build-make || exit 1 +rm * -rf +cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize .. +cmake --build . +if [ $? -eq 0 ]; then + PassedCompilation +else + FailedCompilation + exit $? +fi +./etl_tests +if [ $? -eq 0 ]; then + PassedTests +else + FailedTests + exit $? +fi +fi + +#****************************************************************************** +if [ "$compiler_enabled" = "clang" ] || [ "$compiler_enabled" = "All compilers" ]; then +compiler=$clang_compiler +SetConfigurationName "Error macros 'log_errors and exceptions' test" +PrintHeader +cd ../../../etl_error_handler/log_errors_and_exceptions +mkdir -p build-make || exit 1 +cd build-make || exit 1 +rm * -rf +cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize .. +cmake --build . +if [ $? -eq 0 ]; then + PassedCompilation +else + FailedCompilation + exit $? +fi +./etl_tests +if [ $? -eq 0 ]; then + PassedTests +else + FailedTests + exit $? +fi +fi + +#****************************************************************************** +if [ "$compiler_enabled" = "clang" ] || [ "$compiler_enabled" = "All compilers" ]; then +compiler=$clang_compiler +SetConfigurationName "Error macros 'assert function' test" +PrintHeader +cd ../../../etl_error_handler/assert_function +mkdir -p build-make || exit 1 +cd build-make || exit 1 +rm * -rf +cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize .. +cmake --build . +if [ $? -eq 0 ]; then + PassedCompilation +else + FailedCompilation + exit $? +fi +./etl_tests +if [ $? -eq 0 ]; then + PassedTests +else + FailedTests + exit $? +fi +fi cd ../.. diff --git a/test/test_message_packet.cpp b/test/test_message_packet.cpp index e59228de..a13830c8 100644 --- a/test/test_message_packet.cpp +++ b/test/test_message_packet.cpp @@ -50,21 +50,24 @@ namespace struct Message1 : public etl::message { Message1(int x_) - : x(x_) + : etl::message() + , x(x_) , moved(false) , copied(false) { } Message1(const Message1& other) - : x(other.x) + : etl::message() + , x(other.x) , moved(false) , copied(true) { } Message1(Message1&& other) - : x(std::move(other.x)) + : etl::message() + , x(std::move(other.x)) , moved(true) , copied(false) { @@ -94,21 +97,24 @@ namespace struct Message2 : public etl::message { Message2(double x_) - : x(x_) + : etl::message() + , x(x_) , moved(false) , copied(false) { } Message2(const Message2& other) - : x(other.x) + : etl::message() + , x(other.x) , moved(false) , copied(true) { } Message2(Message2&& other) - : x(std::move(other.x)) + : etl::message() + , x(std::move(other.x)) , moved(true) , copied(false) { @@ -138,28 +144,32 @@ namespace struct Message3 : public etl::message { Message3(const std::string& x_) - : x(x_) + : etl::message() + , x(x_) , moved(false) , copied(false) { } Message3(std::string&& x_) - : x(std::move(x_)) + : etl::message() + , x(std::move(x_)) , moved(true) , copied(false) { } Message3(const Message3& other) - : x(other.x) + : etl::message() + , x(other.x) , moved(false) , copied(true) { } Message3(Message3&& other) - : x(std::move(other.x)) + : etl::message() + , x(std::move(other.x)) , moved(true) , copied(false) { diff --git a/test/vs2022/etl.vcxproj.filters b/test/vs2022/etl.vcxproj.filters index 641d7c16..5251ef8b 100644 --- a/test/vs2022/etl.vcxproj.filters +++ b/test/vs2022/etl.vcxproj.filters @@ -3410,12 +3410,6 @@ Tests\Syntax Checks\Source - - Tests - - - Tests - Tests\Types @@ -3425,11 +3419,17 @@ Tests\Error Handler\Assert Function - - Tests - - Tests + Tests\Types + + + Tests\Patterns + + + Tests\Syntax Checks\Source + + + Tests\Syntax Checks\Source