1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-01 15:00:38 +00:00

Add $CONSOLE:ONLY and libz tests

libz tests were missing, I added one to test the libz dependency.

Additionally $CONSOLE:ONLY creates many weird interactions and is
currently broken in some cases. This adds tests for all the dependencies
that can work with $CONSOLE:ONLY to verify that they compile correctly.
This commit is contained in:
Matthew Kilgore 2022-09-16 22:36:29 -04:00
parent 2deac87b60
commit 870e67a99b
22 changed files with 130 additions and 2 deletions

View file

@ -0,0 +1,6 @@
$CONSOLE:ONLY
_DEST _CONSOLE
PLAY "O3"
print "this is a test";
SYSTEM

View file

@ -0,0 +1,10 @@
$CONSOLE:ONLY
FOR i& = 1 TO 6
READ a&
PRINT a&;
NEXT
SYSTEM
DATA 1, 2, 3, 4, 5, 6

View file

@ -0,0 +1 @@
1 2 3 4 5 6

View file

@ -0,0 +1,7 @@
$CONSOLE:ONLY
_DEST _CONSOLE
print _DEVICES > 1;
_DELAY 1
SYSTEM

View file

@ -0,0 +1 @@
-1

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -0,0 +1,8 @@
$CONSOLE:ONLY
CHDIR _STARTDIR$
l = _LOADIMAGE("./foobar.bmp", 32)
print l; _HEIGHT(l); _WIDTH(l);
_FREEIMAGE l
SYSTEM

View file

@ -0,0 +1 @@
-13 48 72

View file

@ -0,0 +1,18 @@
$CONSOLE:ONLY
_DEST _CONSOLE
PRINT HexString$(_DEFLATE$("this is a test"))
SYSTEM
Function HexString$(s As String)
Dim ret As String
For i = 1 To Len(s)
Dim h As String
h = Hex$(Asc(s, i))
If Len(h) = 1 Then h = "0" + h
ret = ret + h
Next
HexString$ = ret
End Function

View file

@ -0,0 +1 @@
789C2BC9C82C5600A2448592D4E2120026330516

View file

@ -0,0 +1,11 @@
$CONSOLE:ONLY
_DEST _CONSOLE
CHDIR _STARTDIR$
$Unstable: Midi
$MidiSoundFont: Default
handle = _SndOpen("./midi.mid")
print handle;
SYSTEM

Binary file not shown.

View file

@ -0,0 +1 @@
1

View file

@ -0,0 +1,4 @@
$CONSOLE:ONLY
result = _OPENHOST("foobar")

View file

@ -0,0 +1,16 @@
$CONSOLE:ONLY
_DEST _CONSOLE
$IF WIN THEN
$ELSE
' We can't do _SCREENIMAGE on Linux or Mac OS build agents, but we can still test
' that it compiles
PRINT -13;
SYSTEM
$END IF
i& = _SCREENIMAGE
PRINT i&;
SYSTEM

View file

@ -0,0 +1 @@
-13

View file

@ -1,4 +1,6 @@
$CONSOLE:ONLY
$CONSOLE
$SCREENHIDE
_DEST _CONSOLE
FOR i& = 1 TO 6
READ a&

View file

@ -1,4 +1,6 @@
$CONSOLE:ONLY
$CONSOLE
$SCREENHIDE
_DEST _CONSOLE
CHDIR _STARTDIR$
l = _LOADIMAGE("./foobar.bmp", 32)

View file

@ -0,0 +1,19 @@
$CONSOLE
$SCREENHIDE
_DEST _CONSOLE
PRINT HexString$(_DEFLATE$("this is a test"))
SYSTEM
Function HexString$(s As String)
Dim ret As String
For i = 1 To Len(s)
Dim h As String
h = Hex$(Asc(s, i))
If Len(h) = 1 Then h = "0" + h
ret = ret + h
Next
HexString$ = ret
End Function

View file

@ -0,0 +1 @@
789C2BC9C82C5600A2448592D4E2120026330516

View file

@ -0,0 +1,17 @@
$CONSOLE
$SCREENHIDE
_DEST _CONSOLE
$IF WIN THEN
$ELSE
' We can't do _SCREENIMAGE on Linux or Mac OS build agents, but we can still
' test that it compiles
PRINT -13;
SYSTEM
$END IF
i& = _SCREENIMAGE
PRINT i&;
SYSTEM

View file

@ -0,0 +1 @@
-13