~ubuntu-branches/ubuntu/vivid/samba/vivid

« back to all changes in this revision

Viewing changes to lib/subunit/c++/SubunitTestProgressListener.cpp

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-12-21 13:18:04 UTC
  • mfrom: (0.39.21 sid)
  • Revision ID: package-import@ubuntu.com-20111221131804-xtlr39wx6njehxxr
Tags: 2:3.6.1-3ubuntu1
* Merge from Debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/patches/error-trans.fix-276472:
    - Add the translation of Unix Error code -ENOTSUP to NT Error Code
    - NT_STATUS_NOT_SUPPORTED to prevent the Permission denied error.
  + debian/smb.conf:
    - add "(Samba, Ubuntu)" to server string.
    - comment out the default [homes] share, and add a comment about
      "valid users = %S" to show users how to restrict access to
      \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are 
      allowed to create public shares in addition to authenticated
      ones.
    - add map to guest = Bad user, maps bad username to guest access.
  + debian/samba-common.config:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/control:
    - Don't build against or suggest ctdb.
    - Add dependency on samba-common-bin to samba.
  + Add ufw integration:
    - Created debian/samba.ufw.profile
    - debian/rules, debian/samba.dirs, debian/samba.files: install
      profile
    - debian/control: have samba suggest ufw
  + Add apport hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + Switch to upstart:
    - Add debian/samba.{nmbd,smbd}.upstart.
  + debian/samba.logrotate, debian/samba-common.dhcp, debian/samba.if-up:
    - Make them upstart compatible
  + debian/samba.postinst: 
    - Avoid scary pdbedit warnings on first import.
  + debian/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted
  + debian/patches/fix-debuglevel-name-conflict.patch: don't use 'debug_level'
    as a global variable name in an NSS module 
  + Dropped:
    - debian/patches/error-trans.fix-276472
    - debian/patches/fix-debuglevel-name-conflict.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  Subunit test listener for cppunit (http://cppunit.sourceforge.net).
 
2
 *  Copyright (C) 2006  Robert Collins <robertc@robertcollins.net>
 
3
 *
 
4
 *  Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
 
5
 *  license at the users choice. A copy of both licenses are available in the
 
6
 *  project source as Apache-2.0 and BSD. You may not use this file except in
 
7
 *  compliance with one of these two licences.
 
8
 *  
 
9
 *  Unless required by applicable law or agreed to in writing, software
 
10
 *  distributed under these licenses is distributed on an "AS IS" BASIS,
 
11
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
12
 *  See the license you chose for the specific language governing permissions
 
13
 *  and limitations under that license.
 
14
 */
 
15
 
 
16
#include <cppunit/Exception.h>
 
17
#include <cppunit/Test.h>
 
18
#include <cppunit/TestFailure.h>
 
19
#include <cppunit/TextOutputter.h>
 
20
#include <iostream>
 
21
 
 
22
// Have to be able to import the public interface without config.h.
 
23
#include "SubunitTestProgressListener.h"
 
24
#include "config.h"
 
25
#include "subunit/child.h"
 
26
 
 
27
 
 
28
CPPUNIT_NS_BEGIN
 
29
 
 
30
 
 
31
void 
 
32
SubunitTestProgressListener::startTest( Test *test )
 
33
{
 
34
  subunit_test_start(test->getName().c_str());
 
35
  last_test_failed = false;
 
36
}
 
37
 
 
38
void 
 
39
SubunitTestProgressListener::addFailure( const TestFailure &failure )
 
40
{
 
41
  std::ostringstream capture_stream;
 
42
  TextOutputter outputter(NULL, capture_stream);
 
43
  outputter.printFailureLocation(failure.sourceLine());
 
44
  outputter.printFailureDetail(failure.thrownException());
 
45
 
 
46
  if (failure.isError())
 
47
      subunit_test_error(failure.failedTestName().c_str(),
 
48
                         capture_stream.str().c_str());
 
49
  else
 
50
      subunit_test_fail(failure.failedTestName().c_str(),
 
51
                        capture_stream.str().c_str());
 
52
  last_test_failed = true;
 
53
}
 
54
 
 
55
void 
 
56
SubunitTestProgressListener::endTest( Test *test)
 
57
{
 
58
  if (!last_test_failed)
 
59
      subunit_test_pass(test->getName().c_str());
 
60
}
 
61
 
 
62
 
 
63
CPPUNIT_NS_END