test: Add some common code to load test resources
As well as reducing duplication, this lets the tests load their resources from the SDL_GetBasePath() on platforms that support it, which is useful if the tests are compiled along with the rest of SDL and installed below /usr as manual tests, similar to GNOME's installed-tests convention. Thanks to Ozkan Sezer for the OS/2 build glue. Co-authored-by: Ozkan Sezer <sezeroz@gmail.com> Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
committed by
Sam Lantinga
parent
ecf1e15fec
commit
76a7b629bf
@@ -90,10 +90,10 @@ checkkeys$(EXE): $(srcdir)/checkkeys.c
|
||||
checkkeysthreads$(EXE): $(srcdir)/checkkeysthreads.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
loopwave$(EXE): $(srcdir)/loopwave.c
|
||||
loopwave$(EXE): $(srcdir)/loopwave.c $(srcdir)/testutils.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
loopwavequeue$(EXE): $(srcdir)/loopwavequeue.c
|
||||
loopwavequeue$(EXE): $(srcdir)/loopwavequeue.c $(srcdir)/testutils.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testsurround$(EXE): $(srcdir)/testsurround.c
|
||||
@@ -126,10 +126,10 @@ testautomation$(EXE): $(srcdir)/testautomation.c \
|
||||
$(srcdir)/testautomation_hints.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testmultiaudio$(EXE): $(srcdir)/testmultiaudio.c
|
||||
testmultiaudio$(EXE): $(srcdir)/testmultiaudio.c $(srcdir)/testutils.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testaudiohotplug$(EXE): $(srcdir)/testaudiohotplug.c
|
||||
testaudiohotplug$(EXE): $(srcdir)/testaudiohotplug.c $(srcdir)/testutils.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testaudiocapture$(EXE): $(srcdir)/testaudiocapture.c
|
||||
@@ -165,10 +165,10 @@ testevdev$(EXE): $(srcdir)/testevdev.c
|
||||
testfile$(EXE): $(srcdir)/testfile.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testgamecontroller$(EXE): $(srcdir)/testgamecontroller.c
|
||||
testgamecontroller$(EXE): $(srcdir)/testgamecontroller.c $(srcdir)/testutils.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testgeometry$(EXE): $(srcdir)/testgeometry.c
|
||||
testgeometry$(EXE): $(srcdir)/testgeometry.c $(srcdir)/testutils.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testgesture$(EXE): $(srcdir)/testgesture.c
|
||||
@@ -183,7 +183,7 @@ testgles$(EXE): $(srcdir)/testgles.c
|
||||
testgles2$(EXE): $(srcdir)/testgles2.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
|
||||
|
||||
testgles2_sdf$(EXE): $(srcdir)/testgles2_sdf.c
|
||||
testgles2_sdf$(EXE): $(srcdir)/testgles2_sdf.c $(srcdir)/testutils.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
|
||||
|
||||
testhaptic$(EXE): $(srcdir)/testhaptic.c
|
||||
@@ -198,10 +198,10 @@ testrumble$(EXE): $(srcdir)/testrumble.c
|
||||
testthread$(EXE): $(srcdir)/testthread.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testiconv$(EXE): $(srcdir)/testiconv.c
|
||||
testiconv$(EXE): $(srcdir)/testiconv.c $(srcdir)/testutils.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testime$(EXE): $(srcdir)/testime.c
|
||||
testime$(EXE): $(srcdir)/testime.c $(srcdir)/testutils.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @SDL_TTF_LIB@
|
||||
|
||||
testjoystick$(EXE): $(srcdir)/testjoystick.c
|
||||
@@ -219,18 +219,21 @@ testlock$(EXE): $(srcdir)/testlock.c
|
||||
ifeq (@ISMACOSX@,true)
|
||||
testnative$(EXE): $(srcdir)/testnative.c \
|
||||
$(srcdir)/testnativecocoa.m \
|
||||
$(srcdir)/testutils.c \
|
||||
$(srcdir)/testnativex11.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) -framework Cocoa @XLIB@
|
||||
endif
|
||||
|
||||
ifeq (@ISWINDOWS@,true)
|
||||
testnative$(EXE): $(srcdir)/testnative.c \
|
||||
$(srcdir)/testutils.c \
|
||||
$(srcdir)/testnativew32.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
endif
|
||||
|
||||
ifeq (@ISUNIX@,true)
|
||||
testnative$(EXE): $(srcdir)/testnative.c \
|
||||
$(srcdir)/testutils.c \
|
||||
$(srcdir)/testnativex11.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @XLIB@
|
||||
endif
|
||||
@@ -252,7 +255,7 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
testoverlay2$(EXE): $(srcdir)/testoverlay2.c $(srcdir)/testyuv_cvt.c
|
||||
testoverlay2$(EXE): $(srcdir)/testoverlay2.c $(srcdir)/testyuv_cvt.c $(srcdir)/testutils.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testplatform$(EXE): $(srcdir)/testplatform.c
|
||||
@@ -264,10 +267,10 @@ testpower$(EXE): $(srcdir)/testpower.c
|
||||
testfilesystem$(EXE): $(srcdir)/testfilesystem.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testrendertarget$(EXE): $(srcdir)/testrendertarget.c
|
||||
testrendertarget$(EXE): $(srcdir)/testrendertarget.c $(srcdir)/testutils.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testscale$(EXE): $(srcdir)/testscale.c
|
||||
testscale$(EXE): $(srcdir)/testscale.c $(srcdir)/testutils.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testsem$(EXE): $(srcdir)/testsem.c
|
||||
@@ -282,13 +285,13 @@ testshader$(EXE): $(srcdir)/testshader.c
|
||||
testshape$(EXE): $(srcdir)/testshape.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testsprite2$(EXE): $(srcdir)/testsprite2.c
|
||||
testsprite2$(EXE): $(srcdir)/testsprite2.c $(srcdir)/testutils.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testspriteminimal$(EXE): $(srcdir)/testspriteminimal.c
|
||||
testspriteminimal$(EXE): $(srcdir)/testspriteminimal.c $(srcdir)/testutils.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
|
||||
|
||||
teststreaming$(EXE): $(srcdir)/teststreaming.c
|
||||
teststreaming$(EXE): $(srcdir)/teststreaming.c $(srcdir)/testutils.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
|
||||
|
||||
testtimer$(EXE): $(srcdir)/testtimer.c
|
||||
@@ -300,7 +303,7 @@ testurl$(EXE): $(srcdir)/testurl.c
|
||||
testver$(EXE): $(srcdir)/testver.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testviewport$(EXE): $(srcdir)/testviewport.c
|
||||
testviewport$(EXE): $(srcdir)/testviewport.c $(srcdir)/testutils.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testwm2$(EXE): $(srcdir)/testwm2.c
|
||||
@@ -312,7 +315,7 @@ testyuv$(EXE): $(srcdir)/testyuv.c $(srcdir)/testyuv_cvt.c
|
||||
torturethread$(EXE): $(srcdir)/torturethread.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testrendercopyex$(EXE): $(srcdir)/testrendercopyex.c
|
||||
testrendercopyex$(EXE): $(srcdir)/testrendercopyex.c $(srcdir)/testutils.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @MATHLIB@
|
||||
|
||||
testmessage$(EXE): $(srcdir)/testmessage.c
|
||||
@@ -330,7 +333,7 @@ testbounds$(EXE): $(srcdir)/testbounds.c
|
||||
testcustomcursor$(EXE): $(srcdir)/testcustomcursor.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
controllermap$(EXE): $(srcdir)/controllermap.c
|
||||
controllermap$(EXE): $(srcdir)/controllermap.c $(srcdir)/testutils.c
|
||||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
|
||||
|
||||
testvulkan$(EXE): $(srcdir)/testvulkan.c
|
||||
|
||||
Reference in New Issue
Block a user