diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000000..54dd35a11eb --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1622516815, + "narHash": "sha256-ZjBd81a6J3TwtlBr3rHsZspYUwT9OdhDk+a/SgSEf7I=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7e9b0dff974c89e070da1ad85713ff3c20b0ca97", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "21.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "utils": "utils" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000000..f4f0f5be66d --- /dev/null +++ b/flake.nix @@ -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''; + }; + }); +} diff --git a/fuzz-test-suite/dateparserfuzzer.cpp b/fuzz-test-suite/dateparserfuzzer.cpp index 7c6f6423fdd..238a0d7836a 100644 --- a/fuzz-test-suite/dateparserfuzzer.cpp +++ b/fuzz-test-suite/dateparserfuzzer.cpp @@ -5,18 +5,24 @@ #include #include #include +#include #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 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 }