Path: blob/main/tests/complex/netconvert/left_turn_noblocking_longveh/runner.py
169686 views
#!/usr/bin/env python1# -*- coding: utf-8 -*-2# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo3# Copyright (C) 2008-2025 German Aerospace Center (DLR) and others.4# This program and the accompanying materials are made available under the5# terms of the Eclipse Public License 2.0 which is available at6# https://www.eclipse.org/legal/epl-2.0/7# This Source Code may also be made available under the following Secondary8# Licenses when the conditions for such availability set forth in the Eclipse9# Public License 2.0 are satisfied: GNU General Public License, version 210# or later which is available at11# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html12# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later1314# @file runner.py15# @author Jakob Erdmann16# @author Michael Behrisch17# @date 2011-05-231819from __future__ import absolute_import20from __future__ import print_function2122import sys23import os24import subprocess25sys.path.append(26os.path.join(os.path.dirname(sys.argv[0]), '..', '..', '..', '..', "tools"))27from sumolib import checkBinary # noqa2829net_output = 'joined.net.xml'30trips_output = 'trips.log'3132args_netc = [checkBinary('netconvert'),33'--node-files', 'input_nodes.nod.xml',34'--edge-files', 'input_edges.edg.xml',35'--output', net_output,36'--offset.disable-normalization']3738args_sumo = [checkBinary('sumo'),39'--net-file', net_output,40'--route-files', 'input_routes.rou.xml',41'--end', '50',42'--no-step-log',43'--no-duration-log',44'--tripinfo-output', trips_output]4546subprocess.call(args_netc)47subprocess.call(args_sumo)4849# vehicles should have completed their trips50complete = False51with open(trips_output) as to:52for line in to:53if 'veh0' in line:54complete = True5556if complete:57print('test passed. no blocking occured')58else:59print('test failed. vehicles were blocked')606162