トップ 一覧 検索 ヘルプ RSS ログイン

技術的雑談-Berkeley DBの単体テストを実行するの変更点

  • 追加された行はこのように表示されます。
  • 削除された行はこのように表示されます。
!!!技術的雑談-Berkeley DBの単体テストを実行する

!!環境
*使用環境 : CentOS 5.3 (x86_64) (VMware ESXi 4.0上)
*Berkelery DB : 4.7.25

!!目的
*BDBをビルドした後にBDB自体の単体テストを実行する。
*BDBが正しくコンパイルできたか確認する。

!!手順
configureを--helpで見てみると「--enable-test」というのがある。

 ※BDBのソースtar.gzを展開したディレクトリ内のbuild_unixディレクトリにて
 
 [root@hogehoge build_unix]# pwd
 /usr/local/src/db-4.7.25/build_unix
 [root@hogehoge build_unix]# ../dist/configure --help
 `configure' configures Berkeley DB 4.7.25 to adapt to many kinds of systems.
 
 Usage: ../dist/configure [OPTION]... [VAR=VALUE]...
 
 To assign environment variables (e.g., CC, CFLAGS...), specify them as
 VAR=VALUE.  See below for descriptions of some of the useful variables.
 
 Defaults for the options are specified in brackets.
 
 Configuration:
   -h, --help              display this help and exit
       --help=short        display options specific to this package
       --help=recursive    display the short help of all the included packages
   -V, --version           display version information and exit
   -q, --quiet, --silent   do not print `checking...' messages
       --cache-file=FILE   cache test results in FILE [disabled]
   -C, --config-cache      alias for `--cache-file=config.cache'
   -n, --no-create         do not create output files
       --srcdir=DIR        find the sources in DIR [configure dir or `..']
 
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
                           [/usr/local/BerkeleyDB.4.7]
   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                           [PREFIX]
 
 By default, `make install' will install all the files in
 `/usr/local/BerkeleyDB.4.7/bin', `/usr/local/BerkeleyDB.4.7/lib' etc.  You can specify
 an installation prefix other than `/usr/local/BerkeleyDB.4.7' using `--prefix',
 for instance `--prefix=$HOME'.
 
 For better control, use the options below.
 
 Fine tuning of the installation directories:
   --bindir=DIR           user executables [EPREFIX/bin]
   --sbindir=DIR          system admin executables [EPREFIX/sbin]
   --libexecdir=DIR       program executables [EPREFIX/libexec]
   --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
   --libdir=DIR           object code libraries [EPREFIX/lib]
   --includedir=DIR       C header files [PREFIX/include]
   --oldincludedir=DIR    C header files for non-gcc [/usr/include]
   --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
   --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
   --infodir=DIR          info documentation [DATAROOTDIR/info]
   --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
   --mandir=DIR           man documentation [DATAROOTDIR/man]
   --docdir=DIR           documentation root [DATAROOTDIR/doc/db-4.7.25]
   --htmldir=DIR          html documentation [DOCDIR]
   --dvidir=DIR           dvi documentation [DOCDIR]
   --pdfdir=DIR           pdf documentation [DOCDIR]
   --psdir=DIR            ps documentation [DOCDIR]
 
 Program names:
   --program-prefix=PREFIX            prepend PREFIX to installed program names
   --program-suffix=SUFFIX            append SUFFIX to installed program names
   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
 
 System types:
   --build=BUILD     configure for building on BUILD [guessed]
   --host=HOST       cross-compile to build programs to run on HOST [BUILD]
 
 Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --disable-bigfile       Obsolete; use --disable-largefile instead.
   --disable-cryptography  Do not build database cryptography support.
   --disable-hash          Do not build Hash access method.
   --disable-mutexsupport  Do not build any mutex support.
   --disable-queue         Do not build Queue access method.
   --disable-replication   Do not build database replication support.
   --disable-statistics    Do not build statistics support.
   --disable-verify        Do not build database verification support.
   --enable-compat185      Build DB 1.85 compatibility API.
   --enable-cxx            Build C++ API.
   --enable-debug          Build a debugging version.
   --enable-debug_rop      Build a version that logs read operations.
   --enable-debug_wop      Build a version that logs write operations.
   --enable-diagnostic     Build a version with run-time diagnostics.
   --enable-dump185        Build db_dump185(1) to dump 1.85 databases.
   --enable-java           Build Java API.
   --enable-mingw          Build Berkeley DB for MinGW.
   --enable-o_direct       Enable the O_DIRECT flag for direct I/O.
   --enable-posixmutexes   Force use of POSIX standard mutexes.
   --enable-pthread_self   Obsolete; use --enable-pthread_api instead.
   --enable-pthread_api    Configure Berkeley DB for POSIX pthread API.
   --enable-rpc            Build RPC client/server.
   --enable-smallbuild     Build small footprint version of the library.
   --enable-tcl            Build Tcl API.
   --enable-test           Configure to run the test suite.
   --enable-uimutexes      Force use of Unix International mutexes.
   --enable-umrw           Mask harmless uninitialized memory read/writes.
   --enable-shared[=PKGS]  build shared libraries [default=yes]
   --enable-static[=PKGS]  build static libraries [default=yes]
   --enable-fast-install[=PKGS]
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
   --disable-largefile     omit support for large files
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-mutex=MUTEX      Select non-default mutex implementation.
   --with-mutexalign=ALIGNMENT
                           Obsolete; use DbEnv::mutex_set_align instead.
   --with-tcl=DIR          Directory location of tclConfig.sh.
   --with-uniquename=NAME  Build a uniquely named library.
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-pic              try to use only PIC/non-PIC objects [default=use
                           both]
   --with-tags[=TAGS]      include additional configurations [automatic]
 
 Some influential environment variables:
   CC          C compiler command
   CFLAGS      C compiler flags
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
   LIBS        libraries to pass to the linker, e.g. -l<library>
   CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
   CXXCPP      C++ preprocessor
   CPP         C preprocessor
   F77         Fortran 77 compiler command
   FFLAGS      Fortran 77 compiler flags
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
 Report bugs to <Oracle Technology Network Berkeley DB forum>.

BDBの単体テストを実行できるようにするためにはconfigureで、
+ --enable-testが有効になっている事」
+ --with-tclでtclConfig.shのディレクトリを指定してある事
+ (tclがインストールされている事)
が必要ならしい。

CentOSの場合、tcl自体はデフォルトで入っているようだが、tcl-develが入っていないとtclConfig.shが無い。
そんなわけでrpmなどでtcl-develパッケージも入れておく事。

configureが成功したらmakeしておく。

単体テストのやり方は、実はOracleのHPに書いてある。
(http://www.oracle.com/technology/documentation/berkeley-db/db/programmer_reference/test.html#test_run)
が、見つけるのが意外と大変だった…。

大雑把に言うと、
+ build_unixディレクトリでmakeが終わった後に、そこからtclshを実行する。
+ source ../test/test.tclを実行。(HPのパスは間違い!)
+ run_stdかrun_allを実行する
でテストスクリプトが走らせられる。

結構時間とメモリ食うので貧弱な本番環境で実行するのはオススメできない。

(ってか、いつの間にBDBはトランザクションとかレプリケーションとかサポートするようになっちゃったの?!)

HPにも「several hoursからdayかかるよ〜」と言われているので、実際とっても時間がかかる。
会社から帰る前にrun_stdしておいて翌朝に見るのが正解?

なお、何のテストをやっているのかは大雑把に表示してくれるが大雑把過ぎて寂しい人は、
 tail -f ./ALL.OUT &
しておくと単体テストが行われているのを眺める事ができる。
「FAIL」で始まる行があった場合、何らかしらのテストが失敗している。
!!履歴
2010/4/19 -- 初版

[[技術的雑談]]へ戻る

!!突っ込み

::オープンしました - さくら (2012年06月02日 03時19分12秒)
:::  セクロスしたい女たちはココ!d(´∀`*) http://sns.44m4.net/

{{comment multi}}

[[技術的雑談]]へ戻る

{{trackback}}

[[技術的雑談]]へ戻る