aboutsummaryrefslogtreecommitdiff
path: root/gen.py
blob: ee4aea4eb572d240077467c585ae3ab26b9f88af (plain) (blame)
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
27
28
29
30
31
32
#!/usr/bin/env python3

import os

featureDirs = os.listdir('./src')


count = len(featureDirs)

for fDir in featureDirs:
    if os.path.isdir('./test/' + fDir):
        print('already exists: ', fDir)
        continue

    os.mkdir('./test/' + fDir)
    f = open(f'./test/{fDir}/test.sh', 'w')

    contents = f"""
    #!/bin/bash

    set -e

    # Optional: Import test library
    source dev-container-features-test-lib

    # Definition specific tests
    check "version" {fDir}  --version

    # Report result
    reportResults"""

    f.write(contents)