2007-06-01から1ヶ月間の記事一覧

SCons 疑問

次がうまく動作しない. $ ls SConstruct src/ $ ls src SConscript hello.c $ cat SConstruct SConscript('src/SConscript', build_dir = '../build') $ cat src/SConscript Program('hello', ['hello.c']) $ scons -Q scons: `.' is up to date. 以下のよ…

SCons 最初の一歩

Makefile ファイルにあたるのは SConstruct ファイル.中身は python のプログラム. 参照 SCons User Guide 0.97, Simple Builds hello world SConstruct: Program('hello', 'hello.c') そして, $ sconsとすると,Linux では hello ができ,Windows では h…

vim で新しい filetype 判定を追加する

vim

~/.vim/filetype.vim を作成する. if exists("did_load_filetypes") finish endif augroup filetypedetect au! BufNewFile,BufRead SConstruct setfiletype python augroup END 参考 vim で :help new-filetype

CppUnit

CppUnit の使い方 #include <cppunit/extensions/HelperMacros.h> #include <cppunit/ui/text/TestRunner.h> class TestSimple : public CPPUNIT_NS::TestFixture { CPPUNIT_TEST_SUITE(TestSimple); CPPUNIT_TEST(testTest); CPPUNIT_TEST_SUITE_END(); public: void testTest(); }; void TestSimple::testTest() { CPPUNIT_AS…</cppunit/ui/text/testrunner.h></cppunit/extensions/helpermacros.h>

CUnit

CUnit の使い方 #include <CUnit/CUnit.h> #include <CUnit/Basic.h> void test_sample(void) { CU_ASSERT_EQUAL(1, 1); } static CU_TestInfo g_test_suite[] = { { "test_sample", test_sample }, CU_TEST_INFO_NULL, }; static CU_SuiteInfo g_suite[] = { { "test_suite", 0, 0, g_test</cunit/basic.h></cunit/cunit.h>…

debian の perl で css セレクタ経由の xpath を使うための準備

$ sudo apt-get install libtest-pod-coverage-perl libtest-pod-perl (+ libpod-coverage-perl libio-stringy-perl) $ tar xf XML-XPathEngine-0.08.tar.gz $ cd XML-XPathEngine-0.08 $ perl Makefile.PL PREFIX=~/lhs $ make && make test && make instal…

vim のキーバインディングの一覧

vim

:help *normal-index* :map

perl の Makefile.PL

$ perl Makefile.PL PREFIX=~/local

perl の LWP

SSL で接続するためには Net::SSL が必要,debian なら $ apt-get install libcrypt-ssleay-perl 参照 perldoc lwptut perldoc LWP perldoc LWP::UserAgent perldoc HTTP::Response perldoc HTTP::Message perldoc HTTP::Headers

perl のユニットテスト

参照 perldoc Test::Unit::TestCase

perl のモジュールパス

現在のサーチパスを表示する. $ perl -e 'print join " ", @INC;' スクリプトにサーチパスを設定 use lib 'perllib'; # スクリプトファイルがあるディレクトリ相対 use My::Perl::Lib; 環境変数で設定 export PERL5LIB=~/perllib いずれも @INC の先頭に追…

perl の Test モジュール

use Test::Simple test => 3; ok(...); ok(...); ok(...); use Test::More test => 3; # or use Test::More 'no_plan'; ok($this eq $that, $test_name); is($this, $that, $test_name); isa_ok($object, $class); SKIP, TODO 参照 perldoc Test::Tutorial p…