Changeset 1092
- Timestamp:
- Jun 13, 2010, 1:50:18 AM (13 years ago)
- Location:
- trunk/test
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/Makefile.am
r1091 r1092 70 70 71 71 clean-local: 72 rm -rf generated_output toy_project 72 rm -rf generated_output toy_project testSubDir 73 73 74 74 mostlyclean-local: -
trunk/test/README
r1050 r1092 81 81 present, i.e., the test is expected to fail. 82 82 83 Note that that if tests are initialized correctly using either Suite 84 class (see section C++ tests) or via init.sh (see shell tests) a 85 sub-dir testSubDir/foo is created from which the test is run. 86 83 87 C++ tests 84 88 --------- … … 113 117 Include init.sh, with `. ./init.sh`. 114 118 115 Use variables set in init.sh such as $srcdir, $SVNDIGEST, and $SVN. 119 Use variables set in init.sh such as $srcdir and $abs_top_builddir, and $SVN. 120 121 Do not run svndigest and svncopyright directly, but use functions 122 SVNDIGEST_run and SVNCOPYRIGHT_run. 116 123 117 124 Do not use `exit`, but use functions `exit_fail()`, `exit_skip()`, -
trunk/test/Suite.cc
r1044 r1092 44 44 : ok_(true) 45 45 { 46 chdir(abs_builddir()); 47 std::string test_dir = concatenate_path("testSubDir", file_name(argv[0])); 48 mkdir_p(test_dir); 49 chdir(test_dir); 46 50 if (need_test_repo) { 47 51 bool have_test_repo=false; -
trunk/test/cache_partial_test.cc
r803 r1092 38 38 test::Suite suite(argc, argv, true); 39 39 40 mkdir_p( test::filename("toy_project/.svndigest"));41 std::string root= test::filename("toy_project");40 mkdir_p("toy_project/.svndigest"); 41 std::string root="toy_project"; 42 42 std::string filename = root + "/AUTHORS"; 43 43 suite.out() << "Create SVN instance" << std::endl; -
trunk/test/cmd_format_test.sh
r1023 r1092 25 25 set -e 26 26 27 $mkdir_p $targetdir 28 $SVNDIGEST -f -r $rootdir -t $targetdir --format=banana 2> tmp_stderr && exit_fail 29 test -s tmp_stderr || exit_fail 30 cat tmp_stderr 31 grep 'invalid argument.*banana.*format' tmp_stderr || exit_fail 32 rm -f tmp_stderr 27 SVNDIGEST_run 1 -f --format=banana 28 test -s stderr || exit_fail 29 grep 'invalid argument.*banana.*format' stderr || exit_fail 33 30 34 $SVNDIGEST -g --format=svg --anchor-format=svg > tmp_stdout 35 cat tmp_stdout 36 grep 'format = svg' tmp_stdout || exit_fail 37 grep 'anchor_format = svg' tmp_stdout || exit_fail 38 rm -f tmp_stdout 31 SVNDIGEST_run 0 -g --format=svg --anchor-format=svg 32 grep 'format = svg' stdout || exit_fail 33 grep 'anchor_format = svg' stdout || exit_fail 39 34 40 35 exit_success; -
trunk/test/config2_test.sh
r1017 r1092 27 27 set -e 28 28 29 $SVNDIGEST -g --config-file $srcdir/../.svndigest/config || exit_fail29 SVNDIGEST_run 0 -g --config-file $abs_top_srcdir/.svndigest/config || exit_fail 30 30 31 31 cat > tmp_config <<EOF … … 35 35 EOF 36 36 37 $SVNDIGEST -g --config-file tmp_config 2> tmp_stderr && exit_fail 38 grep 'unknown format.* apple' tmp_stderr || exit_fail39 rm -f tmp_stderr tmp_config 37 SVNDIGEST_run 1 -g --config-file tmp_config 38 grep 'unknown format.* apple' stderr || exit_fail 39 40 40 exit_success -
trunk/test/config3_test.sh
r1091 r1092 26 26 test -e /dev/null || exit_skip 27 27 test -r /dev/null || exit_skip 28 $SVNDIGEST -g --config-file /dev/null || exit_fail 29 $SVNDIGEST -g --config-file . && exit_fail 28 SVNDIGEST_run 0 -g --config-file /dev/null 29 SVNDIGEST_run 1 -g --config-file . 30 grep 'is a directory' stderr || exit_fail 30 31 31 32 exit_success -
trunk/test/copyright2_test.sh
r978 r1092 28 28 set -e 29 29 30 # this test has its own wc since it modifies wc31 rootdir=$abs_builddir/.toy_project232 33 30 rm -rf $rootdir 34 $SVN co ${repo_url}/trunk$rootdir -r 4531 $SVN update $rootdir -r 45 35 32 $SVN update $rootdir/lib 36 33 # cannot use old config file because it's invalid 37 34 $SVN update $rootdir/.svndigest 38 35 39 $SVNDIGEST -r $rootdir --copyright --ignore-cache --no-report || exit_fail 40 41 # remove wc to avoid someone being tempted to modify it 42 rm -rf $rootdir 36 SVNCOPYRIGHT_run 1 -r $rootdir --ignore-cache 43 37 44 38 exit_success; -
trunk/test/copyright_test.cc
r978 r1092 42 42 test::Suite suite(argc, argv, true); 43 43 44 std::string root= test::filename("toy_project");44 std::string root="toy_project"; 45 45 std::string filename = root + "/README"; 46 46 -
trunk/test/init.sh.in
r1045 r1092 42 42 # primary variables - set by config.status 43 43 abs_top_builddir=@abs_top_builddir@ 44 abs_top_srcdir=@abs_top_srcdir@ 44 45 abs_builddir=@abs_builddir@ 45 46 mkdir_p="@MKDIR_P@" … … 49 50 wc_found="@wc_found@" 50 51 51 test -z "$SVNDIGEST" && SVNDIGEST="@top_builddir@/bin/svndigest --verbose"; 52 test -z "$SVNDIGEST" && SVNDIGEST="@abs_top_builddir@/bin/svndigest --verbose"; 53 test -z "$SVNCOPYRIGHT" && SVNCOPYRIGHT="${abs_top_builddir}/bin/svncopyright"; 52 54 test -z "$srcdir" && srcdir="@srcdir@"; 53 55 test -z "$SVN" && SVN=svn; 54 56 55 57 # some helpful derived variables 56 rootdir= $abs_builddir/toy_project58 rootdir=toy_project 57 59 targetdir=$abs_builddir/generated_output 58 60 repo_url="file://$repo" 61 svn_update=${abs_builddir}/svn_update.sh 59 62 60 63 me=$0 64 65 test_dir=`echo $me.dir | sed -e 's,.*[\\/],,'` 66 test_dir="testSubDir/$test_dir" 67 $mkdir_p --verbose $test_dir 68 cd $test_dir 69 70 abs_wcdir=${abs_builddir}/${test_dir}/toy_project 61 71 62 72 for r in : $required; do … … 64 74 repo*) 65 75 if test x$test_repo_found = xyes; then 66 cd $abs_builddir && $shell svn_update.sh || exit 1;76 $shell ${svn_update} || exit_fail; 67 77 else 68 78 exit_skip "no test repository available"; … … 77 87 done 78 88 89 90 foo_run () 91 { 92 expected_exitcode=$1 93 shift 94 exitcode=0 95 $foo_prog ${1+"$@"} > stdout 2>stderr || exitcode=$? 96 cat stderr >&2 97 cat stdout 98 test $exitcode = $expected_exitcode || exit_fail 99 } 100 101 SVNDIGEST_run () 102 { 103 foo_prog="$SVNDIGEST --verbose" 104 foo_run $@ 105 } 106 107 SVNCOPYRIGHT_run () 108 { 109 foo_prog="$SVNCOPYRIGHT" 110 foo_run $@ 111 } 112 113 79 114 echo "=== running $me ===" 80 115 -
trunk/test/repo_test.sh
r1090 r1092 26 26 27 27 $mkdir_p $targetdir 28 $SVNDIGEST -r $rootdir -t $targetdir --ignore-cache --no-report || exit_fail; 28 SVNDIGEST_run 0 -r $rootdir -t $targetdir --ignore-cache --no-report 29 29 30 $SVNDIGEST -r $rootdir -t $targetdir --force || exit_fail; 30 SVNDIGEST_run 0 -r $rootdir -t $targetdir --force 31 31 32 32 exit_success; -
trunk/test/stats_test.cc
r981 r1092 64 64 bool ok=true; 65 65 66 SVN* svn=SVN::instance( test::filename("toy_project"));66 SVN* svn=SVN::instance("toy_project"); 67 67 if (!svn){ 68 68 std::cerr << "error: cannot create SVN instance\n"; … … 91 91 std::string path(void) 92 92 { 93 return test::filename("toy_project/bin/svnstat.cc");93 return "toy_project/bin/svnstat.cc"; 94 94 } 95 95 -
trunk/test/svn_update.sh.in
r978 r1092 23 23 24 24 test -z "$SVN" && SVN=svn 25 rootdir= @abs_builddir@/toy_project25 rootdir=toy_project 26 26 27 27 if test ! -e $rootdir; then 28 28 repo="@abs_test_repo@"; 29 $SVN c o file://$repo/trunk $rootdir > /dev/null;29 $SVN checkout file://$repo/trunk $rootdir; 30 30 fi 31 31 32 $SVN update $rootdir > /dev/null;32 $SVN update $rootdir -
trunk/test/svncopyright_test.sh
r1060 r1092 25 25 26 26 for opt in --version --help; do 27 ../bin/svncopyright$opt > out.tmp 2> error.tmp27 $SVNCOPYRIGHT $opt > out.tmp 2> error.tmp 28 28 test -n "`cat out.tmp`" || exit_fail 29 29 test -z "`cat error.tmp`" || exit_fail … … 31 31 done 32 32 33 ../bin/svncopyright--version | head -n 1 | grep svncopyright || exit_fail33 $SVNCOPYRIGHT --version | head -n 1 | grep svncopyright || exit_fail 34 34 35 35 exit_success -
trunk/test/svndigest_copy_cache_test.sh
r968 r1092 20 20 21 21 required="repo" 22 22 set -x 23 23 . ./init.sh || exit 1 24 24 set -e 25 25 26 26 for opt in --version --help; do 27 ../bin/svndigest-copy-cache $opt > out.tmp 2> error.tmp27 $abs_top_builddir/bin/svndigest-copy-cache $opt > out.tmp 2> error.tmp 28 28 test -n "`cat out.tmp`" || exit_fail 29 29 test -z "`cat error.tmp`" || exit_fail … … 31 31 done 32 32 33 pristine= $abs_builddir/.toy_project233 pristine=fresh_wc 34 34 rm -rf $pristine 35 35 $SVN co ${repo_url}/trunk $pristine
Note: See TracChangeset
for help on using the changeset viewer.