Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merged into one big app, while keeping modular applications also.

  • Loading branch information
bobbens committed Aug 2, 2009
1 parent 0b2dcbb commit 3e9b0cca46ea29aff1dad13a07f8de4c04a59d0e
@@ -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

@@ -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)
@@ -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" );

@@ -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 */

@@ -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;
@@ -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 */

@@ -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" );

@@ -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 */

@@ -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;

@@ -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 */

@@ -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.