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

Commit

Permalink
Runner is automatically installed to .
Browse files Browse the repository at this point in the history
  • Loading branch information
mkauppila committed Aug 6, 2011
1 parent badc7e0 commit e24f7d7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
6 changes: 4 additions & 2 deletions test/test-automation/Makefile.am
Expand Up @@ -9,8 +9,10 @@ SUBDIRS = src/libtest src/runner \
tests/testrwops \
tests/testrender

all-local: install-tests
install: install-tests
all-local: install
install: install-runner install-tests
install-runner:
$(SHELL) build-scripts/install-runner.sh
install-tests:
$(SHELL) build-scripts/install-tests.sh

Expand Down
8 changes: 8 additions & 0 deletions test/test-automation/build-scripts/install-runner.sh
@@ -0,0 +1,8 @@
#! /bin/bash

#echo "Installing test suites to $DIRECTORY"

cp src/runner/.libs/runner .
chmod u+x runner

echo "Runner installed."
24 changes: 17 additions & 7 deletions test/test-automation/src/runner/runner.c
Expand Up @@ -234,7 +234,7 @@ ScanForTestSuites(char *directoryName, char *extension)

while(entry = readdir(directory)) {
// discards . and .. and hidden files starting with .
if(strlen(entry->d_name) > 2 && entry->d_name[0] != '.') {
if(strlen(entry->d_name) > 2 && entry->d_name[0] != '.' && entry->d_type == DT_REG) {
const char *delimiters = ".";
char *name = strtok(entry->d_name, delimiters);
char *ext = strtok(NULL, delimiters);
Expand Down Expand Up @@ -360,9 +360,14 @@ UnloadTestSuites(TestSuiteReference *suites)
{
TestSuiteReference *ref = suites;
while(ref) {
SDL_free(ref->name);
SDL_free(ref->directoryPath);
SDL_UnloadObject(ref->library);
if(ref->name)
SDL_free(ref->name);

if(ref->directoryPath)
SDL_free(ref->directoryPath);

if(ref->library)
SDL_UnloadObject(ref->library);

TestSuiteReference *temp = ref->next;
SDL_free(ref);
Expand Down Expand Up @@ -480,9 +485,14 @@ UnloadTestCases(TestCase *testCases)
{
TestCase *ref = testCases;
while(ref) {
SDL_free(ref->testName);
SDL_free(ref->suiteName);
SDL_free(ref->description);
if(ref->testName)
SDL_free(ref->testName);

if(ref->suiteName)
SDL_free(ref->suiteName);

if(ref->description)
SDL_free(ref->description);

TestCase *temp = ref->next;
SDL_free(ref);
Expand Down

0 comments on commit e24f7d7

Please sign in to comment.