xref: /aosp_15_r20/external/toolchain-utils/binary_search_tool/test/generate_cmd.py (revision 760c253c1ed00ce9abd48f8546f08516e57485fe)
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3# Copyright 2020 The ChromiumOS Authors
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7"""Generate a virtual cmd script for pass level bisection.
8
9This is a required argument for pass level bisecting. For unit test, we use
10this script to verify if cmd_script.sh is generated correctly.
11"""
12
13
14import os
15import sys
16
17
18def Main():
19    if not os.path.exists("./is_setup"):
20        return 1
21    file_name = "cmd_script.sh"
22    with open(file_name, "w", encoding="utf-8") as f:
23        f.write("Generated by generate_cmd.py")
24    return 0
25
26
27if __name__ == "__main__":
28    retval = Main()
29    sys.exit(retval)
30