Commit 37c9eebb authored by Robert Schmidt's avatar Robert Schmidt

NR_RLC: CMakeLists.txt in own subdirectory, with tests

parent 757bebd1
......@@ -1187,18 +1187,6 @@ set(RLC_V2
${OPENAIR2_DIR}/LAYER2/rlc_v2/rlc_sdu.c
)
set(NR_RLC_SRC
${OPENAIR2_DIR}/LAYER2/nr_rlc/asn1_utils.c
${OPENAIR2_DIR}/LAYER2/nr_rlc/nr_rlc_entity.c
${OPENAIR2_DIR}/LAYER2/nr_rlc/nr_rlc_entity_am.c
${OPENAIR2_DIR}/LAYER2/nr_rlc/nr_rlc_entity_tm.c
${OPENAIR2_DIR}/LAYER2/nr_rlc/nr_rlc_entity_um.c
${OPENAIR2_DIR}/LAYER2/nr_rlc/nr_rlc_oai_api.c
${OPENAIR2_DIR}/LAYER2/nr_rlc/nr_rlc_pdu.c
${OPENAIR2_DIR}/LAYER2/nr_rlc/nr_rlc_sdu.c
${OPENAIR2_DIR}/LAYER2/nr_rlc/nr_rlc_ue_manager.c
)
set(NR_PDCP_SRC
${OPENAIR2_DIR}/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
${OPENAIR2_DIR}/LAYER2/nr_pdcp/nr_pdcp_ue_manager.c
......@@ -1256,7 +1244,6 @@ set(L2_LTE_SRC
)
set(L2_NR_SRC
${NR_RLC_SRC}
${NR_PDCP_SRC}
${NR_SDAP_SRC}
${NR_RRC_DIR}/rrc_gNB.c
......@@ -1294,7 +1281,6 @@ set(L2_RRC_SRC_UE
)
set(NR_L2_SRC_UE
${NR_RLC_SRC}
${NR_PDCP_SRC}
${NR_SDAP_SRC}
${NR_UE_RRC_DIR}/L2_interface_ue.c
......@@ -1447,13 +1433,12 @@ add_library(e1_pdcp_if
target_link_libraries(e1_pdcp_if PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
target_link_libraries(L2_NR PRIVATE f1ap x2ap s1ap ngap nr_rrc e1ap)
target_link_libraries(L2_NR PRIVATE f1ap x2ap s1ap ngap nr_rrc e1ap nr_rlc)
if(E2_AGENT)
target_link_libraries(L2_NR PUBLIC e2_agent e2_ran_func)
target_compile_definitions(L2_NR PRIVATE E2_AGENT)
endif()
add_library(L2_LTE_NR
${L2_RRC_SRC}
${MAC_SRC}
......@@ -1482,7 +1467,7 @@ endif()
target_link_libraries(L2_UE PRIVATE asn1_lte_rrc_hdrs)
add_library( NR_L2_UE ${NR_L2_SRC_UE} ${MAC_NR_SRC_UE} )
target_link_libraries(NR_L2_UE PRIVATE f1ap)
target_link_libraries(NR_L2_UE PRIVATE f1ap nr_rlc)
target_link_libraries(NR_L2_UE PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
add_library(MAC_NR_COMMON
......@@ -2450,6 +2435,16 @@ make_driver(ue_ip ${OPENAIR2_DIR}/NETWORK_DRIVER/UE_IP ${ue_ip_src})
include(${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/CMakeLists.txt)
set(ENABLE_TESTS OFF CACHE STRING "Activate build of tests")
set_property(CACHE ENABLE_TESTS PROPERTY TYPE BOOL)
if(ENABLE_TESTS)
# activates globally adding tests such that they can be run using ctest
enable_testing()
# meta-target: each test is supposed to add_dependencies(tests ${NEWTEST})
# then, it is possible to build and execute all tests using "ninja tests && ctest"
add_custom_target(tests)
endif()
add_subdirectory(common)
add_subdirectory(doc)
add_subdirectory(openair1)
......
......@@ -3,6 +3,7 @@ if(E2_AGENT)
add_subdirectory(E2AP)
endif()
add_subdirectory(F1AP)
add_subdirectory(LAYER2)
add_subdirectory(M2AP)
add_subdirectory(X2AP)
add_subdirectory(RRC)
......
add_subdirectory(nr_rlc)
add_library(nr_rlc_core OBJECT
nr_rlc_entity.c
nr_rlc_entity_am.c
nr_rlc_entity_tm.c
nr_rlc_entity_um.c
nr_rlc_pdu.c
nr_rlc_sdu.c)
target_include_directories(nr_rlc_core PRIVATE ../../..)
target_link_libraries(nr_rlc_core PRIVATE ${T_LIB})
add_library(nr_rlc STATIC
asn1_utils.c
nr_rlc_oai_api.c
nr_rlc_ue_manager.c
)
# L2_NR: for PDCP
target_link_libraries(nr_rlc PUBLIC pthread f1ap nr_rlc_core UTIL ${T_LIB})
target_include_directories(nr_rlc PRIVATE ../../..)
target_link_libraries(nr_rlc PRIVATE asn1_lte_rrc asn1_nr_rrc)
if(ENABLE_TESTS)
add_subdirectory(tests)
endif()
foreach(TESTNUM RANGE 1 17)
add_executable(nr_rlc_test_${TESTNUM} test.c)
target_link_libraries(nr_rlc_test_${TESTNUM} PRIVATE nr_rlc_core pthread UTIL ${T_LIB})
target_compile_definitions(nr_rlc_test_${TESTNUM} PRIVATE TEST="test${TESTNUM}.h")
#target_include_directories(nr_rlc_test_${TESTNUM} PRIVATE LOG)
#target_compile_options(nr_rlc_test_${TESTNUM} PRIVATE -g --coverage -Wall)
add_dependencies(tests nr_rlc_test_${TESTNUM})
endforeach()
add_test(NAME nr_rlc_tests
COMMAND exec_nr_rlc_test.sh ${CMAKE_CURRENT_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
#!/bin/bash
# this script is to be executed in the current folder. It takes one argument,
# which is the directory in which the executables are.
if [ $# -ne 1 ]; then
echo "usage: $0 <directory-of-execs>"
exit 1
fi
EXEC_DIR=$1
for i in {1..17}; do
diff \
<($EXEC_DIR/nr_rlc_test_$i | \grep ^TEST) \
<(gunzip -c test$i.txt.gz) \
|| exit 1
done
......@@ -12,7 +12,6 @@
#include "common/utils/LOG/log.h"
int oai_exit;
/*
* GNB_AM <rx_maxsize> <tx_maxsize> <t_poll_retransmit> <t_reassembly>
* <t_status_prohibit> <poll_pdu> <poll_byte> <max_retx_threshold>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment