forked from exyte/SVGView
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript-test-cases.sh
More file actions
executable file
·34 lines (27 loc) · 879 Bytes
/
script-test-cases.sh
File metadata and controls
executable file
·34 lines (27 loc) · 879 Bytes
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
#!/bin/sh
cd "SVGViewTests"
function generateTest() {
RES="// Generated by script-test-cases.sh\n\n"
RES+="import XCTest\n"
RES+="@testable import SVGView\n\n"
RES+="class $2: BaseTestCase {\n\n"
RES+=" override var dir: String {\n"
RES+=" return \"$1\"\n"
RES+=" }\n\n"
REFS=$(find "w3c/$1/refs/" -type f -regex '.*\.ref$' | sort)
for F in $REFS; do
NAME="$(basename ${F%.*})"
ARR=(${NAME//-/ })
TEST_NAME=""
for A in "${ARR[@]}"; do
TEST_NAME+=$(printf "%s" "${A:0:1}" | tr '[:lower:]' '[:upper:]')${A:1}
done
RES+=" func test$TEST_NAME() {\n"
RES+=" compareToReference(\"$NAME\")\n"
RES+=" }\n\n"
done
RES+="}"
echo "$RES" > ../SVGViewTests/$2.swift
}
generateTest "1.1F2" "SVG11Tests"
generateTest "1.2T" "SVG12Tests"