[Fresco-changes] Fresco/Babylon/test framework.cc,NONE,1.1 script.sh,NONE,1.1 Makefile.in,1.3,1.4
Tobias Hunger
tobias at fresco.org
Sat Apr 5 22:37:36 UTC 2003
Update of /cvs/fresco/Fresco/Babylon/test
In directory purcel:/tmp/cvs-serv20721/Babylon/test
Modified Files:
Makefile.in
Added Files:
framework.cc script.sh
Log Message:
Try "make build-tests && make run-tests" in Fresco-Test and Babylon :-)
--- NEW FILE: framework.cc ---
/* $Id: framework.cc,v 1.1 2003/04/05 22:37:34 tobias Exp $
*
* This source file is a part of the Berlin Project.
* Copyright (C) 1999,2000 Tobias Hunger <Tobias at berlin-consortium.org>
* http://www.berlin-consortium.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*/
#include <TestCase.hh>
namespace SyUnit
{
class Framework : public SyUnit::TestCase
{
public:
// Allways pass this test.
void pass()
{
assert_true(true);
}
// Allways fail this test.
void fail()
{
assert_true(false);
}
};
} // namespace
--- NEW FILE: script.sh ---
#!/bin/sh
# This is just a testscript.
if [ $1 = "list" ]; then
echo script_test
exit 0
fi
echo Result: PASSED
exit 0
Index: Makefile.in
===================================================================
RCS file: /cvs/fresco/Fresco/Babylon/test/Makefile.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Makefile.in 4 Apr 2003 22:09:58 -0000 1.3
+++ Makefile.in 5 Apr 2003 22:37:34 -0000 1.4
@@ -32,15 +32,20 @@
CXXFLAGS += $(SO_CXXFLAGS)
LDFLAGS += $(SO_LDFLAGS)
-TESTS := framework.cc
+# All tests ending in .cc will be build, the rest will be run on
+# "make run-tests".
+TESTS := framework.cc script.sh
+CXX_TESTS := $(filter %.cc, $(TESTS))
HDR :=
-SYN := $(patsubst %.cc, %.syn, $(TESTS))
+SYN := $(patsubst %.cc, %.syn, $(CXX_TESTS))
HARNESS := $(patsubst %.syn, %-harness.cxx, $(SYN))
DEP := $(patsubst %.cxx, %.d, $(HARNESS))
OBJ := $(patsubst %.cxx, %.o, $(HARNESS))
-TARGETS := $(patsubst %.cc, %, $(TESTS))
+TARGETS := $(patsubst %.cc, ./%, $(CXX_TESTS))
+SCRIPTS := $(filter-out %.cc, $(TESTS))
+SCRIPT_SOURCES := $(patsubst %, $(srcdir)/%, $(SCRIPTS))
MANUAL := $(docdir)/html
vpath %.hh $(hdir)
@@ -54,8 +59,8 @@
build-tests: $(TARGETS)
-run-tests:
- @echo Running tests...
+run-tests: build-tests $(SCRIPT_SOURCES)
+ LD_LIBRARY_PATH=`$(TEST_CONFIG) --lib-dir`:$(LD_LIBRARY_PATH) `$(TEST_CONFIG) --test-runner` $(TARGETS) $(SCRIPT_SOURCES)
$(TARGETS): $(OBJ)
@echo linking $(@F)
@@ -79,13 +84,13 @@
maintainer-clean: distclean
-$(SYN): $(TESTS)
+$(SYN): $(CXX_TESTS)
@echo generating $(@F)
- $(SYNOPSIS) -pC++ -I$(hdir) -I`$(TEST_CONFIG) --prefix`/include -o $@ $<
+ $(SYNOPSIS) -pC++ -I$(hdir) -I`$(TEST_CONFIG) --include-dir` -o $@ $<
$(HARNESS): $(SYN)
@echo generating test harness for $(@F)
- $(SYN2CC) $< $@
+ `$(TEST_CONFIG) --syn2cc` $< $@
$(DEP): $(HARNESS)
@echo generating dependencies for $(<F)
More information about the Fresco-changes
mailing list