File: hello-fail.cc

package info (click to toggle)
bazel-bootstrap 3.5.1%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 82,232 kB
  • sloc: java: 699,320; sh: 50,568; cpp: 34,885; python: 11,961; xml: 295; objc: 269; ansic: 106; makefile: 95; ruby: 3
file content (22 lines) | stat: -rwxr-xr-x 451 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "examples/cpp/hello-lib.h"

#include <string>

using hello::HelloLib;
using std::string;

/**
 * This is a fake test that prints "Hello barf" and then exits with exit code 1.
 * If run as a test (cc_test), the non-0 exit code indicates to Bazel that the
 * "test" has failed.
 */
int main(int argc, char** argv) {
  HelloLib lib("Hello");
  string thing = "barf";
  if (argc > 1) {
    thing = argv[1];
  }

  lib.greet(thing);
  return 1;
}