
Product
Announcing Precomputed Reachability Analysis in Socket
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
A C/C++ DocTest that runs tests using clang-repl
interaction in comments. Supports Linux (macOS is untested).
clang-repl-kernel
version 0.1.8libclang
must be installed and functioning properlysample.cpp
#include "sample.h"
namespace test {
/**
>>> test::Fac fac;
>>> %<< fac.fac(7);
5040
*/
int Fac::fac(int n) {
return (n > 1) ? n * fac(n - 1) : 1;
}
/**
>>> test::Fac fac;
>>> %<< fac.fac2(5);
120
*/
int Fac::fac2(int n) {
return (n > 1) ? n * fac(n - 1) : 1;
}
}
sample.h
#pragma once
/**
>>> test::Fac fac;
>>> %<< fac.fac(5);
120
>>> %<< fac.fac2(5);
120
*/
namespace test {
class Fac {
public:
/**
>>> test::Fac fac;
>>> %<< fac.fac(5);
120
*/
int fac(int n);
int fac2(int n);
};
}
clang -c -o sample.o sample.cpp
clang -shared sample.o -o sample.so
clang-cl -c -o sample.o sample.cpp
clang -shared sample.o -o sample.dll
python3 -m cdoctest -cdtt=sample.h -cdtl=sample.so -cdtip=.
python -m cdoctest -cdtt=sample.h -cdtl=sample.dll -cdtip=.
Can be used with vscode extension cdoctest_vscode_extension
FAQs
doctest for C/C++ which run tests by using clang-repl interaction comments.
We found that cdoctest demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.