diff --git a/test/k4FWCoreTest/CMakeLists.txt b/test/k4FWCoreTest/CMakeLists.txt index cfa1db73..5ea6d555 100644 --- a/test/k4FWCoreTest/CMakeLists.txt +++ b/test/k4FWCoreTest/CMakeLists.txt @@ -171,14 +171,14 @@ add_test_with_env(FunctionalMetadataReadOldAlgorithm options/ExampleFunctionalMe add_test_with_env(FunctionalNonExistingFile options/ExampleFunctionalNonExistingFile.py) set_tests_properties(FunctionalNonExistingFile PROPERTIES PASS_REGULAR_EXPRESSION "File.*couldn't be found") add_test_with_env(FunctionalNonExistingFileOverwritten options/ExampleFunctionalNonExistingFile.py --IOSvc.Input functional_producer.root) +add_test_with_env(FunctionalFileTooLong options/ExampleFunctionalFile.py -n 999 --IOSvc.Output toolong.root PROPERTIES PASS_REGULAR_EXPRESSION + "Application Manager Terminated successfully with a user requested ScheduledStop") +add_test_with_env(FunctionalFileTooShort options/ExampleFunctionalFile.py -n 2 --IOSvc.Output two_events.root ADD_TO_CHECK_FILES) add_test_with_env(FunctionalWrongImport options/ExampleFunctionalWrongImport.py) set_tests_properties(FunctionalWrongImport PROPERTIES PASS_REGULAR_EXPRESSION "ImportError: Importing ApplicationMgr or IOSvc from Configurables is not allowed.") add_test_with_env(FunctionalReadNthEvent options/ExampleFunctionalReadNthEvent.py ADD_TO_CHECK_FILES) -# Do this after checking the files not to overwrite them -add_test_with_env(FunctionalFile_toolong options/ExampleFunctionalFile.py -n 999 PROPERTIES DEPENDS FunctionalCheckFiles PASS_REGULAR_EXPRESSION - "Application Manager Terminated successfully with a user requested ScheduledStop") # The following is done to make the tests work without installing the files in # the installation directory. The k4FWCore in the build directory is populated by diff --git a/test/k4FWCoreTest/scripts/CheckOutputFiles.py b/test/k4FWCoreTest/scripts/CheckOutputFiles.py index 227ac3f0..14b23e85 100644 --- a/test/k4FWCoreTest/scripts/CheckOutputFiles.py +++ b/test/k4FWCoreTest/scripts/CheckOutputFiles.py @@ -165,11 +165,6 @@ def check_metadata(filename, expected_metadata): if len(ev.get("NewMCParticles")) != 4: raise RuntimeError(f"Expected 4 NewMCParticles but got {len(ev.get('NewMCParticles'))}") -check_events( - "functional_filter.root", - 5, -) - check_collections("functional_metadata.root", ["MCParticles"]) check_metadata( @@ -229,7 +224,9 @@ def check_metadata(filename, expected_metadata): raise RuntimeError(f"Event number {event_number} is duplicated") seen_event_numbers.add(event_number) -check_events( - "functional_nth_event.root", - 3, -) +for name, events in { + "functional_filter.root": 5, + "functional_nth_event.root": 3, + "two_events.root": 2, +}.items(): + check_events(name, events)