Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Merged into one big app, while keeping modular applications also.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbens committed Aug 2, 2009
1 parent 0b2dcbb commit 3e9b0cc
Show file tree
Hide file tree
Showing 10 changed files with 137 additions and 6 deletions.
18 changes: 13 additions & 5 deletions test/automated/Makefile
Expand Up @@ -7,6 +7,11 @@ LDFLAGS := `sdl-config --libs`
#CFLAGS := -I. -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/local/include/SDL
#LDFLAGS := -lm -ldl -lesd -lpthread

SRC := testsdl.c \
rwops/rwops.c \
platform/platform.c \
surface/surface.c \
render/render.c
COMMON_SRC := SDL_at.c common/common.c
COMMON_INCLUDE := SDL_at.h

Expand All @@ -16,25 +21,28 @@ TESTS_ALL := rwops/rwops platform/platform surface/surface render/render
.PHONY: all clean test


all: $(TESTS_ALL)
all: testsdl $(TESTS_ALL)

test: all
@./rwops/rwops
@./platform/platform
@./surface/surface
@./render/render

testsdl:
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SRC) $(COMMON_SRC)

rwops/rwops: rwops/rwops.c $(COMMON_INCLUDE) $(COMMON_SRC)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ rwops/rwops.c $(COMMON_SRC)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ rwops/rwops.c $(COMMON_SRC) -DTEST_STANDALONE

platform/platform: platform/platform.c $(COMMON_INCLUDE) $(COMMON_SRC)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ platform/platform.c $(COMMON_SRC)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ platform/platform.c $(COMMON_SRC) -DTEST_STANDALONE

surface/surface: surface/surface.c $(COMMON_INCLUDE) $(COMMON_SRC)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ surface/surface.c $(COMMON_SRC)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ surface/surface.c $(COMMON_SRC) -DTEST_STANDALONE

render/render: render/render.c $(COMMON_INCLUDE) $(COMMON_SRC)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ render/render.c $(COMMON_SRC)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ render/render.c $(COMMON_SRC) -DTEST_STANDALONE

clean:
$(RM) $(TESTS_ALL)
10 changes: 9 additions & 1 deletion test/automated/platform/platform.c
Expand Up @@ -131,10 +131,18 @@ static void plat_testEndian (void)
}


int main(int argc, char *argv[])
/**
* @brief Platform test entrypoint.
*/
#ifdef TEST_STANDALONE
int main( int argc, const char *argv[] )
{
(void) argc;
(void) argv;
#else /* TEST_STANDALONE */
int test_platform (void)
{
#endif /* TEST_STANDALONE */

SDL_ATinit( "Platform" );

Expand Down
18 changes: 18 additions & 0 deletions test/automated/platform/platform.h
@@ -0,0 +1,18 @@
/**
* Part of SDL test suite.
*
* Written by Edgar Simo "bobbens"
*
* Released under Public Domain.
*/


#ifndef _TEST_PLATFORM
# define _TEST_PLATFORM


int test_platform (void);


#endif /* _TEST_PLATFORM */

5 changes: 5 additions & 0 deletions test/automated/render/render.c
Expand Up @@ -951,10 +951,15 @@ int render_runTests (void)
* give issues. Don't like that very much, but no way around without creating
* superfluous testsuites.
*/
#ifdef TEST_STANDALONE
int main( int argc, const char *argv[] )
{
(void) argc;
(void) argv;
#else /* TEST_STANDALONE */
int test_render (void)
{
#endif /* TEST_STANDALONE */
int i, j, nd, nr;
int ret;
const char *driver, *str;
Expand Down
18 changes: 18 additions & 0 deletions test/automated/render/render.h
@@ -0,0 +1,18 @@
/**
* Part of SDL test suite.
*
* Written by Edgar Simo "bobbens"
*
* Released under Public Domain.
*/


#ifndef _TEST_RENDER
# define _TEST_RENDER


int test_render (void);


#endif /* _TEST_RENDER */

5 changes: 5 additions & 0 deletions test/automated/rwops/rwops.c
Expand Up @@ -249,10 +249,15 @@ static void rwops_testFP (void)
/**
* @brief Entry point.
*/
#ifdef TEST_STANDALONE
int main( int argc, const char *argv[] )
{
(void) argc;
(void) argv;
#else /* TEST_STANDALONE */
int test_rwops (void)
{
#endif /* TEST_STANDALONE */

SDL_ATinit( "SDL_RWops" );

Expand Down
18 changes: 18 additions & 0 deletions test/automated/rwops/rwops.h
@@ -0,0 +1,18 @@
/**
* Part of SDL test suite.
*
* Written by Edgar Simo "bobbens"
*
* Released under Public Domain.
*/


#ifndef _TEST_RWOPS
# define _TEST_RWOPS


int test_rwops (void);


#endif /* _TEST_RWOPS */

5 changes: 5 additions & 0 deletions test/automated/surface/surface.c
Expand Up @@ -545,10 +545,15 @@ void surface_runTests( SDL_Surface *testsur )
/**
* @brief Entry point.
*/
#ifdef TEST_STANDALONE
int main( int argc, const char *argv[] )
{
(void) argc;
(void) argv;
#else /* TEST_STANDALONE */
int test_surface (void)
{
#endif /* TEST_STANDALONE */
int ret;
SDL_Surface *testsur;

Expand Down
18 changes: 18 additions & 0 deletions test/automated/surface/surface.h
@@ -0,0 +1,18 @@
/**
* Part of SDL test suite.
*
* Written by Edgar Simo "bobbens"
*
* Released under Public Domain.
*/


#ifndef _TEST_SURFACE
# define _TEST_SURFACE


int test_surface (void);


#endif /* _TEST_SURFACE */

28 changes: 28 additions & 0 deletions test/automated/testsdl.c
@@ -0,0 +1,28 @@
/*
* SDL test suite framework code.
*
* Written by Edgar Simo "bobbens"
*
* Released under Public Domain.
*/


#include "platform/platform.h"
#include "rwops/rwops.h"
#include "surface/surface.h"
#include "render/render.h"


int main( int argc, char *argv[] )
{
(void) argc;
(void) argv;

test_platform();
test_rwops();
test_surface();
test_render();

return 0;
}

0 comments on commit 3e9b0cc

Please sign in to comment.