Some changes in the new build system

Added a global "run" target as well as individual "run_$name_of_test"
targets for each test. If you use the "run" target, please always call
it with -j1.

For building, make's -j option should better be set using the MAKEFLAGS
environment variable.
This commit is contained in:
Tillmann Karras
2014-07-20 03:11:11 +02:00
parent 9a99fdc681
commit c151ad018e
6 changed files with 31 additions and 27 deletions

5
.gitignore vendored
View File

@@ -1,4 +1 @@
cputest/build/
gxtest/build/
*.dol
*.elf
build/

View File

@@ -1,11 +1,9 @@
cmake_minimum_required(VERSION 2.6)
project(gxtest)
project(hwtests)
message(STATUS "Using toolchain file " ${CMAKE_TOOLCHAIN_FILE})
INCLUDE(CMakeForceCompiler) # TODO: Not sure if this is necessary
add_definitions(-std=c++11)
include_directories(${LIBOGCDIR}/include)
@@ -16,9 +14,14 @@ set(MACHDEP "-DGEKKO -mrvl -mcpu=750 -meabi -mhard-float")
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${MACHDEP}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MACHDEP}")
add_custom_target(run)
function(add_hwtest module testname filelist)
add_executable(${module}_${testname} ${filelist} ${COMMON_CODE})
target_link_libraries(${module}_${testname} wiiuse bte fat ogc m)
add_custom_target(run_${module}_${testname} sh ${CMAKE_SOURCE_DIR}/run.sh ${module}_${testname})
add_dependencies(run_${module}_${testname} ${module}_${testname})
add_dependencies(run run_${module}_${testname})
endfunction()
add_subdirectory(cputest)

View File

@@ -1,11 +0,0 @@
SUBDIRS:= `ls | egrep -v '^(CVS)$$'`
DATESTRING := $(shell date +%Y)$(shell date +%m)$(shell date +%d)
all:
@for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i || { exit 1;} fi; done;
clean:
@rm -f *.bz2
@for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i clean || { exit 1;} fi; done;

View File

@@ -1,11 +1,22 @@
# Test suite for the GameCube/Wii hardware
This requires devkitPPC and libogc to build. Released under GPLv2.
Released under GPLv2.
## Requirements:
- CMake
- devkitPPC
- libogc (if not installed into ${DEVKITPRO}/libogc, a CMake variable called LIBOGCDIR needs to be specified)
- DEVKITPRO and DEVKITPRO environment variables (see devkitPPC documentation)
To use the run_* CMake targets:
- netcat
- WIILOAD environment variable with the IP address of your Wii, e.g., `export WIILOAD=tcp:192.168.0.124`
## Usage:
To build all tests, call `sh build.sh` from the root directory. This requires CMake to be installed on your system and the DEVKITPRO and DEVKITPRO environment variables to be defined on your system. Additionally, if libogc is not installed to ${DEVKITPRO}/libogc, a CMake variable called LIBOGCDIR needs to be specified.
To build all tests, call `./build.sh` from the root directory.
You can send an individual test elf over network to a Wii running the Homebrew Channel by calling `make && make run` from the subdirectory. This requires the `wiiload` executable to be located in your system binary paths and the `WIILOAD` environment variable to hold the IP address of your Wii, e.g. `export WIILOAD=tcp:192.168.0.124`.
Tests are run by sending their ELFs one-by-one over the network to a Wii running the Homebrew Channel. To do this, call `make run_$NAMEOFTEST` from the build directory.
Test results are transfered via network over port 16784 and can e.g. be retrieved using `netcat 192.168.0.124 16784`.
To run all tests, call `make -j1 run` from the build directory. Note that there are some very slow tests.

8
build.sh Normal file → Executable file
View File

@@ -1,8 +1,6 @@
if [ ! -d build ]; then
mkdir build
fi
#!/bin/sh
mkdir -p build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain-powerpc.cmake ..
make -j2
cd ..
make

6
run.sh Normal file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
"$DEVKITPPC/bin/wiiload" "$1"
# empiric value, no idea if this differs for large executables
sleep 2
netcat ${WIILOAD#tcp:} 16784