source: mainline/tools/gentestfile.py@ 4dd3912

Last change on this file since 4dd3912 was 4dd3912, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 3 years ago

Update python scripts

  • Property mode set to 100755
File size: 429 bytes
Line 
1#!/usr/bin/env python
2#
3# SPDX-FileCopyrightText: 2011 Martin Sucha
4#
5# SPDX-License-Identifier: BSD-3-Clause
6#
7
8"""
9Generate a file to be used by app/testread
10"""
11
12import struct
13import sys
14
15if len(sys.argv) < 2:
16 print("Usage: gentestfile.py <count of 64-bit numbers to output>")
17 exit()
18
19m = int(sys.argv[1])
20i = 0
21pow_2_64 = 2 ** 64
22st = struct.Struct('<Q')
23while i < m:
24 sys.stdout.write(st.pack(i))
25 i = (i + 1) % pow_2_64
26
Note: See TracBrowser for help on using the repository browser.