[haiku-development] Re: How to add a build target?

  • From: "Lee Mon" <strongleemon@xxxxxxxxxx>
  • To: pulkomandy@xxxxxxxxxxxxx
  • Date: Thu, 21 Mar 2019 20:40:31 +0300

This is my diff (I am not sure what is the right way of showing code):
diff --git a/src/tests/kits/Jamfile b/src/tests/kits/Jamfile
index d1739a8e8a..49ba89de1e 100644
--- a/src/tests/kits/Jamfile
+++ b/src/tests/kits/Jamfile
@@ -1,6 +1,7 @@
SubDir HAIKU_TOP src tests kits ;

SubInclude HAIKU_TOP src tests kits app ;
+SubInclude HAIKU_TOP src tests kits crypto ;
SubInclude HAIKU_TOP src tests kits device ;
SubInclude HAIKU_TOP src tests kits game ;
SubInclude HAIKU_TOP src tests kits interface ;
diff --git a/src/tests/kits/crypto/HashValidityTest.cpp
b/src/tests/kits/crypto/HashValidityTest.cpp
new file mode 100644
index 0000000000..3eb0e14140
--- /dev/null
+++ b/src/tests/kits/crypto/HashValidityTest.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2019, Haiku, Inc.
+ * Distributed under the terms of the MIT License.
+ */
+
+
+#include "HashValidityTest.h"
+
+#include <cppunit/TestCaller.h>
+#include <cppunit/TestSuite.h>
+
+HashValidityTest::HashValidityTest()
+{
+}
+
+
+HashValidityTest::~HashValidityTest()
+{
+}
+
+
+void
+HashValidityTest::TestSetters()
+{
+ NextSubTest();
+ CPPUNIT_ASSERT_EQUAL("a", "a");
+}
+
+
+/*static*/
+void
+HashValidityTest::AddTests(BTestSuite& parent)
+{
+ CppUnit::TestSuite& suite = *new CppUnit::TestSuite("HashValidityTest");
+
+ suite.addTest(new CppUnit::TestCaller<HashValidityTest>(
+ "HashValidityTest::TestSetters", &HashValidityTest::TestSetters));
+
+ parent.addTest("HashValidityTest", &suite);
+}
+
diff --git a/src/tests/kits/crypto/HashValidityTest.h
b/src/tests/kits/crypto/HashValidityTest.h
new file mode 100644
index 0000000000..c5a89a73ee
--- /dev/null
+++ b/src/tests/kits/crypto/HashValidityTest.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2019, Haiku, Inc.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef HASHVALIDITYTEST_H
+#define HASHVALIDITYTEST_H
+
+
+#include <TestCase.h>
+#include <TestSuite.h>
+
+
+class HashValidityTest : public BTestCase {
+public:
+ HashValidityTest();
+ virtual ~HashValidityTest();
+
+ void TestSetters();
+
+ static void AddTests(BTestSuite& suite);
+};
+
+#endif // HASHVALIDITYTEST_H
diff --git a/src/tests/kits/crypto/Jamfile b/src/tests/kits/crypto/Jamfile
new file mode 100644
index 0000000000..f506c5b069
--- /dev/null
+++ b/src/tests/kits/crypto/Jamfile
@@ -0,0 +1,10 @@
+SubDir HAIKU_TOP src tests kits crypto ;
+
+SetSubDirSupportedPlatformsBeOSCompatible ;
+AddSubDirSupportedPlatforms libbe_test ;
+
+UnitTestLib libcryptotest.so
+ : HashValidityTest.cpp
+
+ : be [ TargetLibstdc++ ] [ TargetLibsupc++ ]
+;


 21.03.2019, 10:18, Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> On Thu, Mar
 21, 2019 at 12:22:45PM +1300, Jessica Hamilton wrote:
 > On Thu, 21 Mar 2019 at 10:38, Lee Mon <strongleemon@xxxxxxxxxx> wrote:
 > >
 > > Yes, I did it. I tried to add the target both as SimpleTest and
 UnitTestLib. Maybe Jam's cache is kept somewhere? Though, it shouldn't be.
 >
 > Do you have a branch somewhere that can be checked out?
 >

 Indeed, sharing your code (even if not working) may help people
 investigate the problem.

 There is no cache for Jam, otherwise it would not spend time rescanning
 everything everything whenever you start it.

 Usually these errors are some oversight, quite often missing a space
 before a ; in Jamfiles. But it's hard to see what you did exactly
 without access to your code.

 --
 Adrien.

Other related posts: