Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 1 | #include "examples/cpp/hello-lib.h" |
| 2 | |
Kristina Chodorow | f01b229 | 2015-03-02 16:08:28 +0000 | [diff] [blame] | 3 | #include <string> |
| 4 | |
| 5 | using hello::HelloLib; |
| 6 | using 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 Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 13 | int main(int argc, char** argv) { |
Kristina Chodorow | 3af12e6 | 2015-04-10 17:29:58 +0000 | [diff] [blame] | 14 | HelloLib lib("Hello"); |
Kristina Chodorow | f01b229 | 2015-03-02 16:08:28 +0000 | [diff] [blame] | 15 | string thing = "barf"; |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 16 | if (argc > 1) { |
Kristina Chodorow | f01b229 | 2015-03-02 16:08:28 +0000 | [diff] [blame] | 17 | thing = argv[1]; |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 18 | } |
| 19 | |
Kristina Chodorow | f01b229 | 2015-03-02 16:08:28 +0000 | [diff] [blame] | 20 | lib.greet(thing); |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 21 | return 1; |
| 22 | } |