Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
cppunitlite
Advanced tools
This is a modified version of CppUnitLite
Use CppUnitLite to add unit tests to the c++ side of a node addon.
Install cppunitlite with npm. It has no package dependencies, but requires node-gyp to be installed and working.
$ npm i --save-dev cppunitlite
npm http GET https://registry.npmjs.org/cppunitlite
npm http 304 https://registry.npmjs.org/cppunitlite
> cppunitlite@0.0.3 install Z:\code\node_modules\cppunitlite
> node-gyp rebuild
... platform dependent stuff ...
cppunitlite@0.0.3 node_modules\cppunitlite
Add a test target to your binding.gyp:
{
'target_name': 'test',
'type': 'executable',
'sources': [
# your test files
]
'include_dirs': [
# your project include files
'<!(node -e "require(\'cpppunitlite\')'
]
'dependencies': [
'node_modules/cppunitlite/binding.gyp:CppUnitLite'
]
}
CppUnitLite does not provide a main() function, but it's easy to write a minimal one; for example:
#include "CppUnitLite/TestHarness.h"
int main()
{
TestResult tr;
TestRegistry::runAllTests(tr);
return 0;
}
The include directories are set up so that the CppUnitLite headers should be included with a path.
#include "CppUnitLite/TestHarness.h"
#include <string>
static inline SimpleString StringFrom(const std::string& value)
{
return SimpleString(value.c_str());
}
TEST( Hello, world )
{
std::string s1("Hello"), s2("Hello"), s3("world");
CHECK_EQUAL(s1, s2);
CHECK_EQUAL(s2, s1);
CHECK(s1 != s3);
}
Original version from Michael Feathers http://www.objectmentor.com/resources/downloads.html http://www.objectmentor.com/resources/bin/CppUnitLite.zip
Some documentation here: http://c2.com/cgi/wiki?CppUnitLite
Modified version by Keith Bauer, published as an SVN repository http://www.onesadcookie.com/svn/CppUnitLite
Imported to git 2014-01-19 and pushed to github
FAQs
C++ unit testing library
The npm package cppunitlite receives a total of 13 weekly downloads. As such, cppunitlite popularity was classified as not popular.
We found that cppunitlite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.