Beast: My new library based on juce_core


#1

So I’ve been using my library beast at OpenCoin where I work. I’ve built it up to be a robust library for writing high performance peer to peer servers.

beast started from juce_core which Jules was kind enough to re-publish under the ISC License, so I can make beast available under those terms as well (no restrictions).

I’ve greatly improved the UnitTest framework from the original JUCE. There is an option to produce XML output which is compatible with JUnit reporting modules on continuous integration servers.

For mission critical software development cycles, I’ve added class SemanticVersion which strictly implements versioning strings according to Semantic Versioning 2.0.0, a standards-body approved method for tagging software releases.

Jules or anyone, feel free to steal that class!

Here’s a little command line output from my last run of tests in rippled:

sh-3.1$ ./rippled --unittest=print
print.print : List available unit tests
[FORCED] ripple.BuildInfo
         ripple.NodeObject
         ripple.NodeStoreBasics
         ripple.NodeStoreBackend
[manual] ripple.NodeStoreTiming
         ripple.NodeStore
         ripple.Ledger
         ripple.SHAMap
         ripple.SHAMapSync
         ripple.ProxyHandshake
         ripple.ProofOfWork
         ripple.SerializedTransaction
[manual] ripple.FatalErrorReporter
[manual] ripple.MultiSocket
[manual] ripple.Asio
         ripple.RangeSet
         ripple.StringUtilities
         ripple.LoadFeeTrack
[manual] ripple.Validators
         ripple.CKey
         ripple.RippleAddress
         ripple.Serializer
         ripple.SerializedObject
         ripple.STAmount
         beast.TestPeer
         beast.Workers
         beast.Abstract Fifo
[manual] beast.FatalError
[manual] beast.ProtectedCall
         beast.SemanticVersion
[manual] print.print
[manual] beast.Pass
[manual] beast.Fail
         beast.UnitTestUtilities
         beast.File
         beast.RandomAccessFile
         beast.JSON
         beast.Random
         beast.MemoryStream
         beast.LexicalCast
         beast.String
         beast.TextDiff
         beast.ChildProcess
         beast.Atomic
         beast.GZIP
         beast.UnsignedInteger
         beast.KeyvaDB
Summary: 1 suites, 1 cases, 1 tests, 0 failures.

sh-3.1$ ./rippled --unittest=beast
beast.TestPeer : tcpv4 / sync_server / sync_client
beast.TestPeer : tcpv4 / sync_server / async_client
beast.TestPeer : tcpv4 / async_server / sync_client
beast.TestPeer : tcpv4 / async_server / async_client
beast.TestPeer : tcpv6 / sync_server / sync_client
beast.TestPeer : tcpv6 / sync_server / async_client
beast.TestPeer : tcpv6 / async_server / sync_client
beast.TestPeer : tcpv6 / async_server / async_client
beast.Workers : threadCount = 0
beast.Workers : threadCount = 1
beast.Workers : threadCount = 2
beast.Workers : threadCount = 4
beast.Workers : threadCount = 16
beast.Workers : threadCount = 64
beast.Workers : threadCount = 128
beast.Workers : threadCount = 256
beast.Workers : threadCount = 512
beast.Abstract Fifo : AbstractFifo
beast.SemanticVersion : parse
beast.UnitTestUtilities : Payload
beast.File : Reading
beast.File : Writing
beast.File : Memory-mapped files
beast.File : More writing
beast.RandomAccessFile : numRecords=10000
beast.JSON : JSON
beast.Random : Random
beast.MemoryStream : Basics
beast.LexicalCast : random int
beast.LexicalCast : numeric_limits <int>
beast.LexicalCast : random unsigned int
beast.LexicalCast : numeric_limits <unsigned int>
beast.LexicalCast : random short
beast.LexicalCast : numeric_limits <short>
beast.LexicalCast : random unsigned short
beast.LexicalCast : numeric_limits <unsigned short>
beast.LexicalCast : random int
beast.LexicalCast : numeric_limits <int>
beast.LexicalCast : random unsigned int
beast.LexicalCast : numeric_limits <unsigned int>
beast.LexicalCast : random __int64
beast.LexicalCast : numeric_limits <__int64>
beast.LexicalCast : random unsigned __int64
beast.LexicalCast : numeric_limits <unsigned __int64>
beast.String : Basics
beast.String : Operations
beast.String : Numeric conversions
beast.String : Subsections
beast.String : UTF conversions
beast.String : StringArray
beast.TextDiff : TextDiff
beast.ChildProcess : Child Processes
beast.Atomic : Misc
beast.Atomic : int
beast.Atomic : unsigned int
beast.Atomic : int32
beast.Atomic : uint32
beast.Atomic : long
beast.Atomic : void*
beast.Atomic : int*
beast.Atomic : float
beast.GZIP : GZIP
beast.UnsignedInteger : Bytes=16
beast.UnsignedInteger : Bytes=33
beast.KeyvaDB : keyBytes=4, maxItems=500
beast.KeyvaDB : keyBytes=32, maxItems=4000
Summary: 18 suites, 66 cases, 127650 tests, 0 failures.

I’m also doing some very extensive work with sockets. I’ve added a module beast_asio which wraps boost::asio objects and helps to hide some of its complexities.

Just thought I would let everyone know what I’ve been up to!