diff --git a/k4FWCore/scripts/k4run b/k4FWCore/scripts/k4run index 9427ef86..6c480288 100755 --- a/k4FWCore/scripts/k4run +++ b/k4FWCore/scripts/k4run @@ -23,7 +23,7 @@ seen_files = set() option_db = {} def load_file(file): - exec(file.read()) + exec(file.read(), {}) def add_arguments(parser, app_mgr): diff --git a/test/k4FWCoreTest/CMakeLists.txt b/test/k4FWCoreTest/CMakeLists.txt index 707acc07..fafa3201 100644 --- a/test/k4FWCoreTest/CMakeLists.txt +++ b/test/k4FWCoreTest/CMakeLists.txt @@ -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) \ No newline at end of file diff --git a/test/k4FWCoreTest/options/TestExec.py b/test/k4FWCoreTest/options/TestExec.py new file mode 100644 index 00000000..448bb3bb --- /dev/null +++ b/test/k4FWCoreTest/options/TestExec.py @@ -0,0 +1,2 @@ +a = 5 +comp = [a for i in range(3)] \ No newline at end of file