Belle II Software development
ExecuteStreamerTest.py
1#!/usr/bin/env python3
2
3
10
11import os
12import tempfile
13from ROOT import Belle2
14
15testScript = Belle2.FileSystem.findFile('pxd/tests/streamer_test.py_noexec')
16
17# create and move to temporary directory
18with tempfile.TemporaryDirectory() as tempdir:
19 print("Moving to temporary directory " + str(tempdir))
20 os.chdir(tempdir)
21
22 # might not be the most elegant way but cannot directly redirect ROOT Error
23 os.system("basf2 " + testScript + " > output.log 2>&1")
24 # and check if an Error related to TStreamer was thrown
25 assert(0 == open('output.log').read().count('Error in <TStreamerInfo::Build>'))
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...
Definition: FileSystem.cc:151