#!/usr/bin/env python1# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2# Copyright (C) 2025-2025 German Aerospace Center (DLR) and others.3# This program and the accompanying materials are made available under the4# terms of the Eclipse Public License 2.0 which is available at5# https://www.eclipse.org/legal/epl-2.0/6# This Source Code may also be made available under the following Secondary7# Licenses when the conditions for such availability set forth in the Eclipse8# Public License 2.0 are satisfied: GNU General Public License, version 29# or later which is available at10# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later1213# @file buildTextTest.py14# @author Pablo Alvarez Lopez15# @date 2025-12-051617import os181920def update_testsuite_files():21# Target filenames to look for22target_files = [23"testsuite.netedit.external",24"testsuite.netedit.internal",25"testsuite.neteditoutput"26]2728# Get the directory where the script is located29base_dir = os.path.dirname(os.path.abspath(__file__))3031print(f"Starting scan in: {base_dir}")3233# Walk through the directory tree34for root, dirs, files in os.walk(base_dir):35# Check if any of the target files exist in the current directory36for filename in target_files:37if filename in files:38file_path = os.path.join(root, filename)3940# Get list of subdirectories in the current folder (root)41subfolders = [42d for d in os.listdir(root)43if os.path.isdir(os.path.join(root, d)) and not d.startswith('.')44]45subfolders.sort()4647print(f"Updating {filename} in {root}")4849try:50with open(file_path, 'w') as f:51for folder in subfolders:52# Added extra newline \n for the empty line between entries53f.write(f"{folder}\n\n")54except IOError as e:55print(f"Error writing to {file_path}: {e}")565758if __name__ == "__main__":59update_testsuite_files()606162