From 3f68173c61140b3128819079247c20d9e79863b4 Mon Sep 17 00:00:00 2001 From: silverweed Date: Tue, 15 Oct 2024 13:39:59 +0200 Subject: [PATCH] fix test expectation for hadd_args_jfa --- root/io/hadd/CMakeLists.txt | 98 ++++++++++++++++----------- root/io/hadd/hadd_args_cachesize.ref | 2 +- root/io/hadd/hadd_args_ff_dbg_j_2.ref | 4 +- root/io/hadd/hadd_args_jfa.ref | 7 -- root/io/hadd/hadd_args_minusminus.ref | 2 +- root/io/hadd/hadd_args_n0.ref | 2 +- root/io/hadd/hadd_args_n_1.ref | 2 +- 7 files changed, 63 insertions(+), 54 deletions(-) delete mode 100644 root/io/hadd/hadd_args_jfa.ref diff --git a/root/io/hadd/CMakeLists.txt b/root/io/hadd/CMakeLists.txt index 81de11376c..006ff7ed33 100644 --- a/root/io/hadd/CMakeLists.txt +++ b/root/io/hadd/CMakeLists.txt @@ -26,88 +26,104 @@ ROOTTEST_ADD_TEST(test_MergeNestedSameName OUTREF hadd_check_nested_same_name.ref ) -ROOTTEST_ADD_TEST(test_TreeChangeComp - COPY_TO_BUILDDIR hadd_gen_input_tree.C hadd_check_comp_tree.C - PRECMD ${ROOT_root_CMD} -q -b -l "hadd_gen_input_tree.C(\"test_comp_tree_in.root\")" - COMMAND ${ROOT_hadd_CMD} -f401 test_comp_tree_out.root test_comp_tree_in.root - POSTCMD ${ROOT_root_CMD} -q -b -l "hadd_check_comp_tree.C(\"test_comp_tree_out.root\", \"test_comp_tree_in.root\", 401)" +# ------------------------------------ +# arg parsing tests +# ------------------------------------ + +ROOTTEST_ADD_TEST(test_hadd_args_gen_input + COPY_TO_BUILDDIR hadd_gen_input_tree.C + PRECMD ${CMAKE_COMMAND} -E rm -f hadd_args_in.root + COMMAND ${ROOT_root_CMD} -q -b -l "hadd_gen_input_tree.C(\"hadd_args_in.root\")" ) ROOTTEST_ADD_TEST(test_hadd_args_n0 - PRECMD ${ROOT_root_CMD} -q -b -l "hadd_gen_input_tree.C(\"hadd_args_n0.root\")" - COMMAND ${ROOT_hadd_CMD} -n0 hadd_args_n0_out.root hadd_args_n0.root - POSTCMD rm -f hadd_args_n0*.root + DEPENDS test_hadd_args_gen_input + COMMAND ${ROOT_hadd_CMD} -n0 hadd_args_n0_out.root hadd_args_in.root + POSTCMD ${CMAKE_COMMAND} -E rm -f hadd_args_n0_out.root OUTREF hadd_args_n0.ref ) ROOTTEST_ADD_TEST(test_hadd_args_na - PRECMD ${ROOT_root_CMD} -q -b -l "hadd_gen_input_tree.C(\"hadd_args_na.root\")" - COMMAND ${ROOT_hadd_CMD} -na hadd_args_na_out.root hadd_args_na.root - POSTCMD rm -f hadd_args_na*.root + DEPENDS test_hadd_args_gen_input + COMMAND ${ROOT_hadd_CMD} -na hadd_args_na_out.root hadd_args_in.root + POSTCMD ${CMAKE_COMMAND} -E rm -f hadd_args_na_out.root PASSREGEX "Error in : the argument after '-n' flag was not of the expected type." ) ROOTTEST_ADD_TEST(test_hadd_args_n_1 - PRECMD ${ROOT_root_CMD} -q -b -l "hadd_gen_input_tree.C(\"hadd_args_n_1.root\")" - COMMAND ${ROOT_hadd_CMD} -n=1 hadd_args_n_1_out.root hadd_args_n_1.root - POSTCMD rm -f hadd_args_n_1*.root + DEPENDS test_hadd_args_gen_input + COMMAND ${ROOT_hadd_CMD} -n=1 hadd_args_n_1_out.root hadd_args_in.root + POSTCMD ${CMAKE_COMMAND} -E rm -f hadd_args_n_1_out.root OUTREF hadd_args_n_1.ref ) ROOTTEST_ADD_TEST(test_hadd_args_jfa - PRECMD ${ROOT_root_CMD} -q -b -l "hadd_gen_input_tree.C(\"hadd_args_jfa.root\")" - COMMAND ${ROOT_hadd_CMD} -jfa hadd_args_jfa_out.root hadd_args_jfa.root - POSTCMD rm -f hadd_args_jfa*.root - OUTREF hadd_args_jfa.ref + DEPENDS test_hadd_args_gen_input + COMMAND ${ROOT_hadd_CMD} -jfa hadd_args_jfa_out.root hadd_args_in.root + POSTCMD ${CMAKE_COMMAND} -E rm -f hadd_args_jfa_out.root + PASSREGEX "Error in : the argument after '-j' flag was not of the expected type" +) + +ROOTTEST_ADD_TEST(test_hadd_args_j_10a + DEPENDS test_hadd_args_gen_input + COMMAND ${ROOT_hadd_CMD} -j 10a hadd_args_j_10a_out.root hadd_args_in.root + POSTCMD ${CMAKE_COMMAND} -E rm -f hadd_args_j_10a_out.root + PASSREGEX "Error in : error parsing integer argument '10a'" +) + +ROOTTEST_ADD_TEST(test_hadd_args_j + DEPENDS test_hadd_args_gen_input + COMMAND ${ROOT_hadd_CMD} -j hadd_args_j_out.root hadd_args_in.root + POSTCMD ${CMAKE_COMMAND} -E rm -f hadd_args_j_out.root + PASSRC 0 ) ROOTTEST_ADD_TEST(test_hadd_args_ff_dbg_j_2 - PRECMD ${ROOT_root_CMD} -q -b -l "hadd_gen_input_tree.C(\"hadd_args_ff_dbg_j_2.root\")" - COMMAND ${ROOT_hadd_CMD} -ff hadd_args_ff_dbg_j_2_out.root hadd_args_ff_dbg_j_2.root hadd_args_ff_dbg_j_2.root -dbg -j 2 - POSTCMD rm -f hadd_args_ff_dbg_j_2*.root + DEPENDS test_hadd_args_gen_input + COMMAND ${ROOT_hadd_CMD} -ff hadd_args_ff_dbg_j_2_out.root hadd_args_in.root hadd_args_in.root -dbg -j 2 + POSTCMD ${CMAKE_COMMAND} -E rm -f hadd_args_ff_dbg_j_2_out.root OUTREF hadd_args_ff_dbg_j_2.ref ) ROOTTEST_ADD_TEST(test_hadd_args_minusminus - PRECMD ${ROOT_root_CMD} -q -b -l "hadd_gen_input_tree.C(\"--hadd_args.root\")" - COMMAND ${ROOT_hadd_CMD} -f0 -- --hadd_args_out.root --hadd_args.root - POSTCMD rm -f -- --hadd_args*.root + DEPENDS test_hadd_args_gen_input + COMMAND ${ROOT_hadd_CMD} -f0 -- --hadd_args_out.root hadd_args_in.root + POSTCMD ${CMAKE_COMMAND} -E rm -f -- --hadd_args_out.root OUTREF hadd_args_minusminus.ref ) ROOTTEST_ADD_TEST(test_hadd_args_minusminus2 - PRECMD ${ROOT_root_CMD} -q -b -l "hadd_gen_input_tree.C(\"--hadd_args2.root\")" - COMMAND ${ROOT_hadd_CMD} -f --hadd_args2_out.root -- --hadd_args2.root - POSTCMD rm -f -- --hadd_args2*.root + DEPENDS test_hadd_args_gen_input + COMMAND ${ROOT_hadd_CMD} -f --hadd_args2_out.root -- hadd_args_in.root + POSTCMD ${CMAKE_COMMAND} -E rm -f -- --hadd_args2_out.root PASSREGEX "Warning in : unknown flag: --hadd_args2_out.root" PASSRC 1 ) ROOTTEST_ADD_TEST(test_hadd_args_multiple_pos - PRECMD ${ROOT_root_CMD} -q -b -l "hadd_gen_input_tree.C(\"hadd_args_multiple_pos.root\")" - COMMAND ${ROOT_hadd_CMD} -ff hadd_args_multiple_pos_out.root -k hadd_args_multiple_pos.root - POSTCMD rm -f hadd_args_multiple_pos*.root - PASSREGEX "Error in : seen a positional argument 'hadd_args_multiple_pos.root' after some flags." + DEPENDS test_hadd_args_gen_input + COMMAND ${ROOT_hadd_CMD} -ff hadd_args_multiple_pos_out.root -k hadd_args_in.root + POSTCMD ${CMAKE_COMMAND} -E rm -f hadd_args_multiple_pos_out.root + PASSREGEX "Error in : seen a positional argument 'hadd_args_in.root' after some flags." ) ROOTTEST_ADD_TEST(test_hadd_args_cachesize - PRECMD ${ROOT_root_CMD} -q -b -l "hadd_gen_input_tree.C(\"hadd_args_cachesize.root\")" - COMMAND ${ROOT_hadd_CMD} hadd_args_cachesize_out.root hadd_args_cachesize.root -cachesize 100M -f - POSTCMD rm -f hadd_args_cachesize*.root + DEPENDS test_hadd_args_gen_input + COMMAND ${ROOT_hadd_CMD} hadd_args_cachesize_out.root hadd_args_in.root -cachesize 100M -f + POSTCMD ${CMAKE_COMMAND} -E rm -f hadd_args_cachesize_out.root OUTREF hadd_args_cachesize.ref ) ROOTTEST_ADD_TEST(test_hadd_args_missing_arg - PRECMD ${ROOT_root_CMD} -q -b -l "hadd_gen_input_tree.C(\"hadd_args_missing_arg.root\")" - COMMAND ${ROOT_hadd_CMD} -n hadd_args_missing_arg_out.root hadd_args_missing_arg.root - POSTCMD rm -f hadd_args_missing_arg*.root + DEPENDS test_hadd_args_gen_input + COMMAND ${ROOT_hadd_CMD} -n hadd_args_missing_arg_out.root hadd_args_in.root + POSTCMD ${CMAKE_COMMAND} -E rm -f hadd_args_missing_arg_out.root PASSREGEX "Error in : the argument after '-n' flag was not of the expected type" ) ROOTTEST_ADD_TEST(test_hadd_args_missing_arg2 - PRECMD ${ROOT_root_CMD} -q -b -l "hadd_gen_input_tree.C(\"hadd_args_missing_arg2.root\")" - COMMAND ${ROOT_hadd_CMD} hadd_args_missing_arg2_out.root hadd_args_missing_arg2.root -n - POSTCMD rm -f hadd_args_missing_arg2*.root + DEPENDS test_hadd_args_gen_input + COMMAND ${ROOT_hadd_CMD} hadd_args_missing_arg2_out.root hadd_args_in.root -n + POSTCMD ${CMAKE_COMMAND} -E rm -f hadd_args_missing_arg2_out.root PASSREGEX "Error in : expected argument after '-n' flag." ) - diff --git a/root/io/hadd/hadd_args_cachesize.ref b/root/io/hadd/hadd_args_cachesize.ref index 581fb7dedd..d1a61fa84b 100644 --- a/root/io/hadd/hadd_args_cachesize.ref +++ b/root/io/hadd/hadd_args_cachesize.ref @@ -1,5 +1,5 @@ Info in : target file: hadd_args_cachesize_out.root Info in : Using cachesize=100M Info in : compression setting for all output: 101 -hadd Source file 1: hadd_args_cachesize.root +hadd Source file 1: hadd_args_in.root hadd Target path: hadd_args_cachesize_out.root:/ diff --git a/root/io/hadd/hadd_args_ff_dbg_j_2.ref b/root/io/hadd/hadd_args_ff_dbg_j_2.ref index 47cd32a616..0fbb0235df 100644 --- a/root/io/hadd/hadd_args_ff_dbg_j_2.ref +++ b/root/io/hadd/hadd_args_ff_dbg_j_2.ref @@ -2,6 +2,6 @@ Info in : parallelizing with 2 processes. Info in : target file: hadd_args_ff_dbg_j_2_out.root Info in : compression setting for all output: 101 Info in : each process should handle at least 3 files for efficiency. Setting the number of processes to: 1 -hadd Source file 1: hadd_args_ff_dbg_j_2.root -hadd Source file 2: hadd_args_ff_dbg_j_2.root +hadd Source file 1: hadd_args_in.root +hadd Source file 2: hadd_args_in.root hadd Target path: hadd_args_ff_dbg_j_2_out.root:/ diff --git a/root/io/hadd/hadd_args_jfa.ref b/root/io/hadd/hadd_args_jfa.ref deleted file mode 100644 index 294f8d374b..0000000000 --- a/root/io/hadd/hadd_args_jfa.ref +++ /dev/null @@ -1,7 +0,0 @@ -Warning in : the number of parallel processes passed after -j is invalid: fa. We will use the system maximum. -Info in : parallelizing with 32 processes. -Info in : target file: hadd_args_jfa_out.root -Info in : compression setting for all output: 101 -Info in : each process should handle at least 3 files for efficiency. Setting the number of processes to: 1 -hadd Source file 1: hadd_args_jfa.root -hadd Target path: hadd_args_jfa_out.root:/ diff --git a/root/io/hadd/hadd_args_minusminus.ref b/root/io/hadd/hadd_args_minusminus.ref index a27a8f3f15..27aafc6f07 100644 --- a/root/io/hadd/hadd_args_minusminus.ref +++ b/root/io/hadd/hadd_args_minusminus.ref @@ -1,6 +1,6 @@ Info in : target file: --hadd_args_out.root Info in : compression setting for all output: 0 -hadd Source file 1: --hadd_args.root +hadd Source file 1: hadd_args_in.root Warning in : Sources and Target have different compression settings hadd merging will be slower hadd Target path: --hadd_args_out.root:/ diff --git a/root/io/hadd/hadd_args_n0.ref b/root/io/hadd/hadd_args_n0.ref index 0ab8ea13bd..2a8b9a49ef 100644 --- a/root/io/hadd/hadd_args_n0.ref +++ b/root/io/hadd/hadd_args_n0.ref @@ -1,4 +1,4 @@ Info in : target file: hadd_args_n0_out.root Info in : compression setting for all output: 101 -hadd Source file 1: hadd_args_n0.root +hadd Source file 1: hadd_args_in.root hadd Target path: hadd_args_n0_out.root:/ diff --git a/root/io/hadd/hadd_args_n_1.ref b/root/io/hadd/hadd_args_n_1.ref index bf25d207c1..c961e776bd 100644 --- a/root/io/hadd/hadd_args_n_1.ref +++ b/root/io/hadd/hadd_args_n_1.ref @@ -1,4 +1,4 @@ Info in : target file: hadd_args_n_1_out.root Info in : compression setting for all output: 101 -hadd Source file 1: hadd_args_n_1.root +hadd Source file 1: hadd_args_in.root hadd Target path: hadd_args_n_1_out.root:/