@@ -213,6 +213,8 @@ target_link_libraries(evp_hash PRIVATE perf)
213213
214214## Running tests
215215# Options
216+ option (enable_run_target "Enable generation of run* targets" )
217+
216218set (run_tests evp_fetch
217219 evp_hash
218220 evp_setpeer
@@ -446,61 +448,63 @@ function(gen_run_taget _CMD _TEST)
446448endfunction ()
447449
448450# run targets generation
449- foreach (test IN LISTS run_tests)
450- set (cmds "${test} " )
451+ if (enable_run_target)
452+ foreach (test IN LISTS run_tests)
453+ set (cmds "${test} " )
454+
455+ # test-specific options
456+ foreach (opt_name IN LISTS run_opts)
457+ set (opt "${${opt_name} }" )
458+ list (GET opt 0 test_name)
459+ list (GET opt 1 test_opt)
460+ list (REMOVE_AT opt 0 1)
461+
462+ if (test IN_LIST test_name)
463+ set (new_cmds)
464+ foreach (cmd IN LISTS cmds)
465+ foreach (val IN LISTS opt)
466+ list (APPEND new_cmds "${cmd} ${test_opt} ${val} " )
467+ endforeach ()
468+ endforeach ()
469+ set (cmds ${new_cmds} )
470+ endif ()
471+ endforeach ()
451472
452- # test-specific options
453- foreach (opt_name IN LISTS run_opts)
454- set (opt "${${opt_name} }" )
455- list (GET opt 0 test_name)
456- list (GET opt 1 test_opt)
457- list (REMOVE_AT opt 0 1)
473+ # terse
474+ set (new_cmds)
475+ foreach (cmd IN LISTS cmds)
476+ foreach (val IN LISTS run_terse)
477+ list (APPEND new_cmds "${cmd} ${val} " )
478+ endforeach ()
479+ endforeach ()
480+ set (cmds ${new_cmds} )
458481
459- if (test IN_LIST test_name)
482+ # certdir
483+ if (test IN_LIST run_certdir_tests)
460484 set (new_cmds)
461485 foreach (cmd IN LISTS cmds)
462- foreach (val IN LISTS opt)
463- list (APPEND new_cmds "${cmd} ${test_opt} ${val} " )
464- endforeach ()
486+ list (APPEND new_cmds "${cmd} ${run_certdir} " )
465487 endforeach ()
466488 set (cmds ${new_cmds} )
467489 endif ()
468- endforeach ()
469490
470- # terse
471- set (new_cmds)
472- foreach (cmd IN LISTS cmds)
473- foreach (val IN LISTS run_terse)
474- list (APPEND new_cmds "${cmd} ${val} " )
475- endforeach ()
476- endforeach ()
477- set (cmds ${new_cmds} )
478-
479- # certdir
480- if (test IN_LIST run_certdir_tests)
491+ # threads
481492 set (new_cmds)
482493 foreach (cmd IN LISTS cmds)
483- list (APPEND new_cmds "${cmd} ${run_certdir} " )
494+ foreach (val IN LISTS run_threads)
495+ list (APPEND new_cmds "${cmd} ${val} " )
496+ endforeach ()
484497 endforeach ()
485498 set (cmds ${new_cmds} )
486- endif ()
487499
488- # threads
489- set (new_cmds)
490- foreach (cmd IN LISTS cmds)
491- foreach (val IN LISTS run_threads)
492- list (APPEND new_cmds "${cmd} ${val} " )
500+ # Run targets
501+ foreach (cmd IN LISTS cmds)
502+ gen_run_taget("${cmd} " "${test} " VAR run_target_name)
503+ add_dependencies (run "${run_target_name} " )
493504 endforeach ()
494- endforeach ()
495- set (cmds ${new_cmds} )
496505
497- # Run targets
498- foreach (cmd IN LISTS cmds)
499- gen_run_taget("${cmd} " "${test} " VAR run_target_name)
500- add_dependencies (run "${run_target_name} " )
506+ # Per-test version target
507+ gen_run_taget("${test} -V" "${test} " NAME "run-version-${test} " )
508+ add_dependencies (run-version "run-version-${test} " )
501509 endforeach ()
502-
503- # Per-test version target
504- gen_run_taget("${test} -V" "${test} " NAME "run-version-${test} " )
505- add_dependencies (run-version "run-version-${test} " )
506- endforeach ()
510+ endif ()
0 commit comments