Tests: Remove unused test code

This commit is contained in:
Brad King 2025-12-18 09:25:55 -05:00
parent 12be5c60ff
commit a9fea5246f
5 changed files with 0 additions and 106 deletions

View File

@ -3353,75 +3353,6 @@ if(BUILD_TESTING)
endif()
endif()
# add some cross compiler tests, for now only with makefile based generators
if(CMAKE_GENERATOR MATCHES "Makefiles")
# if sdcc is found, build the SimpleCOnly project with sdcc
find_program(SDCC_EXECUTABLE sdcc)
mark_as_advanced(SDCC_EXECUTABLE)
if(SDCC_EXECUTABLE)
add_test(SimpleCOnly_sdcc ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/SimpleCOnly"
"${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc"
${build_generator_args}
--build-project SimpleC
--build-options
"-DCMAKE_SYSTEM_NAME=Generic"
"-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc")
endif()
# If a Linux -> MinGW cross compiler is found then try it
find_program(MINGW_CC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-gcc)
find_program(MINGW_CXX_LINUX2WIN_EXECUTABLE i586-mingw32msvc-g++)
find_program(MINGW_RC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-windres)
mark_as_advanced(MINGW_CC_LINUX2WIN_EXECUTABLE MINGW_CXX_LINUX2WIN_EXECUTABLE MINGW_RC_LINUX2WIN_EXECUTABLE)
if(MINGW_CC_LINUX2WIN_EXECUTABLE AND MINGW_CXX_LINUX2WIN_EXECUTABLE AND MINGW_RC_LINUX2WIN_EXECUTABLE)
add_test(Simple_Mingw_Linux2Win ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/Simple"
"${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win"
${build_generator_args}
--build-project Simple
--build-options
"-DCMAKE_SYSTEM_NAME=Windows"
"-DCMAKE_C_COMPILER=${MINGW_CC_LINUX2WIN_EXECUTABLE}"
"-DCMAKE_CXX_COMPILER=${MINGW_CXX_LINUX2WIN_EXECUTABLE}"
"-DCMAKE_RC_COMPILER=${MINGW_RC_LINUX2WIN_EXECUTABLE}"
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win")
endif()
endif()
if(CMAKE_TEST_PROJECT_CSE_DIR)
set(script "${CMAKE_TEST_PROJECT_CSE_DIR}/BuildProjectCSE.cmake")
if(NOT EXISTS "${script}")
set(script "${CMAKE_TEST_PROJECT_CSE_DIR}/cse_build.cmake")
endif()
if(NOT EXISTS "${script}")
message("warning: CMAKE_TEST_PROJECT_CSE_DIR set, but no build script found...")
endif()
add_test(BuildCSE ${CMAKE_CTEST_COMMAND} -V -S "${script}")
set_tests_properties(BuildCSE PROPERTIES TIMEOUT 5400)
endif()
if(CMAKE_TEST_PLPLOT_DIR)
add_test(plplot ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_PLPLOT_DIR}/../../EasyDashboardScripts/plplot.cmake)
set_tests_properties ( plplot PROPERTIES TIMEOUT 5400)
endif()
if(CMAKE_TEST_CHICKEN_DIR)
add_test(Chicken ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_CHICKEN_DIR}/../../EasyDashboardScripts/Chicken.cmake)
set_tests_properties(Chicken PROPERTIES TIMEOUT 5400)
endif()
if(CMAKE_TEST_KDELIBS_ALPHA_1_DIR)
add_test(KDELibsAlpha1 ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_KDELIBS_ALPHA_1_DIR}/../../EasyDashboardScripts/kdelibs.cmake)
set_tests_properties(KDELibsAlpha1 PROPERTIES TIMEOUT 5400)
endif()
# Define a set of "contract" tests, each activated by a cache entry
# named "CMake_TEST_CONTRACT_<project>". For each Contract test,
# the project should provide a directory with a CMakeLists.txt file

View File

@ -1,17 +0,0 @@
# this enables only C, i.e. disables C++
project(SimpleCOnly C)
add_library(SimpleCLib STATIC bar.c foo.c)
add_executable(SimpleC main.c)
target_link_libraries(SimpleC SimpleCLib)
# and some check, just to make sure it works:
include(CheckTypeSize)
check_type_size(float SIZE_FLOAT)
message(STATUS "sizeof(float): ${SIZE_FLOAT}")
# make sure optimized libs are not used by debug builds
if(CMAKE_BUILD_TYPE MATCHES Debug)
target_link_libraries(Simple optimized c:/not/here.lib )
endif()

View File

@ -1,4 +0,0 @@
int bar(void)
{
return 5;
}

View File

@ -1,4 +0,0 @@
int foo(void)
{
return 12;
}

View File

@ -1,12 +0,0 @@
#include <stdio.h>
extern int foo();
extern int bar();
int main(void)
{
int i = foo();
int k = bar();
i = i * k;
return i;
}