]> git.saurik.com Git - wxWidgets.git/blame - tests/archive/tartest.cpp
Include compilation of tests for OpenVMS (part1)
[wxWidgets.git] / tests / archive / tartest.cpp
CommitLineData
cdd7933f
MW
1///////////////////////////////////////////////////////////////////////////////
2// Name: tests/tartest.cpp
3// Purpose: Test the tar classes
4// Author: Mike Wetherell
5// RCS-ID: $Id$
6// Copyright: (c) 2004 Mike Wetherell
7// Licence: wxWindows licence
8///////////////////////////////////////////////////////////////////////////////
9
10#include "testprec.h"
11
12#ifdef __BORLANDC__
13# pragma hdrstop
14#endif
15
16#ifndef WX_PRECOMP
17# include "wx/wx.h"
18#endif
19
20#if wxUSE_STREAMS
21
22#include "archivetest.h"
23#include "wx/tarstrm.h"
24
25using std::string;
26
27
28///////////////////////////////////////////////////////////////////////////////
29// Tar suite
30
31class tartest : public ArchiveTestSuite
32{
33public:
34 tartest();
35 static CppUnit::Test *suite() { return (new tartest)->makeSuite(); }
36
37protected:
38 CppUnit::Test *makeTest(string descr, int options,
39 bool genericInterface,
40 const wxString& archiver,
41 const wxString& unarchiver);
42};
43
44tartest::tartest()
45 : ArchiveTestSuite("tar")
46{
9a83f860
VZ
47 AddArchiver(wxT("tar cf %s *"));
48 AddUnArchiver(wxT("tar xf %s"));
cdd7933f
MW
49}
50
51CppUnit::Test *tartest::makeTest(
52 string descr,
53 int options,
54 bool genericInterface,
55 const wxString& archiver,
56 const wxString& unarchiver)
57{
58 if ((options & Stub) && (options & PipeIn) == 0)
59 return NULL;
60
61 if (genericInterface)
895cae46 62 {
cdd7933f
MW
63 return new ArchiveTestCase<wxArchiveClassFactory>(
64 descr, new wxTarClassFactory,
65 options, archiver, unarchiver);
895cae46
VZ
66 }
67
68 return new ArchiveTestCase<wxTarClassFactory>(
69 descr, new wxTarClassFactory,
70 options, archiver, unarchiver);
cdd7933f
MW
71}
72
73CPPUNIT_TEST_SUITE_REGISTRATION(tartest);
74CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(tartest, "archive");
75CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(tartest, "archive/tar");
76
77#endif // wxUSE_STREAMS