@@ -33,7 +33,7 @@ mkdir -p $MYOUTPUTDIR
3333cd ${BUILT_PRODUCTS_DIR}
3434
3535test_target_num () {
36- FAIL=0
36+ local FAIL=0 # yuck, FAIL is also a global var
3737
3838 echo " note: ******************** $2 : $1 ********************"
3939
@@ -164,7 +164,7 @@ test_target_num () {
164164}
165165
166166fail_codegen_target_num () {
167- FAIL=0
167+ local FAIL=0 # yuck, FAIL is also a global var
168168
169169 echo " note: ******************** $2 : $1 ********************"
170170
@@ -280,66 +280,66 @@ FAIL=0
280280
281281cd " ${MYOUTPUTDIR} "
282282
283- test_target_num " Simple Model" 1 || FAIL=1
284- test_target_num " Subclassed Model" 2 || FAIL=1
285- test_target_num " Annotated minimal entity" 3 || FAIL=1
286- test_target_num " Un-annotated minimal entity" 4 || FAIL=1
287- test_target_num " Two IDs one annotated" 5 || FAIL=1
288- fail_codegen_target_num " Two IDs both annotated" 6 || FAIL=1
289- fail_codegen_target_num " Two IDs none annotated" 7 || FAIL=1
290- fail_codegen_target_num " Empty Entity" 8 || FAIL=1
291- test_target_num " ID and 2 strings entity" 9 || FAIL=1
292- fail_codegen_target_num " NameInDb collision with other property" 10 || FAIL=1
293- fail_codegen_target_num " Entity with string but no ID" 11 || FAIL=1
294- test_target_num " Remove A Property" 12 || FAIL=1
295- test_target_num " Remove A Property and add one at same time" 13 || FAIL=1
296- test_target_num " Add a Property after having removed one" 14 || FAIL=1
297- test_target_num " Remove an index from a property" 15 || FAIL=1
298- test_target_num " Add and remove an index in one go" 16 || FAIL=1
299- test_target_num " Add an index after having removed one" 17 || FAIL=1
300- test_target_num " Rename an entity" 18 || FAIL=1
301- fail_codegen_target_num " Entity UID printing" 19 || FAIL=1
302- fail_codegen_target_num " New Entity with empty UID" 20 || FAIL=1
303- test_target_num " Rename a property" 21 || FAIL=1
304- fail_codegen_target_num " Property UID printing" 22 || FAIL=1
305- fail_codegen_target_num " New Property with empty UID" 23 || FAIL=1
306- fail_codegen_target_num " New Property with UID" 24 || FAIL=1
307- test_target_num " Read/write all our data types" 25 || FAIL=1
308- test_target_num " Ensure running codegen on unchanged file changes nothing" 26 || FAIL=1
309- test_target_num " Ensure assigning a previously proposed UID works [Change/Reset]" 27 || FAIL=1
310- test_target_num " Ensure moving properties changes nothing" 28 || FAIL=1
311- test_target_num " Ensure moving entities changes nothing" 29 || FAIL=1
312- test_target_num " Unique Entity Exception Test" 30 || FAIL=1
313- test_target_num " Struct Entity Test" 31 || FAIL=1
314- test_target_num " UInt64 as ID Test" 32 || FAIL=1
315- test_target_num " Data and [UInt8] Test" 33 || FAIL=1
316-
317- test_target_num " Converter Test" 34 || FAIL=1
318- test_target_num " Enum Test" 35 || FAIL=1
319- test_target_num " Standalone Relations" 36 || FAIL=1
320- test_target_num " Standalone Backlinks" 37 || FAIL=1
321- test_target_num " Edit ToOne Backlinks" 38 || FAIL=1
322- test_target_num " Edit ToOne Backlinks Structs" 39 || FAIL=1
323- test_target_num " Standalone Backlinks Structs" 40 || FAIL=1
324- fail_codegen_target_num " ToOne Backlink annotation wrong" 41 || FAIL=1
325- test_target_num " Standalone Relation Queries" 42 || FAIL=1
326- test_target_num " ToOne Relation Queries" 43 || FAIL=1
327- test_target_num " many-to-many reset" 44 || FAIL=1
328- test_target_num " many-to-many backlink reset" 45 || FAIL=1
329- test_target_num " Threaded ToOne backlink edit" 46 || FAIL=1
330- test_target_num " Threaded Many-to-many edit" 47 || FAIL=1
331- test_target_num " Threaded Many-to-many backlink edit" 48 || FAIL=1
332- test_target_num " Untyped IDs and queries 1" 49 || FAIL=1
333- test_target_num " Untyped IDs and queries 2" 50 || FAIL=1
334- # fail_codegen_target_num "Typed IDs still enforce type?" 51 || FAIL=1
335-
336- fail_codegen_target_num " Ensure we don't write JSON before ID errors" 52 || FAIL=1
337- test_target_num " ToOne Backlink ensure applyToDb is needed" 53 || FAIL=1
338- test_target_num " ToMany ensure applyToDb is needed" 54 || FAIL=1
339- test_target_num " ToMany Backlink ensure applyToDb is needed" 55 || FAIL=1
340- test_target_num " Swift Property Wrappers are treated as wrapped type" 56 || FAIL=1
341- test_target_num " Optional Template Syntax recognized as optional" 57 || FAIL=1
342-
343- echo " note: Finished tests... "
283+ test_target_num " Simple Model" 1 || (( FAIL++ ))
284+ test_target_num " Subclassed Model" 2 || (( FAIL++ ))
285+ test_target_num " Annotated minimal entity" 3 || (( FAIL++ ))
286+ test_target_num " Un-annotated minimal entity" 4 || (( FAIL++ ))
287+ test_target_num " Two IDs one annotated" 5 || (( FAIL++ ))
288+ fail_codegen_target_num " Two IDs both annotated" 6 || (( FAIL++ ))
289+ fail_codegen_target_num " Two IDs none annotated" 7 || (( FAIL++ ))
290+ fail_codegen_target_num " Empty Entity" 8 || (( FAIL++ ))
291+ test_target_num " ID and 2 strings entity" 9 || (( FAIL++ ))
292+ fail_codegen_target_num " NameInDb collision with other property" 10 || (( FAIL++ ))
293+ fail_codegen_target_num " Entity with string but no ID" 11 || (( FAIL++ ))
294+ test_target_num " Remove A Property" 12 || (( FAIL++ ))
295+ test_target_num " Remove A Property and add one at same time" 13 || (( FAIL++ ))
296+ test_target_num " Add a Property after having removed one" 14 || (( FAIL++ ))
297+ test_target_num " Remove an index from a property" 15 || (( FAIL++ ))
298+ test_target_num " Add and remove an index in one go" 16 || (( FAIL++ ))
299+ test_target_num " Add an index after having removed one" 17 || (( FAIL++ ))
300+ test_target_num " Rename an entity" 18 || (( FAIL++ ))
301+ fail_codegen_target_num " Entity UID printing" 19 || (( FAIL++ ))
302+ fail_codegen_target_num " New Entity with empty UID" 20 || (( FAIL++ ))
303+ test_target_num " Rename a property" 21 || (( FAIL++ ))
304+ fail_codegen_target_num " Property UID printing" 22 || (( FAIL++ ))
305+ fail_codegen_target_num " New Property with empty UID" 23 || (( FAIL++ ))
306+ fail_codegen_target_num " New Property with UID" 24 || (( FAIL++ ))
307+ test_target_num " Read/write all our data types" 25 || (( FAIL++ ))
308+ test_target_num " Ensure running codegen on unchanged file changes nothing" 26 || (( FAIL++ ))
309+ test_target_num " Ensure assigning a previously proposed UID works [Change/Reset]" 27 || (( FAIL++ ))
310+ test_target_num " Ensure moving properties changes nothing" 28 || (( FAIL++ ))
311+ test_target_num " Ensure moving entities changes nothing" 29 || (( FAIL++ ))
312+ test_target_num " Unique Entity Exception Test" 30 || (( FAIL++ ))
313+ test_target_num " Struct Entity Test" 31 || (( FAIL++ ))
314+ test_target_num " UInt64 as ID Test" 32 || (( FAIL++ ))
315+ test_target_num " Data and [UInt8] Test" 33 || (( FAIL++ ))
316+
317+ test_target_num " Converter Test" 34 || (( FAIL++ ))
318+ test_target_num " Enum Test" 35 || (( FAIL++ ))
319+ test_target_num " Standalone Relations" 36 || (( FAIL++ ))
320+ test_target_num " Standalone Backlinks" 37 || (( FAIL++ ))
321+ test_target_num " Edit ToOne Backlinks" 38 || (( FAIL++ ))
322+ test_target_num " Edit ToOne Backlinks Structs" 39 || (( FAIL++ ))
323+ test_target_num " Standalone Backlinks Structs" 40 || (( FAIL++ ))
324+ fail_codegen_target_num " ToOne Backlink annotation wrong" 41 || (( FAIL++ ))
325+ test_target_num " Standalone Relation Queries" 42 || (( FAIL++ ))
326+ test_target_num " ToOne Relation Queries" 43 || (( FAIL++ ))
327+ test_target_num " many-to-many reset" 44 || (( FAIL++ ))
328+ test_target_num " many-to-many backlink reset" 45 || (( FAIL++ ))
329+ test_target_num " Threaded ToOne backlink edit" 46 || (( FAIL++ ))
330+ test_target_num " Threaded Many-to-many edit" 47 || (( FAIL++ ))
331+ test_target_num " Threaded Many-to-many backlink edit" 48 || (( FAIL++ ))
332+ test_target_num " Untyped IDs and queries 1" 49 || (( FAIL++ ))
333+ test_target_num " Untyped IDs and queries 2" 50 || (( FAIL++ ))
334+ # fail_codegen_target_num "Typed IDs still enforce type?" 51 || (( FAIL++))
335+
336+ fail_codegen_target_num " Ensure we don't write JSON before ID errors" 52 || (( FAIL++ ))
337+ test_target_num " ToOne Backlink ensure applyToDb is needed" 53 || (( FAIL++ ))
338+ test_target_num " ToMany ensure applyToDb is needed" 54 || (( FAIL++ ))
339+ test_target_num " ToMany Backlink ensure applyToDb is needed" 55 || (( FAIL++ ))
340+ test_target_num " Swift Property Wrappers are treated as wrapped type" 56 || (( FAIL++ ))
341+ test_target_num " Optional Template Syntax recognized as optional" 57 || (( FAIL++ ))
342+
343+ echo " note: Finished tests with $FAIL failures "
344344
345345exit $FAIL
0 commit comments