From 150f14d0ead73e88884a2faa6aab5e4103d967dc Mon Sep 17 00:00:00 2001 From: Alexander Afanasyev Date: Mon, 5 Mar 2012 21:24:49 -0800 Subject: [PATCH] Small reorganization of unit tests --- test/test.cc | 25 ++++++++++++++++++ test/{testapp.cc => test_digest.cc} | 12 --------- test/test_leaf.cc | 41 +++++++++++++++++++++++++++++ wscript | 7 +++-- 4 files changed, 71 insertions(+), 14 deletions(-) create mode 100644 test/test.cc rename test/{testapp.cc => test_digest.cc} (91%) create mode 100644 test/test_leaf.cc diff --git a/test/test.cc b/test/test.cc new file mode 100644 index 0000000..55745d9 --- /dev/null +++ b/test/test.cc @@ -0,0 +1,25 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2012 University of California, Los Angeles + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Zhenkai Zhu + * 卞超轶 Chaoyi Bian + * Alexander Afanasyev + */ + +#define BOOST_TEST_MODULE Digest +#include + diff --git a/test/testapp.cc b/test/test_digest.cc similarity index 91% rename from test/testapp.cc rename to test/test_digest.cc index 33cb154..a1ae6a3 100644 --- a/test/testapp.cc +++ b/test/test_digest.cc @@ -20,13 +20,11 @@ * Alexander Afanasyev */ -#define BOOST_TEST_MODULE Digest #include #include using boost::test_tools::output_test_stream; #include "../model/sync-digest.h" -#include #include #include @@ -99,13 +97,3 @@ BOOST_AUTO_TEST_CASE (DigestComparison) BOOST_AUTO_TEST_SUITE_END() -////////////////////////////////////////////////////////////////////////////////////////// - -BOOST_AUTO_TEST_SUITE(LeafTestSuite) - -BOOST_AUTO_TEST_CASE (LeafBase) -{ - Leaf test; -} - -BOOST_AUTO_TEST_SUITE_END() diff --git a/test/test_leaf.cc b/test/test_leaf.cc new file mode 100644 index 0000000..7c6095a --- /dev/null +++ b/test/test_leaf.cc @@ -0,0 +1,41 @@ +/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2012 University of California, Los Angeles + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation; + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Zhenkai Zhu + * 卞超轶 Chaoyi Bian + * Alexander Afanasyev + */ + +#include +#include +using boost::test_tools::output_test_stream; + +#include "../model/sync-full-leaf.h" +#include "../model/sync-diff-leaf.h" + +using namespace Sync; +using namespace std; +using namespace boost; + +BOOST_AUTO_TEST_SUITE(LeafTestSuite) + +BOOST_AUTO_TEST_CASE (LeafBase) +{ + // Leaf test; +} + +BOOST_AUTO_TEST_SUITE_END() diff --git a/wscript b/wscript index 078a9bf..b5e60a8 100644 --- a/wscript +++ b/wscript @@ -29,11 +29,14 @@ def build (bld): uselib = 'BOOST BOOST_IOSTREAMS SSL' ) - bld.program (target="testapp", - source = "test/testapp.cc", + # Unit tests + bld.program (target="utit-tests", + source = bld.path.ant_glob(['test/**/*.cc']), features=['cxx', 'cxxprogram'], use = 'BOOST_TEST sync') + +# doxygen docs from waflib.Build import BuildContext class doxy (BuildContext): cmd = "doxygen"