Skip to content

Commit

Permalink
Initial revision of unit test system; currently does not compile
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Glover committed Mar 17, 2010
1 parent 253810e commit 1a8bf21
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ set(ADONTHELL_MODULES
rpg
main
world
test
)

#
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -- this order is important, as we build with -no-undefined
SUBDIRS = base python py-runtime event gfx input audio rpg gui world main py-wrappers
SUBDIRS = base python py-runtime event gfx input audio rpg gui world main py-wrappers test

EXTRA_DIST = CMakeLists.txt

Expand Down
2 changes: 2 additions & 0 deletions src/audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ set(adonthell_audio_SRCS
sound.cc
audio_event.cc
audio_event_manager.cc
audio_manager.cc
)

set(adonthell_audio_HEADERS
audio_event.h
audio_event_manager.h
audio_manager.h
audio.h
sound.h
)
Expand Down
4 changes: 3 additions & 1 deletion src/audio/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pkgincludeaudio_HEADERS = \
audio.h \
audio_event.h \
audio_event_manager.h \
audio_manager.h \
sound.h

## Main library
Expand All @@ -17,7 +18,8 @@ libadonthell_audio_la_SOURCES = \
audio.cc \
sound.cc \
audio_event.cc \
audio_event_manager.cc
audio_event_manager.cc \
audio_manager.cc

libadonthell_audio_la_CXXFLAGS = $(PY_CFLAGS) -DPKGLIBDIR=\"$(pkglibdir)\" $(AM_CXXFLAGS)
libadonthell_audio_la_LIBADD = $(PY_LIBS) -lltdl -lstdc++ \
Expand Down
1 change: 1 addition & 0 deletions src/audio/audio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ namespace audio
void setup (base::configuration & cfg)
{
// TODO: read options from configuration and use during initialization

}

// shutdown audio
Expand Down
10 changes: 10 additions & 0 deletions src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Add the current directory as include source.
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
)


# Define the Adonthell libraries
set(ADONTHELL_MODULES
audio
)
4 changes: 4 additions & 0 deletions src/test/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -- this order is important, as we build with -no-undefined
SUBDIRS = audio

EXTRA_DIST = CMakeLists.txt
53 changes: 53 additions & 0 deletions src/test/audio/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Define the adonthell_audio_SRCS variable containing all required files.
set(adonthell_audio_SRCS
audio.cc
sound.cc
audio_event.cc
audio_event_manager.cc
audio_manager.cc
)

set(adonthell_audio_HEADERS
audio_event.h
audio_event_manager.h
audio_manager.h
audio.h
sound.h
)

# Add specific include directory for this library.
include_directories(${PYTHON_INCLUDE_PATH})

# Create a shared library
add_library(adonthell_audio SHARED ${adonthell_audio_SRCS})

target_link_libraries(adonthell_audio
${PYTHON_LIBRARIES}
adonthell_base
adonthell_event
)

################################
# Create the SDL Backend
set(audio_sdl_SRCS
sdl/audio_sdl.cc
)

# Add specific include directory for this library.
include_directories(${SDL_INCLUDE_DIR} ${SDLMIXER_INCLUDE_DIR})


add_library(audio-backend-sdl MODULE ${audio_sdl_SRCS})
target_link_libraries(audio-backend-sdl
${SDL_LIBRARY}
${SDLMIXER_LIBRARY}
adonthell_audio
)
set_target_properties(audio-backend-sdl PROPERTIES PREFIX "_" OUTPUT_NAME "sdl")


#############################################
# Install Stuff
adonthell_install_lib(adonthell_audio)
adonthell_install_include(audio "${adonthell_audio_HEADERS}")
adonthell_install_backend(audio audio-backend-sdl)
49 changes: 49 additions & 0 deletions src/test/audio/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
AM_CXXFLAGS = -I$(top_srcdir)/src
DEFAULT_INCLUDES = -I$(srcdir) -I$(top_builddir)
EXTRA_DIST = CMakeLists.txt

## Our header files
pkgincludeaudiodir = $(pkgincludedir)/audio
pkgincludeaudio_HEADERS = \
audio.h \
audio_event.h \
audio_event_manager.h \
audio_manager.h \
sound.h

## Main library
lib_LTLIBRARIES = libadonthell_audio.la

libadonthell_audio_la_SOURCES = \
audio.cc \
sound.cc \
audio_event.cc \
audio_event_manager.cc \
audio_manager.cc

libadonthell_audio_la_CXXFLAGS = $(PY_CFLAGS) -DPKGLIBDIR=\"$(pkglibdir)\" $(AM_CXXFLAGS)
libadonthell_audio_la_LIBADD = $(PY_LIBS) -lltdl -lstdc++ \
-L$(top_builddir)/src/base/ -ladonthell_base \
-L$(top_builddir)/src/event/ -ladonthell_event



###### Following definitions are for the backends
pkglibaudiodir = $(pkglibdir)/audio
pkglibaudio_LTLIBRARIES = _sdl.la

### SDL backend
## Our header files
pkgincludeaudiosdldir = $(pkgincludedir)/audio/sdl

## Rules to build libaudio_sdl
_sdl_la_SOURCES = \
sdl/audio_sdl.cc

_sdl_la_CXXFLAGS = $(SDL_CFLAGS) $(AM_CXXFLAGS)
_sdl_la_LDFLAGS = -avoid-version -module
_sdl_la_LIBADD = $(SDL_LIBS) -lSDL_mixer -ladonthell_audio -lstdc++

## define dependencies in case of parallel build
_sdl_la_DEPENDENCIES = libadonthell_audio.la

0 comments on commit 1a8bf21

Please sign in to comment.