Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k4run: fix more bugs #140

Merged
merged 3 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions k4FWCore/scripts/k4run
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ seen_files = set()
option_db = {}

def load_file(file):
exec(file.read())
exec(file.read(), {})


def add_arguments(parser, app_mgr):
# length increases when properties of an algorithm with tools are inspected
# see https://github.com/key4hep/k4FWCore/pull/138
for conf in tuple(app_mgr.allConfigurables.values()):
# can contain the same value multiple times
# see https://github.com/key4hep/k4FWCore/issues/141
for conf in frozenset(app_mgr.allConfigurables.values()):
# skip public tools and the applicationmgr itself
if "ToolSvc" in conf.name() or "ApplicationMgr" in conf.name():
continue
Expand Down
5 changes: 5 additions & 0 deletions test/k4FWCoreTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,8 @@ add_test(NAME Testk4runHelpOnly
set_test_env(Testk4runHelpOnly)
set_tests_properties(Testk4runHelpOnly
PROPERTIES PASS_REGULAR_EXPRESSION "show this help message and exit")

add_test(NAME TestExec
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
COMMAND ${K4RUN} --dry-run options/TestExec.py)
set_test_env(TestExec)
20 changes: 20 additions & 0 deletions test/k4FWCoreTest/options/TestExec.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Copyright (c) 2014-2023 Key4hep-Project.
#
# This file is part of Key4hep.
# See https://key4hep.github.io/key4hep-doc/ for further info.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
a = 5
comp = [a for i in range(3)]
Loading