mirror of
https://github.com/ETLCPP/etl.git
synced 2026-05-01 11:29:09 +08:00
C++14 compiler compatibility Updated test run scripts Changed some ETL_ASSERT macros to ETL_ASSERT_OR_RETURN Changed unit test macros for C++20 compaibility Updated test run scripts Updated CMake files to allow C++ standard selection Replaced ETL_ASSERT_AND_RETURN with ETL_ASSERT_OR_RETURN Updated C++14 & C++20 unit test compatibility Changed native char8_t check Added optional optimisation argument to bash script
239 lines
7.7 KiB
Bash
239 lines
7.7 KiB
Bash
#!/bin/sh
|
|
clear
|
|
|
|
mkdir -p build-make || exit 1
|
|
cd build-make || exit 1
|
|
|
|
echo "ETL Tests" > log.txt
|
|
|
|
opt="-O2"
|
|
|
|
#******************************************************************************
|
|
# GCC
|
|
#******************************************************************************
|
|
echo ""
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
echo " GCC - STL" | tee -a log.txt
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
rm * -rf
|
|
gcc --version | grep gcc | tee -a log.txt
|
|
cmake -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 ..
|
|
make -j4
|
|
if [ $? -eq 0 ]; then
|
|
echo "<<<< Passed Compilation >>>>"
|
|
else
|
|
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
|
exit $?
|
|
fi
|
|
./etl_tests
|
|
if [ $? -eq 0 ]; then
|
|
echo "<<<< Passed Tests >>>>"
|
|
else
|
|
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
|
exit $?
|
|
fi
|
|
|
|
echo ""
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
echo " GCC - Initializer list test" | tee -a log.txt
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
cd ../etl_initializer_list/
|
|
mkdir -p build-make || exit 1
|
|
cd build-make || exit 1
|
|
rm * -rf
|
|
gcc --version | grep gcc | tee -a log.txt
|
|
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
|
make -j4
|
|
if [ $? -eq 0 ]; then
|
|
echo "<<<< Passed initializer_list Compilation >>>>"
|
|
else
|
|
echo "****************\n**** Failed initializer_list ****\n****************" | tee -a ../log.txt
|
|
exit $?
|
|
fi
|
|
./etl_tests
|
|
if [ $? -eq 0 ]; then
|
|
echo "<<<< Passed Tests >>>>"
|
|
else
|
|
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
|
exit $?
|
|
fi
|
|
|
|
echo ""
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
echo " Clang - Initializer list test" | tee -a log.txt
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
rm * -rf
|
|
clang --version | grep clang | tee -a log.txt
|
|
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
|
make -j4
|
|
if [ $? -eq 0 ]; then
|
|
echo "<<<< Passed initializer_list Compilation >>>>"
|
|
else
|
|
echo "****************\n**** Failed initializer_list ****\n****************" | tee -a ../log.txt
|
|
exit $?
|
|
fi
|
|
./etl_tests
|
|
if [ $? -eq 0 ]; then
|
|
echo "<<<< Passed Tests >>>>"
|
|
else
|
|
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
|
exit $?
|
|
fi
|
|
|
|
echo ""
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
echo " GCC - Error macros 'log_errors' test" | tee -a log.txt
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
cd ../../etl_error_handler/log_errors
|
|
mkdir -p build-make || exit 1
|
|
cd build-make || exit 1
|
|
rm * -rf
|
|
gcc --version | grep gcc | tee -a log.txt
|
|
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
|
make -j4
|
|
if [ $? -eq 0 ]; then
|
|
echo "<<<< Passed Error macros 'log_errors' Compilation >>>>"
|
|
else
|
|
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
|
exit $?
|
|
fi
|
|
./etl_tests
|
|
if [ $? -eq 0 ]; then
|
|
echo "<<<< Passed Tests >>>>"
|
|
else
|
|
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
|
exit $?
|
|
fi
|
|
|
|
echo ""
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
echo " GCC - Error macros 'exceptions' test" | tee -a log.txt
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
cd ../../../etl_error_handler/exceptions
|
|
mkdir -p build-make || exit 1
|
|
cd build-make || exit 1
|
|
rm * -rf
|
|
gcc --version | grep gcc | tee -a log.txt
|
|
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
|
make -j4
|
|
if [ $? -eq 0 ]; then
|
|
echo "<<<< Passed Error macros 'exceptions' Compilation >>>>"
|
|
else
|
|
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
|
exit $?
|
|
fi
|
|
./etl_tests
|
|
if [ $? -eq 0 ]; then
|
|
echo "<<<< Passed Tests >>>>"
|
|
else
|
|
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
|
exit $?
|
|
fi
|
|
|
|
echo ""
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
echo " GCC - Error macros 'log_errors and exceptions' test" | tee -a log.txt
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
cd ../../../etl_error_handler/log_errors_and_exceptions
|
|
mkdir -p build-make || exit 1
|
|
cd build-make || exit 1
|
|
rm * -rf
|
|
gcc --version | grep gcc | tee -a log.txt
|
|
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
|
make -j4
|
|
if [ $? -eq 0 ]; then
|
|
echo "<<<< Passed Error macros 'log_errors and exceptions' Compilation >>>>"
|
|
else
|
|
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
|
exit $?
|
|
fi
|
|
./etl_tests
|
|
if [ $? -eq 0 ]; then
|
|
echo "<<<< Passed Tests >>>>"
|
|
else
|
|
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
|
exit $?
|
|
fi
|
|
|
|
echo ""
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
echo " Clang - Error macros 'log_errors' test" | tee -a log.txt
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
cd ../../../etl_error_handler/log_errors
|
|
mkdir -p build-make || exit 1
|
|
cd build-make || exit 1
|
|
rm * -rf
|
|
clang --version | grep clang | tee -a log.txt
|
|
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
|
make -j4
|
|
if [ $? -eq 0 ]; then
|
|
echo "<<<< Passed Error macros 'log_errors' Compilation >>>>"
|
|
else
|
|
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
|
exit $?
|
|
fi
|
|
./etl_tests
|
|
if [ $? -eq 0 ]; then
|
|
echo "<<<< Passed Tests >>>>"
|
|
else
|
|
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
|
exit $?
|
|
fi
|
|
|
|
echo ""
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
echo " Clang - Error macros 'exceptions' test" | tee -a log.txt
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
cd ../../../etl_error_handler/exceptions
|
|
mkdir -p build-make || exit 1
|
|
cd build-make || exit 1
|
|
rm * -rf
|
|
clang --version | grep clang | tee -a log.txt
|
|
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
|
make -j4
|
|
if [ $? -eq 0 ]; then
|
|
echo "<<<< Passed Error macros 'exceptions' Compilation >>>>"
|
|
else
|
|
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
|
exit $?
|
|
fi
|
|
./etl_tests
|
|
if [ $? -eq 0 ]; then
|
|
echo "<<<< Passed Tests >>>>"
|
|
else
|
|
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
|
exit $?
|
|
fi
|
|
|
|
echo ""
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
echo " Clang - Error macros 'log_errors and exceptions' test" | tee -a log.txt
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
cd ../../../etl_error_handler/log_errors_and_exceptions
|
|
mkdir -p build-make || exit 1
|
|
cd build-make || exit 1
|
|
rm * -rf
|
|
clang --version | grep clang | tee -a log.txt
|
|
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
|
make -j4
|
|
if [ $? -eq 0 ]; then
|
|
echo "<<<< Passed Error macros 'log_errors and exceptions' Compilation >>>>"
|
|
else
|
|
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
|
exit $?
|
|
fi
|
|
./etl_tests
|
|
if [ $? -eq 0 ]; then
|
|
echo "<<<< Passed Tests >>>>"
|
|
else
|
|
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
|
exit $?
|
|
fi
|
|
|
|
cd ../..
|
|
|
|
echo ""
|
|
echo "-----------------------------------------------" | tee -a log.txt
|
|
echo " All Tests Completed OK" | tee -a log.txt
|
|
echo "-----------------------------------------------" | tee -a log.txt
|