--- /dev/null
+############################################################
+# $Id$
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+############################################################
+
+############################################################
+# Include general settings for including DEAL libraries
+############################################################
+
+include ../Makefile.paths
+include $D/common/Make.global_options
+
+
+default: run-tests
+
+############################################################
+# rules to generate the threading tests. the .cc files are
+# automatically generated; note that for the output generation, we
+# have to sort the output since otherwise in MT mode things would come
+# out in a random order. the same holds for a few other tests
+threads_01.cc : threads.pl
+ @echo =====regenerating== $@
+ @$(PERL) $^ > $@
+
+threads_02.cc : threads_01.cc
+ @echo =====regenerating== $@
+ @cat $^ \
+ | $(PERL) -pi -e 's/spawn \((.*), (.*)\) \(/new_thread (\2, \1, /g;' \
+ | $(PERL) -pi -e 's/(new_thread.*), \)/\1)/g;' \
+ | $(PERL) -pi -e 's/threads_01/threads_02/g;' \
+ > $@
+
+threads_%/output : threads_%/exe
+ @echo =====Running======= $<
+ @echo Running > $(dir $@)/status
+ @$(ULIMIT) -t 2400 ; ./$< ; \
+ if test ! $$? = 0 ; then rm $@ ; false ; fi
+ @perl -pi $(normalize) $@
+ @sort $@ -o $@
+
+thread_validity_07/output : thread_validity_07/exe
+ @echo =====Running======= $<
+ @echo Running > $(dir $@)/status
+ @$(ULIMIT) -t 2400 ; ./$< ; \
+ if test ! $$? = 0 ; then rm $@ ; false ; fi
+ @perl -pi $(normalize) $@
+ @sort $@ -o $@
+
+task_%/output : task_%/exe
+ @echo =====Running======= $<
+ @echo Running > $(dir $@)/status
+ @$(ULIMIT) -t 2400 ; ./$< ; \
+ if test ! $$? = 0 ; then rm $@ ; false ; fi
+ @perl -pi $(normalize) $@
+ @sort $@ -o $@
+
+
+############################################################
+
+# all .cc-files are tests, though the test bdm.cc appears to be dysfunctional
+# and we don't want the data_out_base_tecplot_bin test if we haven't found the
+# corresponding libraries:
+ifeq (, $(findstring tecio, $LIBS))
+ tests = $(filter-out data_out_base_tecplot_bin, $(basename $(wildcard *.cc)))
+else
+ tests = $(basename $(wildcard *.cc))
+endif
+
+# add threading tests. note that we have
+# to list them individually, without wildcards, because the .cc files are
+# generated and don't exist yet (so wildcard expansion will fail)
+tests += threads_01 threads_02
+
+
+############################################################
+
+
+include ../Makefile.rules
+include Makefile.depend
+include Makefile.tests
--- /dev/null
+//---------------------------- tensor_base.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- tensor_base.cc ---------------------------
+
+// check serialization for Tensor<1,dim>
+
+#include "../tests.h"
+#include <base/tensor.h>
+#include <base/logstream.h>
+#include <boost/archive/text_oarchive.hpp>
+#include <boost/archive/text_iarchive.hpp>
+#include <sstream>
+#include <fstream>
+#include <iomanip>
+
+
+template <typename T>
+void verify (const T &t1,
+ const T &t2)
+{
+ // save data to archive
+ std::ostringstream oss;
+ {
+ boost::archive::text_oarchive oa(oss);
+ oa << t1;
+ // archive and stream closed when
+ // destructors are called
+ }
+ deallog << oss.str() << std::endl;
+
+ // verify correctness of the
+ // serialization
+ {
+ std::istringstream iss(oss.str());
+ boost::archive::text_iarchive ia(iss);
+
+
+ ia >> t2;
+
+ Assert (t1 == t2, ExcInternalError());
+ }
+}
+
+
+void test ()
+{
+ const unsigned int dim=3;
+
+ double a1[3] = {1, 2, 3};
+ Tensor<1,dim> t1(a1);
+
+ double a2[3] = {3, 6, 9};
+ Tensor<1,dim> t2 (a2);
+
+ verify (t1, t2);
+}
+
+
+int main ()
+{
+ std::ofstream logfile("tensor_base/output");
+ deallog << std::setprecision(3);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test ();
+
+ deallog << "OK" << std::endl;
+}