<commit_before># sixtracklib/tests/sixtracklib/common/CMakeLists.txt

# -----------------------------------------------------------------------------
# ---- Generate testdata:

if( GTEST_FOUND )
    set( SIXTRACKL_COMMON_TESTS_DEPEND_ON_TRACKING_TESTDATA )

    set( UNIT_TEST_TARGETS )
    set( SIXTRACKL_TEST_LIBRARIES ${SIXTRACKL_TEST_LIBRARIES}
         ${SIXTRACKL_GTEST_LIBRARIES} )

    # --------------------------------------------------------------------------
    # test_tools_c99:

    add_executable( test_tools_common_c99 test_tools_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS} test_tools_common_c99 )
    add_test( C99_CommonToolTests test_tools_common_c99 )

    # --------------------------------------------------------------------------
    # test_managed_buffer_common_c99:

    add_executable( test_managed_buffer_common_c99 test_managed_buffer_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS} test_managed_buffer_common_c99 )
    add_test( C99_CommonManagedBufferTest test_managed_buffer_common_c99 )

    # --------------------------------------------------------------------------
    # test_buffer_common_c99:

    add_executable( test_buffer_common_c99 test_buffer_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS} test_buffer_common_c99 )
    add_test( C99_CommonBufferTest test_buffer_common_c99 )

    # --------------------------------------------------------------------------
    # test_buffer_common_cxx:

    add_executable( test_buffer_common_cxx test_buffer_cxx.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS} test_buffer_common_cxx )
    add_test( CXX_CommonBufferTest test_buffer_common_cxx )

    # --------------------------------------------------------------------------
    # test_gpu_kernel_tools_common_c99:

    add_executable( test_gpu_kernel_tools_common_c99
                    test_gpu_kernel_tools_c99.cpp )

    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}
         test_gpu_kernel_tools_common_c99 )

    add_test( C99_CommonGpuKernelTools
              test_gpu_kernel_tools_common_c99 )

    # --------------------------------------------------------------------------
    # test_mem_pool_common_c99:

    add_executable( test_mem_pool_common_c99      test_mem_pool_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}   test_mem_pool_common_c99 )
    add_test( C99_CommonMemPoolTests              test_mem_pool_common_c99 )

    # ==========================================================================
    # test_particles_common_c99:

    add_executable( test_particles_common_c99     test_particles_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}   test_particles_common_c99 )
    add_test( C99_CommonParticlesTests            test_particles_common_c99 )

    # --------------------------------------------------------------------------
    # test_particles_common_cxx:

    add_executable( test_particles_common_cxx     test_particles_cxx.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}   test_particles_common_cxx )
    add_test( CXX_CommonParticlesTests            test_particles_common_cxx )

    # ==========================================================================
    # test_particles_aperature_check_enabled_common_c99:

    add_executable( test_particles_aperature_check_enabled_common_c99
                    test_particles_aperature_c99.cpp )

    target_compile_options( test_particles_aperature_check_enabled_common_c99
        BEFORE PRIVATE -DSIXTRL_ENABLE_APERATURE_CHECK=1
                       -DSIXTRL_APERATURE_X_LIMIT=1.0
                       -DSIXTRL_APERATURE_Y_LIMIT=1.0 )

    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}
         test_particles_aperature_check_enabled_common_c99 )

    add_test( C99_CommonParticlesAperatureEnabledTests
              test_particles_aperature_check_enabled_common_c99 )

    # ------------------------------------------------------------------------
    # test_particles_aperature_check_disabled_common_c99:

    add_executable( test_particles_aperature_check_disabled_common_c99
                    test_particles_aperature_c99.cpp )

    target_compile_options( test_particles_aperature_check_disabled_common_c99
        BEFORE PRIVATE -DSIXTRL_ENABLE_APERATURE_CHECK=0 )

    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}
         test_particles_aperature_check_disabled_common_c99 )

    add_test( C99_CommonParticlesAperatureDisabledTests
              test_particles_aperature_check_disabled_common_c99 )


    # ==========================================================================
    # test_be_drift_common_c99:

    add_executable( test_be_drift_common_c99      test_be_drift_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}   test_be_drift_common_c99 )
    add_test( C99_CommonBeamElementDriftTests     test_be_drift_common_c99 )

    # --------------------------------------------------------------------------
    # test_be_multipole_common_c99:

    add_executable( test_be_multipole_common_c99  test_be_multipole_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}   test_be_multipole_common_c99 )
    add_test( C99_CommonBeamElementMultiPoleTests test_be_multipole_common_c99 )

    # --------------------------------------------------------------------------
    # test_be_xy_shift_common_c99:

    add_executable( test_be_xy_shift_common_c99   test_be_xy_shift_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}   test_be_xy_shift_common_c99 )
    add_test( C99_CommonBeamElementXYShiftTests   test_be_xy_shift_common_c99 )

    # --------------------------------------------------------------------------
    # test_be_srotation_common_c99:

    add_executable( test_be_srotation_common_c99  test_be_srotation_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}   test_be_srotation_common_c99 )
    add_test( C99_CommonBeamElementSRotationTests test_be_srotation_common_c99 )

    # --------------------------------------------------------------------------
    # test_be_cavity_common_c99:

    add_executable( test_be_cavity_common_c99     test_be_cavity_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}   test_be_cavity_common_c99 )
    add_test( C99_CommonBeamElementCavityTests    test_be_cavity_common_c99 )

    # --------------------------------------------------------------------------
    # test_track_job_cpu_c99:

    add_executable( test_track_job_cpu_c99 test_track_job_cpu_c99.cpp )

    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS} test_track_job_cpu_c99 )
    add_test( C99_TrackJobCpuTests   test_track_job_cpu_c99 )

    # --------------------------------------------------------------------------
    # test_elem_by_elem_config_c99:

    add_executable( test_elem_by_elem_config_c99<commit_msg>tests/common: enables the C++ unit-test for sixtrack::TrackJobCpu<commit_after># sixtracklib/tests/sixtracklib/common/CMakeLists.txt

# -----------------------------------------------------------------------------
# ---- Generate testdata:

if( GTEST_FOUND )
    set( SIXTRACKL_COMMON_TESTS_DEPEND_ON_TRACKING_TESTDATA )

    set( UNIT_TEST_TARGETS )
    set( SIXTRACKL_TEST_LIBRARIES ${SIXTRACKL_TEST_LIBRARIES}
         ${SIXTRACKL_GTEST_LIBRARIES} )

    # --------------------------------------------------------------------------
    # test_tools_c99:

    add_executable( test_tools_common_c99 test_tools_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS} test_tools_common_c99 )
    add_test( C99_CommonToolTests test_tools_common_c99 )

    # --------------------------------------------------------------------------
    # test_managed_buffer_common_c99:

    add_executable( test_managed_buffer_common_c99 test_managed_buffer_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS} test_managed_buffer_common_c99 )
    add_test( C99_CommonManagedBufferTest test_managed_buffer_common_c99 )

    # --------------------------------------------------------------------------
    # test_buffer_common_c99:

    add_executable( test_buffer_common_c99 test_buffer_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS} test_buffer_common_c99 )
    add_test( C99_CommonBufferTest test_buffer_common_c99 )

    # --------------------------------------------------------------------------
    # test_buffer_common_cxx:

    add_executable( test_buffer_common_cxx test_buffer_cxx.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS} test_buffer_common_cxx )
    add_test( CXX_CommonBufferTest test_buffer_common_cxx )

    # --------------------------------------------------------------------------
    # test_gpu_kernel_tools_common_c99:

    add_executable( test_gpu_kernel_tools_common_c99
                    test_gpu_kernel_tools_c99.cpp )

    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}
         test_gpu_kernel_tools_common_c99 )

    add_test( C99_CommonGpuKernelTools
              test_gpu_kernel_tools_common_c99 )

    # --------------------------------------------------------------------------
    # test_mem_pool_common_c99:

    add_executable( test_mem_pool_common_c99      test_mem_pool_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}   test_mem_pool_common_c99 )
    add_test( C99_CommonMemPoolTests              test_mem_pool_common_c99 )

    # ==========================================================================
    # test_particles_common_c99:

    add_executable( test_particles_common_c99     test_particles_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}   test_particles_common_c99 )
    add_test( C99_CommonParticlesTests            test_particles_common_c99 )

    # --------------------------------------------------------------------------
    # test_particles_common_cxx:

    add_executable( test_particles_common_cxx     test_particles_cxx.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}   test_particles_common_cxx )
    add_test( CXX_CommonParticlesTests            test_particles_common_cxx )

    # ==========================================================================
    # test_particles_aperature_check_enabled_common_c99:

    add_executable( test_particles_aperature_check_enabled_common_c99
                    test_particles_aperature_c99.cpp )

    target_compile_options( test_particles_aperature_check_enabled_common_c99
        BEFORE PRIVATE -DSIXTRL_ENABLE_APERATURE_CHECK=1
                       -DSIXTRL_APERATURE_X_LIMIT=1.0
                       -DSIXTRL_APERATURE_Y_LIMIT=1.0 )

    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}
         test_particles_aperature_check_enabled_common_c99 )

    add_test( C99_CommonParticlesAperatureEnabledTests
              test_particles_aperature_check_enabled_common_c99 )

    # ------------------------------------------------------------------------
    # test_particles_aperature_check_disabled_common_c99:

    add_executable( test_particles_aperature_check_disabled_common_c99
                    test_particles_aperature_c99.cpp )

    target_compile_options( test_particles_aperature_check_disabled_common_c99
        BEFORE PRIVATE -DSIXTRL_ENABLE_APERATURE_CHECK=0 )

    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}
         test_particles_aperature_check_disabled_common_c99 )

    add_test( C99_CommonParticlesAperatureDisabledTests
              test_particles_aperature_check_disabled_common_c99 )


    # ==========================================================================
    # test_be_drift_common_c99:

    add_executable( test_be_drift_common_c99      test_be_drift_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}   test_be_drift_common_c99 )
    add_test( C99_CommonBeamElementDriftTests     test_be_drift_common_c99 )

    # --------------------------------------------------------------------------
    # test_be_multipole_common_c99:

    add_executable( test_be_multipole_common_c99  test_be_multipole_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}   test_be_multipole_common_c99 )
    add_test( C99_CommonBeamElementMultiPoleTests test_be_multipole_common_c99 )

    # --------------------------------------------------------------------------
    # test_be_xy_shift_common_c99:

    add_executable( test_be_xy_shift_common_c99   test_be_xy_shift_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}   test_be_xy_shift_common_c99 )
    add_test( C99_CommonBeamElementXYShiftTests   test_be_xy_shift_common_c99 )

    # --------------------------------------------------------------------------
    # test_be_srotation_common_c99:

    add_executable( test_be_srotation_common_c99  test_be_srotation_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}   test_be_srotation_common_c99 )
    add_test( C99_CommonBeamElementSRotationTests test_be_srotation_common_c99 )

    # --------------------------------------------------------------------------
    # test_be_cavity_common_c99:

    add_executable( test_be_cavity_common_c99     test_be_cavity_c99.cpp )
    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS}   test_be_cavity_common_c99 )
    add_test( C99_CommonBeamElementCavityTests    test_be_cavity_common_c99 )

    # --------------------------------------------------------------------------
    # test_track_job_cpu_c99:

    add_executable( test_track_job_cpu_c99 test_track_job_cpu_c99.cpp )

    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS} test_track_job_cpu_c99 )
    add_test( C99_TrackJobCpuTests   test_track_job_cpu_c99 )

    # --------------------------------------------------------------------------
    # test_track_job_cpu_cxx:

    add_executable( test_track_job_cpu_cxx test_track_job_cpu_cxx.cpp )

    set( UNIT_TEST_TARGETS ${UNIT_TEST_TARGETS} test_track_job_cpu_cxx )
    add_test( CXX_TrackJobCpuTests   test_track_job_cpu_cxx )

    # --------------------------------------------------------------------------
    # test_elem_by_elem_config_c99:

    add_executable( test_elem_by_elem_config_c99
{'fraction_non_alphanumeric': 0.23551428777081984, 'fraction_numerical': 0.02620024472756064, 'mean_word_length': 2.150566893424036, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2875468', 'n_tokens_mistral': 4496, 'n_tokens_neox': 4189, 'n_words': 426}