File: gen-big-test-resource.py

package info (click to toggle)
gobject-introspection 1.74.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 68,092 kB
  • sloc: ansic: 524,161; xml: 32,098; python: 21,234; yacc: 1,707; perl: 1,411; sh: 1,044; lex: 499; cpp: 171; makefile: 77; lisp: 1
file content (26 lines) | stat: -rw-r--r-- 721 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Generate a large text file to test compile
# the resulting code that contains a large (>65536 bytes)
# resource entry.  Just have 12 iterations of the following:
#
# -100 of each of the lowercase letters
# -100 of each of the uppercase letters
# -100 of the numbers 0 to 9
#
# See issue #1580

import string
import sys

if len(sys.argv) != 2:
    raise SystemExit("Usage: %s <output-file>" % sys.argv[0])

with open(sys.argv[1], "w", newline="\n") as f:
    for count in range(12):
        for c in string.ascii_lowercase:
            f.write("%s\n" % (c * 100))

        for c in string.ascii_uppercase:
            f.write("%s\n" % (c * 100))

        for i in range(10):
            f.write("%s\n" % (str(i) * 100))