You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
Drone build
run unittests
This commit is contained in:
committed by
Leonid Fedorov
parent
73e710ed52
commit
f584e90718
@ -1,63 +1,43 @@
|
||||
include_directories( ${ENGINE_COMMON_INCLUDES} )
|
||||
|
||||
if (WITH_UNITTESTS)
|
||||
enable_testing()
|
||||
include(GoogleTest)
|
||||
find_package(GTest REQUIRED)
|
||||
|
||||
enable_testing()
|
||||
include(GoogleTest)
|
||||
find_package(GTest REQUIRED)
|
||||
|
||||
if (WITH_UNITTESTS OR WITH_ROWGROUP_UT)
|
||||
#GoogleTest tests
|
||||
add_executable(rowgroup_tests rowgroup-tests.cpp)
|
||||
target_link_libraries(rowgroup_tests ${ENGINE_LDFLAGS} ${GTEST_LIBRARIES} ${ENGINE_EXEC_LIBS} ${MARIADB_CLIENT_LIBS})
|
||||
# target_include_directories(rowgroup_tests ${GTEST_INCLUDE_DIR})
|
||||
install(TARGETS rowgroup_tests DESTINATION ${ENGINE_BINDIR} COMPONENT columnstore-engine)
|
||||
gtest_discover_tests(rowgroup_tests TEST_PREFIX columnstore:)
|
||||
endif()
|
||||
|
||||
if (WITH_UNITTESTS OR WITH_ARITHMETICOPERATOR_UT)
|
||||
add_executable(arithmeticoperator_tests arithmeticoperator-tests.cpp)
|
||||
target_link_libraries(arithmeticoperator_tests ${ENGINE_LDFLAGS} ${GTEST_LIBRARIES} ${ENGINE_EXEC_LIBS} ${MARIADB_CLIENT_LIBS})
|
||||
install(TARGETS arithmeticoperator_tests DESTINATION ${ENGINE_BINDIR} COMPONENT columnstore-engine)
|
||||
gtest_discover_tests(arithmeticoperator_tests TEST_PREFIX columnstore:)
|
||||
endif()
|
||||
|
||||
if (WITH_UNITTESTS OR WITH_CSDECIMAL_UT)
|
||||
add_executable(mcs_decimal_tests mcs_decimal-tests.cpp)
|
||||
target_link_libraries(mcs_decimal_tests ${ENGINE_LDFLAGS} ${GTEST_LIBRARIES} ${ENGINE_EXEC_LIBS} ${MARIADB_CLIENT_LIBS})
|
||||
install(TARGETS mcs_decimal_tests DESTINATION ${ENGINE_BINDIR} COMPONENT columnstore-engine)
|
||||
gtest_discover_tests(mcs_decimal_tests TEST_PREFIX columnstore:)
|
||||
endif()
|
||||
|
||||
if (WITH_UNITTESTS OR WITH_DATACONVERT_UT)
|
||||
add_executable(dataconvert_tests dataconvert-tests.cpp)
|
||||
target_link_libraries(dataconvert_tests ${ENGINE_LDFLAGS} ${GTEST_LIBRARIES} ${ENGINE_EXEC_LIBS} ${MARIADB_CLIENT_LIBS})
|
||||
install(TARGETS dataconvert_tests DESTINATION ${ENGINE_BINDIR} COMPONENT columnstore-engine)
|
||||
gtest_discover_tests(dataconvert_tests TEST_PREFIX columnstore:)
|
||||
endif()
|
||||
|
||||
if (WITH_UNITTESTS OR WITH_SORTING_COMPARATORS_UT)
|
||||
add_executable(comparators_tests comparators-tests.cpp)
|
||||
target_link_libraries(comparators_tests ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS} ${CPPUNIT_LIBRARIES} cppunit)
|
||||
install(TARGETS comparators_tests DESTINATION ${ENGINE_BINDIR} COMPONENT columnstore-engine)
|
||||
gtest_discover_tests(comparators_tests TEST_PREFIX columnstore:)
|
||||
endif()
|
||||
add_executable(rebuild_em_tests rebuild-em-tests.cpp)
|
||||
target_link_libraries(rebuild_em_tests ${ENGINE_LDFLAGS} ${GTEST_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS})
|
||||
gtest_discover_tests(rebuild_em_tests TEST_PREFIX columnstore:)
|
||||
|
||||
if (WITH_UNITTESTS OR WITH_SHARED_COMP_TESTS)
|
||||
add_executable(compression_tests compression-tests.cpp)
|
||||
target_link_libraries(compression_tests ${ENGINE_LDFLAGS} ${GTEST_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS})
|
||||
gtest_discover_tests(compression_tests TEST_PREFIX columnstore:)
|
||||
|
||||
# CPPUNIT TESTS
|
||||
add_executable(we_shared_components_tests shared_components_tests.cpp)
|
||||
add_dependencies(we_shared_components_tests loggingcpp)
|
||||
target_link_libraries(we_shared_components_tests ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS} cppunit)
|
||||
install(TARGETS we_shared_components_tests DESTINATION ${ENGINE_BINDIR} COMPONENT columnstore-engine)
|
||||
endif()
|
||||
#Fix Test and uncomment
|
||||
#add_test(NAME columnstore:we_shared_components_tests, COMMAND we_shared_components_tests)
|
||||
|
||||
if (WITH_UNITTESTS OR WITH_REBUILD_EM_UT)
|
||||
add_executable(rebuild_em_tests rebuild-em-tests.cpp)
|
||||
target_link_libraries(rebuild_em_tests ${ENGINE_LDFLAGS} ${GTEST_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS})
|
||||
install(TARGETS rebuild_em_tests DESTINATION ${ENGINE_BINDIR} COMPONENT columnstore-engine)
|
||||
gtest_discover_tests(rebuild_em_tests TEST_PREFIX columnstore:)
|
||||
endif()
|
||||
|
||||
if (WITH_UNITTESTS OR WITH_COMPRESSION_UT)
|
||||
add_executable(compression_tests compression-tests.cpp)
|
||||
target_link_libraries(compression_tests ${ENGINE_LDFLAGS} ${GTEST_LIBRARIES} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS})
|
||||
install(TARGETS compression_tests DESTINATION ${ENGINE_BINDIR} COMPONENT columnstore-engine)
|
||||
gtest_discover_tests(compression_tests TEST_PREFIX columnstore:)
|
||||
add_executable(comparators_tests comparators-tests.cpp)
|
||||
target_link_libraries(comparators_tests ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_WRITE_LIBS} ${CPPUNIT_LIBRARIES} cppunit)
|
||||
add_test(NAME columnstore:comparators_tests, COMMAND comparators_tests)
|
||||
endif()
|
||||
|
@ -129,7 +129,7 @@ class FilterDriver : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
private:
|
||||
// The tests creates an RG with 1 column of the cscDt type
|
||||
// The tests creates an RG with 1 column of the cscDt type
|
||||
// then initialize RGData. After that it adds two numeric values (v1 < v2)and two NULL.
|
||||
// Then creates comparator structures and run a number of tests. v1 < v2
|
||||
void testComparatorWithDT(execplan::CalpontSystemCatalog::ColDataType cscDt,
|
||||
@ -381,31 +381,32 @@ private:
|
||||
idbCompare.initialize(inRG);
|
||||
ordering::OrderByData odbData = ordering::OrderByData(specVect, inRG);
|
||||
bool result = odbData(r1.getPointer(), r2.getPointer());
|
||||
std::cout << r1.toString() << " < " << r2.toString() << " is "
|
||||
std::cout << r1.toString() << " < " << r2.toString() << " is "
|
||||
<< ((result) ? "true" : "false") << std::endl;
|
||||
CPPUNIT_ASSERT(result == true);
|
||||
result = odbData(r2.getPointer(), r1.getPointer());
|
||||
std::cout << r2.toString() << " < " << r1.toString() << " is "
|
||||
std::cout << r2.toString() << " < " << r1.toString() << " is "
|
||||
<< ((result) ? "true" : "false") << std::endl;
|
||||
CPPUNIT_ASSERT(result == false);
|
||||
result = odbData(r2.getPointer(), r2.getPointer());
|
||||
std::cout << r2.toString() << " < " << r2.toString() << " is "
|
||||
std::cout << r2.toString() << " < " << r2.toString() << " is "
|
||||
<< ((result) ? "true" : "false") << std::endl;
|
||||
CPPUNIT_ASSERT(result == false);
|
||||
// Compare value with NULL. if spec.fNf then NULLs goes first
|
||||
// Compare value with NULL. if spec.fNf then NULLs goes first
|
||||
result = odbData(r3.getPointer(), r1.getPointer());
|
||||
std::cout << r3.toString() << " < " << r1.toString() << " is "
|
||||
std::cout << r3.toString() << " < " << r1.toString() << " is "
|
||||
<< ((result) ? "true" : "false") << std::endl;
|
||||
CPPUNIT_ASSERT(result == true);
|
||||
// Compare NULL with NULL
|
||||
result = odbData(r3.getPointer(), r1.getPointer());
|
||||
std::cout << r3.toString() << " < " << r3.toString() << " is "
|
||||
std::cout << r3.toString() << " < " << r3.toString() << " is "
|
||||
<< ((result) ? "true" : "false") << std::endl;
|
||||
CPPUNIT_ASSERT(result == true);
|
||||
}
|
||||
|
||||
void INT_TEST()
|
||||
{
|
||||
#ifdef __x86_64__
|
||||
//bool generateValues = true;
|
||||
bool fixedValues = false;
|
||||
testComparatorWithDT(execplan::CalpontSystemCatalog::UTINYINT, 1, fixedValues, 20);
|
||||
@ -424,6 +425,10 @@ private:
|
||||
testComparatorWithDT(execplan::CalpontSystemCatalog::FLOAT, 4, fixedValues, 20);
|
||||
testComparatorWithDT(execplan::CalpontSystemCatalog::DOUBLE, 8, fixedValues, 20);
|
||||
testComparatorWithDT(execplan::CalpontSystemCatalog::LONGDOUBLE, 8, fixedValues, 20);
|
||||
#elif __arm__
|
||||
// TODO: add arm tests
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void FLOAT_TEST()
|
||||
|
Reference in New Issue
Block a user