Tests: add skeleton for new services kits tests
Change-Id: I759c6b91d3bf856dbbe8b8b6112d53e601798abf
This commit is contained in:
@@ -12,5 +12,6 @@ SimpleTest wlan_test : wlan_test.cpp : $(TARGET_NETWORK_LIBS) bnetapi be ;
|
|||||||
|
|
||||||
SubInclude HAIKU_TOP src tests kits net cookie ;
|
SubInclude HAIKU_TOP src tests kits net cookie ;
|
||||||
HaikuSubInclude libnetapi ;
|
HaikuSubInclude libnetapi ;
|
||||||
|
SubInclude HAIKU_TOP src tests kits net netservices2 ;
|
||||||
SubInclude HAIKU_TOP src tests kits net service ;
|
SubInclude HAIKU_TOP src tests kits net service ;
|
||||||
SubInclude HAIKU_TOP src tests kits net urlRequest ;
|
SubInclude HAIKU_TOP src tests kits net urlRequest ;
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 Haiku Inc. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Niels Sascha Reedijk, [email protected]
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "HttpTest.h"
|
||||||
|
|
||||||
|
#include <cppunit/TestSuite.h>
|
||||||
|
|
||||||
|
using BPrivate::Network::BHttpSession;
|
||||||
|
|
||||||
|
|
||||||
|
HttpTest::HttpTest(BHttpSession& session)
|
||||||
|
:fSession(session)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* static */ void
|
||||||
|
HttpTest::AddTests(BTestSuite& parent)
|
||||||
|
{
|
||||||
|
CppUnit::TestSuite& suite = *new CppUnit::TestSuite("HttpTest");
|
||||||
|
|
||||||
|
BHttpSession session;
|
||||||
|
|
||||||
|
HttpTest* httpTest = new HttpTest(session);
|
||||||
|
// leak for now
|
||||||
|
parent.addTest("HttpTest", &suite);
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 Haiku, inc.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
#ifndef HTTP_TEST_H
|
||||||
|
#define HTTP_TEST_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <HttpSession.h>
|
||||||
|
#include <TestCase.h>
|
||||||
|
#include <TestSuite.h>
|
||||||
|
|
||||||
|
using BPrivate::Network::BHttpSession;
|
||||||
|
|
||||||
|
|
||||||
|
class HttpTest: public BTestCase {
|
||||||
|
public:
|
||||||
|
HttpTest(BHttpSession& session);
|
||||||
|
|
||||||
|
static void AddTests(BTestSuite& suite);
|
||||||
|
|
||||||
|
private:
|
||||||
|
BHttpSession fSession;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
SubDir HAIKU_TOP src tests kits net netservices2 ;
|
||||||
|
|
||||||
|
if $(TARGET_PACKAGING_ARCH) != x86_gcc2 {
|
||||||
|
# do not target the legacy platform
|
||||||
|
UsePrivateHeaders netservices2 ;
|
||||||
|
|
||||||
|
UnitTestLib netservicekit2test.so :
|
||||||
|
ServicesKitTestAddon.cpp
|
||||||
|
|
||||||
|
HttpTest.cpp
|
||||||
|
|
||||||
|
: be libnetservices2.a $(TARGET_NETWORK_LIBS) $(HAIKU_NETAPI_LIB)
|
||||||
|
[ TargetLibstdc++ ]
|
||||||
|
;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2021 Haiku, Inc.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <TestSuite.h>
|
||||||
|
#include <TestSuiteAddon.h>
|
||||||
|
|
||||||
|
#include "HttpTest.h"
|
||||||
|
|
||||||
|
|
||||||
|
BTestSuite*
|
||||||
|
getTestSuite()
|
||||||
|
{
|
||||||
|
BTestSuite* suite = new BTestSuite("NetServices2Kit");
|
||||||
|
|
||||||
|
HttpTest::AddTests(*suite);
|
||||||
|
|
||||||
|
return suite;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user