Files
simdjson-simdjson/tests/checkimplementation.cpp
T
Daniel Lemire b9234be80f complete number_in_string for documents, stringify the version macro and improving trailing content errors (#1934)
* This completes the '*_in_string' support within documents.

* Minor updates.

* Additional fixes.
2023-01-21 15:29:08 -05:00

23 lines
1.1 KiB
C++

#include "simdjson.h"
#include <iostream>
#include <cstring>
int main(int argc, const char *argv[]) {
std::cout << "simdjson v" << SIMDJSON_VERSION << " is running the " << simdjson::get_active_implementation()->name() << " implementation." << std::endl;
const char *expected_implementation = nullptr;
if (argc > 1) {
expected_implementation = argv[1];
} else {
expected_implementation = getenv("SIMDJSON_FORCE_IMPLEMENTATION");
if (!expected_implementation) {
std::cout << "No expected implementation argument and SIMDJSON_FORCE_IMPLEMENTATION is not set, success by default!" << std::endl;
return EXIT_SUCCESS;
}
std::cout << "No expected implementation argument, but SIMDJSON_FORCE_IMPLEMENTATION is set to " << expected_implementation << ", so we'll check for that." << std::endl;
}
if (strcmp(expected_implementation, simdjson::get_active_implementation()->name().c_str())) {
std::cerr << "Wrong implementation! Expected " << expected_implementation << "." << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}