Runner is automatically installed to .
authorMarkus Kauppila <markus.kauppila@gmail.com>
Sat, 06 Aug 2011 18:00:10 +0300
changeset 5805 df2097bab7ee
parent 5804 d82711e39c05
child 5806 c42284b8a4f9
Runner is automatically installed to .
test/test-automation/Makefile.am
test/test-automation/build-scripts/install-runner.sh
test/test-automation/src/runner/runner.c
--- a/test/test-automation/Makefile.am	Sat Aug 06 17:35:58 2011 +0300
+++ b/test/test-automation/Makefile.am	Sat Aug 06 18:00:10 2011 +0300
@@ -9,8 +9,10 @@
 		  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
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/test-automation/build-scripts/install-runner.sh	Sat Aug 06 18:00:10 2011 +0300
@@ -0,0 +1,8 @@
+#! /bin/bash
+
+#echo "Installing test suites to $DIRECTORY" 
+
+cp src/runner/.libs/runner .
+chmod u+x runner
+
+echo "Runner installed."
--- a/test/test-automation/src/runner/runner.c	Sat Aug 06 17:35:58 2011 +0300
+++ b/test/test-automation/src/runner/runner.c	Sat Aug 06 18:00:10 2011 +0300
@@ -234,7 +234,7 @@
 
 	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);
@@ -360,9 +360,14 @@
 {
 	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);
@@ -480,9 +485,14 @@
 {
 	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);