|
@@ -2,13 +2,15 @@
|
|
|
#Param 1, the directory with the tests to perform.
|
|
|
#Note versions can be either 2 or 3 fields, e g 1.1 1.0.10
|
|
|
|
|
|
-Set debugverbose 1
|
|
|
-Directory {1}
|
|
|
-Echo "** Assembles, links and run tests in "{1}" **"
|
|
|
+(Evaluate {0} =~ /(Å:)¨1[Â:]*/) > Dev:Null
|
|
|
+Set mydir {¨1}
|
|
|
+
|
|
|
+Set -e debugverbose 1
|
|
|
+Echo "** Assembles, links and run tests for MacOS **"
|
|
|
|
|
|
#Delete -i Å.o
|
|
|
-Set nrOfSucceded 0
|
|
|
-Set nrOfFailed 0
|
|
|
+Set -e nrOfSucceded 0
|
|
|
+Set -e nrOfFailed 0
|
|
|
|
|
|
#Set compiler version
|
|
|
Set compver '1.9' #Must be at least two fields
|
|
@@ -20,154 +22,40 @@ If `Evaluate "{compver}" !~ /([0-9]*)
|
|
|
Set ¨3 0
|
|
|
End
|
|
|
End
|
|
|
-Set cv1 {¨1};Set cv2 {¨2}; Set cv3 {¨3}
|
|
|
+Set -e cv1 {¨1};Set -e cv2 {¨2}; Set -e cv3 {¨3}
|
|
|
|
|
|
-#Iterate through tests
|
|
|
+Directory {1}units:
|
|
|
+
|
|
|
+#Iterate through files in :units:
|
|
|
+Set Exit 0 # To handle the case, in the for stmt, when there is no match
|
|
|
For sourceWithExt In Å.s
|
|
|
+ Set Exit 1 #Revert error handling
|
|
|
(Evaluate "{sourceWithExt}" =~ /(([Â.])*)¨1Å/) > Dev:Null
|
|
|
- Set appname {¨1}
|
|
|
- Set testdirectives ""
|
|
|
- Set testdirectives "`StreamEdit {appname}.pp ¶
|
|
|
- -d -e "/¶{[ ¶t]*(%Å*)¨1[ ¶t]*¶}/ Print ¨1"`" > Dev:Null
|
|
|
- Echo "============================================================="
|
|
|
-
|
|
|
- If {debugverbose}
|
|
|
- Echo {testdirectives}
|
|
|
- End
|
|
|
-
|
|
|
- If `Evaluate "{testdirectives}" =~ /Å%CPU=([,_0-9A-Za-z]*)¨1Å/`
|
|
|
- If `Evaluate "{¨1}" !~ /ÅpowerpcÅ/`
|
|
|
- Echo Skipped {appname}. Test only for CPU: "{¨1}"
|
|
|
- Continue
|
|
|
- End
|
|
|
- End
|
|
|
-
|
|
|
- If `Evaluate "{testdirectives}" =~ /Å%SKIPCPU=([,_0-9A-Za-z]*)¨1Å/`
|
|
|
- If `Evaluate "{¨1}" =~ /ÅpowerpcÅ/`
|
|
|
- Echo Skipped {appname}. Test not for CPU: {¨1}
|
|
|
- Continue
|
|
|
- End
|
|
|
- End
|
|
|
-
|
|
|
- If `Evaluate "{testdirectives}" =~ /Å%TARGET=([,_0-9A-Za-z]*)¨1Å/`
|
|
|
- If `Evaluate "{¨1}" !~ /ÅmacosÅ/`
|
|
|
- Echo Skipped {appname}. Test only for target: {¨1}
|
|
|
- Continue
|
|
|
- End
|
|
|
- End
|
|
|
-
|
|
|
- If `Evaluate "{testdirectives}" =~ /Å%SKIPTARGET=([,_0-9A-Za-z]*)¨1Å/`
|
|
|
- If `Evaluate "{¨1}" =~ /ÅmacosÅ/`
|
|
|
- Echo Skipped {appname}. Test not for target: {¨1}
|
|
|
- Continue
|
|
|
- End
|
|
|
- End
|
|
|
-
|
|
|
- If `Evaluate "{testdirectives}" =~ /Å%VERSION=([0-9.]*)¨1Å/`
|
|
|
- Set minver {¨1}
|
|
|
- If `Evaluate "{minver}" !~ /([0-9]*)¨1.([0-9]*)¨2.([0-9]*)¨3/`
|
|
|
- If `Evaluate "{minver}" !~ /([0-9]*)¨1.([0-9]*)¨2/`
|
|
|
- Echo Skipped {appname}. Error in version no: {minver}
|
|
|
- Continue
|
|
|
- Else
|
|
|
- Set ¨3 0
|
|
|
- End
|
|
|
- End
|
|
|
-
|
|
|
- If Â(({cv1}> {¨1}) || (({cv1}=={¨1}) && ¶
|
|
|
- (({cv2}> {¨2}) || (({cv2}=={¨2}) && ¶
|
|
|
- ({cv3}>={¨3})))))
|
|
|
- Echo Skipped {appname}. Compiler too old, test requires at least: {minver}
|
|
|
- Continue
|
|
|
- End
|
|
|
- End
|
|
|
-
|
|
|
- If `Evaluate "{testdirectives}" =~ /Å%MAXVERSION=([0-9.]*)¨1Å/`
|
|
|
- Set maxver {¨1}
|
|
|
- If `Evaluate "{maxver}" !~ /([0-9]*)¨1.([0-9]*)¨2.([0-9]*)¨3/`
|
|
|
- If `Evaluate "{maxver}" !~ /([0-9]*)¨1.([0-9]*)¨2/`
|
|
|
- Echo Skipped {appname}. Error in version no: {maxver}
|
|
|
- Continue
|
|
|
- Else
|
|
|
- Set ¨3 0
|
|
|
- End
|
|
|
- End
|
|
|
-
|
|
|
- If Â(({cv1}< {¨1}) || (({cv1}=={¨1}) && ¶
|
|
|
- (({cv2}< {¨2}) || (({cv2}=={¨2}) && ¶
|
|
|
- ({cv3}<={¨3})))))
|
|
|
- Echo Skipped {appname}. Compiler too new, test requires no more than: {maxver}
|
|
|
- Continue
|
|
|
- End
|
|
|
- End
|
|
|
-
|
|
|
- If `Evaluate "{testdirectives}" =~ /Å%NOTE=([Â%]*)¨1Å/`
|
|
|
- Echo Note: {¨1}
|
|
|
- End
|
|
|
-
|
|
|
- # Start compiling
|
|
|
- Echo Start compiling "{appname}"
|
|
|
-
|
|
|
- SetFile -c 'MPS ' -t 'TEXT' {appname}_ppas
|
|
|
-
|
|
|
- Set Exit 0
|
|
|
- Execute {appname}_ppas
|
|
|
-
|
|
|
- If "{Status}" != 0
|
|
|
- Set Exit 1
|
|
|
- Echo Compiling of "{appname}" failed
|
|
|
- Set nrOfFailed `Evaluate {nrOfFailed}+1`
|
|
|
- If {debugverbose}
|
|
|
- StreamEdit {appname}.pp -d -e "1,15 Print"
|
|
|
- End
|
|
|
- Continue
|
|
|
- Else
|
|
|
- Set Exit 1
|
|
|
- Echo Compiling of "{appname}" succeded
|
|
|
- End
|
|
|
-
|
|
|
- If `Evaluate "{testdirectives}" =~ /Å%NORUNÅ/`
|
|
|
- Echo Skipped running of {appname} due to option NORUN
|
|
|
- Continue
|
|
|
- End
|
|
|
-
|
|
|
- If `Evaluate "{testdirectives}" =~ /Å%INTERACTIVEÅ/`
|
|
|
- Echo Skipped running of {appname} due to option INTERACTIVE
|
|
|
+ Set unitname {¨1}
|
|
|
+ If `Exists {unitname}.o`
|
|
|
Continue
|
|
|
End
|
|
|
+ SetFile -c 'MPS ' -t 'TEXT' {unitname}_ppas
|
|
|
+ Execute {unitname}_ppas
|
|
|
+ Set Exit 0 # To handle the case, in the for stmt, when there is no match
|
|
|
+End
|
|
|
+Set Exit 1 #Revert error handling
|
|
|
|
|
|
- If 1
|
|
|
- If `Evaluate "{testdirectives}" =~ /Å%RESULT=([0-9]*)¨1Å/`
|
|
|
- Set expectedresult {¨1}
|
|
|
- Else
|
|
|
- Set expectedresult 0
|
|
|
- End
|
|
|
-
|
|
|
- #Execute test program
|
|
|
- Set Exit 0
|
|
|
- {appname}
|
|
|
- Set actualresult {Status}
|
|
|
- Set Exit 1
|
|
|
+Directory {1}
|
|
|
|
|
|
- If {actualresult} != 0
|
|
|
- Echo Running of "{appname}" failed
|
|
|
- Else
|
|
|
- Echo Running of "{appname}" succeded
|
|
|
- End
|
|
|
+{mydir}LinkRunDir ':test:'
|
|
|
+{mydir}LinkRunDir ':test:cg:'
|
|
|
+{mydir}LinkRunDir ':test:cg:cdecl:'
|
|
|
+{mydir}LinkRunDir ':test:units:system:'
|
|
|
+{mydir}LinkRunDir ':test:units:strings:'
|
|
|
+{mydir}LinkRunDir ':test:units:objects:'
|
|
|
+{mydir}LinkRunDir ':test:units:math:'
|
|
|
+{mydir}LinkRunDir ':test:opt:'
|
|
|
+{mydir}LinkRunDir ':tbs:'
|
|
|
+{mydir}LinkRunDir ':tbf:'
|
|
|
+{mydir}LinkRunDir ':webtbs:'
|
|
|
+{mydir}LinkRunDir ':webtbf:'
|
|
|
|
|
|
- Echo "Exit code was {actualresult}, expected {expectedresult}"
|
|
|
- If "{actualresult}" != "{expectedresult}"
|
|
|
- Echo Failed test "{appname}"
|
|
|
- Set nrOfFailed `Evaluate {nrOfFailed}+1`
|
|
|
- If {debugverbose}
|
|
|
- StreamEdit {appname}.pp -d -e "1,15 Print"
|
|
|
- End
|
|
|
- Else
|
|
|
- Echo Succeded test "{appname}"
|
|
|
- Set nrOfSucceded `Evaluate {nrOfSucceded}+1`
|
|
|
- End
|
|
|
- End
|
|
|
-End
|
|
|
Echo "============================================================="
|
|
|
Echo '** Test session finished. **'
|
|
|
Echo "No of succeded tests: {nrOfSucceded}"
|