From 99a0997589a067f01748c81a6c52d727b300810f Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Thu, 21 Nov 2024 14:24:21 +0100 Subject: [PATCH 1/5] always overwrite existing reference outputs --- tests/codec_be_on_mr_nonselection/test_param_file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/codec_be_on_mr_nonselection/test_param_file.py b/tests/codec_be_on_mr_nonselection/test_param_file.py index 13a49c3f32..f970fb55f9 100644 --- a/tests/codec_be_on_mr_nonselection/test_param_file.py +++ b/tests/codec_be_on_mr_nonselection/test_param_file.py @@ -552,7 +552,7 @@ def encode( ref_stats_file = None dut_stats_file = None - if update_ref in [1, 2] and not os.path.exists(ref_out_file): + if update_ref in [1, 2]: check_and_makedir(ref_out_dir) # call REF encoder @@ -714,7 +714,7 @@ def decode( dut_out_file = f"{dut_out_dir}/{output_file}" ref_out_file = f"{ref_out_dir}/{output_file}" - if update_ref == 1 or update_ref == 2 and not os.path.exists(ref_out_file): + if update_ref == 1 or update_ref == 2: check_and_makedir(ref_out_dir) add_option_list = dec_opts_list if tracefile_dec != "": -- GitLab From 9574dfdbf67854dcb8a1d3876594aa81884e04ef Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Thu, 21 Nov 2024 15:58:06 +0100 Subject: [PATCH 2/5] unify syntax in conditions --- tests/codec_be_on_mr_nonselection/test_param_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/codec_be_on_mr_nonselection/test_param_file.py b/tests/codec_be_on_mr_nonselection/test_param_file.py index f970fb55f9..8e51b7128c 100644 --- a/tests/codec_be_on_mr_nonselection/test_param_file.py +++ b/tests/codec_be_on_mr_nonselection/test_param_file.py @@ -714,7 +714,7 @@ def decode( dut_out_file = f"{dut_out_dir}/{output_file}" ref_out_file = f"{ref_out_dir}/{output_file}" - if update_ref == 1 or update_ref == 2: + if update_ref in [1, 2]: check_and_makedir(ref_out_dir) add_option_list = dec_opts_list if tracefile_dec != "": -- GitLab From 859ba8170cc17b9127221c3c2065f219e432e322 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Thu, 21 Nov 2024 16:04:59 +0100 Subject: [PATCH 3/5] Revert "unify syntax in conditions" This reverts commit 9574dfdbf67854dcb8a1d3876594aa81884e04ef. --- tests/codec_be_on_mr_nonselection/test_param_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/codec_be_on_mr_nonselection/test_param_file.py b/tests/codec_be_on_mr_nonselection/test_param_file.py index 8e51b7128c..f970fb55f9 100644 --- a/tests/codec_be_on_mr_nonselection/test_param_file.py +++ b/tests/codec_be_on_mr_nonselection/test_param_file.py @@ -714,7 +714,7 @@ def decode( dut_out_file = f"{dut_out_dir}/{output_file}" ref_out_file = f"{ref_out_dir}/{output_file}" - if update_ref in [1, 2]: + if update_ref == 1 or update_ref == 2: check_and_makedir(ref_out_dir) add_option_list = dec_opts_list if tracefile_dec != "": -- GitLab From 1ee9bab05e7d12c1110255fada253a4dd2c22684 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Thu, 21 Nov 2024 16:05:09 +0100 Subject: [PATCH 4/5] Revert "always overwrite existing reference outputs" This reverts commit 99a0997589a067f01748c81a6c52d727b300810f. --- tests/codec_be_on_mr_nonselection/test_param_file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/codec_be_on_mr_nonselection/test_param_file.py b/tests/codec_be_on_mr_nonselection/test_param_file.py index f970fb55f9..13a49c3f32 100644 --- a/tests/codec_be_on_mr_nonselection/test_param_file.py +++ b/tests/codec_be_on_mr_nonselection/test_param_file.py @@ -552,7 +552,7 @@ def encode( ref_stats_file = None dut_stats_file = None - if update_ref in [1, 2]: + if update_ref in [1, 2] and not os.path.exists(ref_out_file): check_and_makedir(ref_out_dir) # call REF encoder @@ -714,7 +714,7 @@ def decode( dut_out_file = f"{dut_out_dir}/{output_file}" ref_out_file = f"{ref_out_dir}/{output_file}" - if update_ref == 1 or update_ref == 2: + if update_ref == 1 or update_ref == 2 and not os.path.exists(ref_out_file): check_and_makedir(ref_out_dir) add_option_list = dec_opts_list if tracefile_dec != "": -- GitLab From b581c0d93b5e24f1fb0e16e5040f2e7b24d68049 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Thu, 21 Nov 2024 16:06:18 +0100 Subject: [PATCH 5/5] add correct fix that does not break update_ref = 2 --- tests/codec_be_on_mr_nonselection/test_param_file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/codec_be_on_mr_nonselection/test_param_file.py b/tests/codec_be_on_mr_nonselection/test_param_file.py index 13a49c3f32..998e5e0a08 100644 --- a/tests/codec_be_on_mr_nonselection/test_param_file.py +++ b/tests/codec_be_on_mr_nonselection/test_param_file.py @@ -552,7 +552,7 @@ def encode( ref_stats_file = None dut_stats_file = None - if update_ref in [1, 2] and not os.path.exists(ref_out_file): + if update_ref == 1 or (update_ref == 2 and not os.path.exists(ref_out_file)): check_and_makedir(ref_out_dir) # call REF encoder @@ -714,7 +714,7 @@ def decode( dut_out_file = f"{dut_out_dir}/{output_file}" ref_out_file = f"{ref_out_dir}/{output_file}" - if update_ref == 1 or update_ref == 2 and not os.path.exists(ref_out_file): + if update_ref == 1 or (update_ref == 2 and not os.path.exists(ref_out_file)): check_and_makedir(ref_out_dir) add_option_list = dec_opts_list if tracefile_dec != "": -- GitLab