#!/usr/bin/env python3

import os
import random
SQUAD_RESULT = os.getenv('SQUAD_RESULT')

def rand_pass_fail():
  if SQUAD_RESULT:
    return SQUAD_RESULT
  rnd = random.random()
  if rnd <= 0.2:
    return 'fail'
  elif rnd <= 0.3:
    return 'skip'
  else:
    return 'pass'

SUITE = os.getenv('SUITE', 'testsuite%(suite)s')
SUITES = int(os.getenv('SUITES', '5'))
TESTS = int(os.getenv('TESTS', '2'))

print('{')
sep=''
for suite in range(1, SUITES+1):
  for test in range(1, TESTS+1):
    test_name = (SUITE + "/test%(test)s") % {
      'suite': suite,
      'test': test,
    }
    print(sep)
    print('  "%s": "%s"' % (test_name, rand_pass_fail()), end='')
    sep = ','
print('\n}')
