tests: enable fast_atof() benchmark check only for release builds
This commit is contained in:
parent
775c756818
commit
9dc842a35d
@ -43,6 +43,14 @@ if(CMAKE_COMPILER_IS_GNUCC
|
|||||||
set(CMAKE_C_COMPILER_IS_GCC_COMPATIBLE 1) # Compatible with GNUCC options
|
set(CMAKE_C_COMPILER_IS_GCC_COMPATIBLE 1) # Compatible with GNUCC options
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Build type
|
||||||
|
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
|
||||||
|
if(CMAKE_BUILD_TYPE_LOWER MATCHES "debug")
|
||||||
|
set(GMIO_DEBUG_BUILD 1)
|
||||||
|
else()
|
||||||
|
set(GMIO_DEBUG_BUILD 0)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Options
|
# Options
|
||||||
option(GMIO_BUILD_STRICT_C90 "Build gmio library(and tests) with strict conformance to C90 standard" OFF)
|
option(GMIO_BUILD_STRICT_C90 "Build gmio library(and tests) with strict conformance to C90 standard" OFF)
|
||||||
option(GMIO_BUILD_SHARED_LIBS "Build gmio as a shared library (DLL)" OFF)
|
option(GMIO_BUILD_SHARED_LIBS "Build gmio as a shared library (DLL)" OFF)
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
#ifndef GMIO_CONFIG_H_CMAKE
|
#ifndef GMIO_CONFIG_H_CMAKE
|
||||||
#define GMIO_CONFIG_H_CMAKE
|
#define GMIO_CONFIG_H_CMAKE
|
||||||
|
|
||||||
|
/* Build type */
|
||||||
|
#cmakedefine GMIO_DEBUG_BUILD
|
||||||
|
|
||||||
/* Size(in bytes) of integer types */
|
/* Size(in bytes) of integer types */
|
||||||
#cmakedefine GMIO_SIZEOF_SHORT @GMIO_SIZEOF_SHORT@
|
#cmakedefine GMIO_SIZEOF_SHORT @GMIO_SIZEOF_SHORT@
|
||||||
#cmakedefine GMIO_SIZEOF_INT @GMIO_SIZEOF_INT@
|
#cmakedefine GMIO_SIZEOF_INT @GMIO_SIZEOF_INT@
|
||||||
|
@ -177,7 +177,9 @@ const char* test_internal__benchmark_gmio_fast_atof()
|
|||||||
header,
|
header,
|
||||||
bmk_res_array);
|
bmk_res_array);
|
||||||
|
|
||||||
|
#ifndef GMIO_DEBUG_BUILD /* Check only for release builds */
|
||||||
UTEST_ASSERT((1.2*bmk_res.func1_exec_time_ms) < bmk_res.func2_exec_time_ms);
|
UTEST_ASSERT((1.2*bmk_res.func1_exec_time_ms) < bmk_res.func2_exec_time_ms);
|
||||||
|
#endif
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user