2
0
Fork 0
mirror of https://github.com/bazel-contrib/rules_foreign_cc synced 2024-12-01 22:16:27 +00:00
rules_foreign_cc/examples/make_simple/test_libb.cpp
Fabian Meumertzheim f61ce5d10b
Pass toolchain and user env variables to make invocation (#777)
* Pass toolchain and user env variables to make invocation

* Rename configure --> make

* Add integration test coverage for make flag passing

This requires making the make_simple Makefile more realistic by

* using CXX and forwarding it to the wrapper;
* using CXXFLAGS instead of CXX_FLAGS and not overwriting its contents.
2021-11-27 07:52:54 -08:00

19 lines
468 B
C++

#include "liba.h"
#include <iostream>
#include <string>
#include <stdexcept>
int main(int argc, char* argv[])
{
std::string result = hello_liba();
if (result != "Hello from LIBA!") {
throw std::runtime_error("Wrong result: " + result);
}
double math_result = hello_math(0.5);
if (math_result < 1.047 || math_result > 1.048) {
throw std::runtime_error("Wrong math_result: " + std::to_string(math_result));
}
std::cout << "Everything's fine!";
}