mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-09 22:59:47 +08:00
Added CMakeFiles.txt for initializer_list tests
This commit is contained in:
parent
98a79362e1
commit
9a1705ed4c
4
.gitignore
vendored
4
.gitignore
vendored
@ -354,3 +354,7 @@ test/vs2019/Debug Intel
|
||||
test/vs2019/Debug Intel - No STL
|
||||
EmbeddedTemplateLibrary-20.24.1.tar.gz
|
||||
test/etl_initializer_list/.vs
|
||||
test/build-etl_initializer_list-Desktop_x86_windows_msvc2019_pe_32bit-Debug
|
||||
test/build-etl_initializer_list-GCC-Debug
|
||||
test/etl_initializer_list/etl_initializer_list.vcxproj.filters
|
||||
test/etl_initializer_list/build-make
|
||||
|
||||
@ -3,6 +3,9 @@
|
||||
Added message_timer_interrupt
|
||||
Added callback_timer_interrupt
|
||||
Changed message_timer_atomic and callback_timer_atomic to require an atomic counter template type.
|
||||
Added extra condition compile macros to control std::initializer_list.
|
||||
Initializer list tests are in a separate project.
|
||||
Modified etl::instance_count to take an optional counter type.
|
||||
Renamed Arduino files to stop PlatformIO getting confused.
|
||||
Changed from C cast to C++ cast in memory.h
|
||||
Always use stddef.h
|
||||
|
||||
34
test/etl_initializer_list/CMakeLists.txt
Normal file
34
test/etl_initializer_list/CMakeLists.txt
Normal file
@ -0,0 +1,34 @@
|
||||
cmake_minimum_required(VERSION 3.5.0)
|
||||
project(etl_initializer_list_unit_tests)
|
||||
|
||||
add_definitions(-DETL_DEBUG)
|
||||
add_definitions(-DETL_NO_STL)
|
||||
add_definitions(-DETL_FORCE_ETL_INITIALIZER_LIST)
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR}/../../include)
|
||||
|
||||
set(TEST_SOURCE_FILES
|
||||
test_initializer_list.cpp
|
||||
)
|
||||
|
||||
add_executable(etl_tests
|
||||
${TEST_SOURCE_FILES}
|
||||
)
|
||||
|
||||
target_include_directories(etl_tests
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
)
|
||||
|
||||
# Enable the 'make test' CMake target using the executable defined above
|
||||
add_test(etl_initializer_list_unit_tests etl_tests)
|
||||
|
||||
# Since ctest will only show you the results of the single executable
|
||||
# define a target that will output all of the failing or passing tests
|
||||
# as they appear from UnitTest++
|
||||
add_custom_target(test_verbose COMMAND ${CMAKE_CTEST_COMMAND} --verbose)
|
||||
|
||||
|
||||
#RSG
|
||||
set_property(TARGET etl_tests PROPERTY CXX_STANDARD 17)
|
||||
|
||||
@ -26,6 +26,9 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="test_initializer_list.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="CMakeLists.txt" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
|
||||
@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\include\etl\initializer_list.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\etl\utility.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\etl\placement_new.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="test_initializer_list.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@ -173,6 +173,53 @@ 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
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
CC=gcc CXX=g++ cmake --cmake-clean-cache ..
|
||||
make -j8
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed initializer_list >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed initializer_list ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed >>>>"
|
||||
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
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
CC=clang CXX=clang++ cmake --cmake-clean-cache ..
|
||||
make -j8
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed initializer_list >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed initializer_list ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
cd ../..
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " All Tests Completed OK" | tee -a log.txt
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user