blob: 5fb2292354a4abc6e6ea8b5542737122cba823a8 [file] [log] [blame]
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +01001#include "examples/cpp/hello-lib.h"
2
Kristina Chodorowf01b2292015-03-02 16:08:28 +00003#include <string>
4
5using hello::HelloLib;
6using std::string;
7
8/**
9 * This is a fake test that prints "Hello barf" and then exits with exit code 1.
10 * If run as a test (cc_test), the non-0 exit code indicates to Bazel that the
11 * "test" has failed.
12 */
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010013int main(int argc, char** argv) {
Kristina Chodorow3af12e62015-04-10 17:29:58 +000014 HelloLib lib("Hello");
Kristina Chodorowf01b2292015-03-02 16:08:28 +000015 string thing = "barf";
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010016 if (argc > 1) {
Kristina Chodorowf01b2292015-03-02 16:08:28 +000017 thing = argv[1];
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010018 }
19
Kristina Chodorowf01b2292015-03-02 16:08:28 +000020 lib.greet(thing);
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010021 return 1;
22}