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:
parent
2deac87b60
commit
870e67a99b
6
tests/compile_tests/console_only/audio_out.bas
Normal file
6
tests/compile_tests/console_only/audio_out.bas
Normal file
|
@ -0,0 +1,6 @@
|
|||
$CONSOLE:ONLY
|
||||
_DEST _CONSOLE
|
||||
|
||||
PLAY "O3"
|
||||
print "this is a test";
|
||||
SYSTEM
|
10
tests/compile_tests/console_only/data.bas
Normal file
10
tests/compile_tests/console_only/data.bas
Normal 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
|
1
tests/compile_tests/console_only/data.output
Normal file
1
tests/compile_tests/console_only/data.output
Normal file
|
@ -0,0 +1 @@
|
|||
1 2 3 4 5 6
|
7
tests/compile_tests/console_only/devices.bas
Normal file
7
tests/compile_tests/console_only/devices.bas
Normal file
|
@ -0,0 +1,7 @@
|
|||
$CONSOLE:ONLY
|
||||
_DEST _CONSOLE
|
||||
|
||||
print _DEVICES > 1;
|
||||
_DELAY 1
|
||||
|
||||
SYSTEM
|
1
tests/compile_tests/console_only/devices.output
Normal file
1
tests/compile_tests/console_only/devices.output
Normal file
|
@ -0,0 +1 @@
|
|||
-1
|
BIN
tests/compile_tests/console_only/foobar.bmp
Normal file
BIN
tests/compile_tests/console_only/foobar.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
8
tests/compile_tests/console_only/image.bas
Normal file
8
tests/compile_tests/console_only/image.bas
Normal file
|
@ -0,0 +1,8 @@
|
|||
$CONSOLE:ONLY
|
||||
CHDIR _STARTDIR$
|
||||
|
||||
l = _LOADIMAGE("./foobar.bmp", 32)
|
||||
|
||||
print l; _HEIGHT(l); _WIDTH(l);
|
||||
_FREEIMAGE l
|
||||
SYSTEM
|
1
tests/compile_tests/console_only/image.output
Normal file
1
tests/compile_tests/console_only/image.output
Normal file
|
@ -0,0 +1 @@
|
|||
-13 48 72
|
18
tests/compile_tests/console_only/libz.bas
Normal file
18
tests/compile_tests/console_only/libz.bas
Normal 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
|
1
tests/compile_tests/console_only/libz.output
Normal file
1
tests/compile_tests/console_only/libz.output
Normal file
|
@ -0,0 +1 @@
|
|||
789C2BC9C82C5600A2448592D4E2120026330516
|
11
tests/compile_tests/console_only/midi.bas
Normal file
11
tests/compile_tests/console_only/midi.bas
Normal file
|
@ -0,0 +1,11 @@
|
|||
$CONSOLE:ONLY
|
||||
_DEST _CONSOLE
|
||||
CHDIR _STARTDIR$
|
||||
|
||||
$Unstable: Midi
|
||||
$MidiSoundFont: Default
|
||||
|
||||
handle = _SndOpen("./midi.mid")
|
||||
|
||||
print handle;
|
||||
SYSTEM
|
BIN
tests/compile_tests/console_only/midi.mid
Normal file
BIN
tests/compile_tests/console_only/midi.mid
Normal file
Binary file not shown.
1
tests/compile_tests/console_only/midi.output
Normal file
1
tests/compile_tests/console_only/midi.output
Normal file
|
@ -0,0 +1 @@
|
|||
1
|
4
tests/compile_tests/console_only/network.bas
Normal file
4
tests/compile_tests/console_only/network.bas
Normal file
|
@ -0,0 +1,4 @@
|
|||
$CONSOLE:ONLY
|
||||
|
||||
result = _OPENHOST("foobar")
|
||||
|
16
tests/compile_tests/console_only/screenimage.bas
Normal file
16
tests/compile_tests/console_only/screenimage.bas
Normal 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
|
1
tests/compile_tests/console_only/screenimage.output
Normal file
1
tests/compile_tests/console_only/screenimage.output
Normal file
|
@ -0,0 +1 @@
|
|||
-13
|
|
@ -1,4 +1,6 @@
|
|||
$CONSOLE:ONLY
|
||||
$CONSOLE
|
||||
$SCREENHIDE
|
||||
_DEST _CONSOLE
|
||||
|
||||
FOR i& = 1 TO 6
|
||||
READ a&
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
$CONSOLE:ONLY
|
||||
$CONSOLE
|
||||
$SCREENHIDE
|
||||
_DEST _CONSOLE
|
||||
CHDIR _STARTDIR$
|
||||
|
||||
l = _LOADIMAGE("./foobar.bmp", 32)
|
||||
|
|
19
tests/compile_tests/libz/test.bas
Normal file
19
tests/compile_tests/libz/test.bas
Normal 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
|
1
tests/compile_tests/libz/test.output
Normal file
1
tests/compile_tests/libz/test.output
Normal file
|
@ -0,0 +1 @@
|
|||
789C2BC9C82C5600A2448592D4E2120026330516
|
17
tests/compile_tests/screenimage/test.bas
Normal file
17
tests/compile_tests/screenimage/test.bas
Normal 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
|
1
tests/compile_tests/screenimage/test.output
Normal file
1
tests/compile_tests/screenimage/test.output
Normal file
|
@ -0,0 +1 @@
|
|||
-13
|
Loading…
Reference in a new issue