forked from JohnSundell/SwiftPlate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtestStructure.py
34 lines (30 loc) · 943 Bytes
/
testStructure.py
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
33
34
# -*- coding: utf-8 -*-
import sys
import os
from os.path import join, getsize
rootFiles = set(['LICENSE', 'Package.swift', 'README.md', sys.argv[1] + '.podspec'])
configFiles = set([sys.argv[1] + '.plist', sys.argv[1] + 'Tests.plist'])
sourceFiles = set([sys.argv[1]+ '.swift'])
testDirs = set([sys.argv[1] + 'Tests'])
for root, dirs, files in os.walk('.'):
if root == '.':
if sys.argv[1] + '.xcodeproj' not in dirs:
print("xcode project not found")
exit(1)
if not rootFiles.issubset(files):
print("root level files not found")
exit(1)
if root == './Configs':
if not configFiles.issubset(files):
print("Config files not found")
exit(1)
if root == './Sources':
if not sourceFiles.issubset(files):
print("Source files not found")
exit(1)
if root == './Tests':
if not testDirs.issubset(dirs):
print("Test Directories not found")
exit(1)
print("All tests run successfully ⭐⭐⭐⭐⭐")
exit(0)