Skip to content

Commit

Permalink
cmake: Roll back cmake version change
Browse files Browse the repository at this point in the history
  • Loading branch information
nathaniel-brough committed Nov 15, 2023
1 parent a32bc1f commit f0ae688
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 3 deletions.
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
description = "A template for Nix based C++ project setup.";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/21.05";

utils.url = "github:numtide/flake-utils";
utils.inputs.nixpkgs.follows = "nixpkgs";
};

outputs = { self, nixpkgs, ... }@inputs: inputs.utils.lib.eachSystem [
"x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin"
] (system: let pkgs = import nixpkgs {
inherit system;
};
in {
devShell = pkgs.mkShell rec {
name = "Quantlib";

packages = with pkgs; [
# Development Tools
llvmPackages_11.clang
cmake
boost
];
shellHook = ''export CXX=clang++ && export CC=clang'';
};
});
}
12 changes: 9 additions & 3 deletions fuzz-test-suite/dateparserfuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,24 @@
#include <ql/time/timeunit.hpp>
#include <ql/utilities/dataparsers.hpp>
#include <string>
#include <iostream>

#ifndef __clang__
#pragma message("Fuzzer headers are available from clang, other compilers have not been tested.")
# pragma message( \
"Fuzzer headers are available from clang, other compilers have not been tested.")
#endif
#include <fuzzer/FuzzedDataProvider.h>

extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
FuzzedDataProvider fdp(data, size);
constexpr int kMaxString = 100;
std::string first = fdp.ConsumeRandomLengthString(kMaxString);
std::string second = fdp.ConsumeRandomLengthString(kMaxString);
std::cout << first.size() << " " << second.size() << "\n";

try {
(void)QuantLib::DateParser::parseFormatted(fdp.ConsumeRandomLengthString(kMaxString), "%Y-%m-%d");
(void)QuantLib::DateParser::parseISO(fdp.ConsumeRandomLengthString(kMaxString));
// (void)QuantLib::DateParser::parseFormatted(first, "%Y-%m-%d");
// (void)QuantLib::DateParser::parseISO(second);
} catch (const std::exception& e) {
// Handle or ignore exceptions
}
Expand Down

0 comments on commit f0ae688

Please sign in to comment.