Add hello world example, including a proper test. (#275)

diff --git a/examples/remotebuildexecution/hello_world/cc/BUILD b/examples/remotebuildexecution/hello_world/cc/BUILD
new file mode 100644
index 0000000..b973924
--- /dev/null
+++ b/examples/remotebuildexecution/hello_world/cc/BUILD
@@ -0,0 +1,33 @@
+# Copyright 2016 The Bazel Authors. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+    name = "say_hello",
+    srcs = ["say_hello.cc"],
+    hdrs = ["say_hello.h"],
+)
+
+cc_binary(
+    name = "hello_world",
+    srcs = ["hello_world.cc"],
+    deps = [":say_hello"],
+)
+
+cc_test(
+    name = "say_hello_test",
+    srcs = ["say_hello_test.cc"],
+    deps = [":say_hello"],
+)
diff --git a/examples/remotebuildexecution/hello_world/cc/hello_world.cc b/examples/remotebuildexecution/hello_world/cc/hello_world.cc
new file mode 100644
index 0000000..719cda0
--- /dev/null
+++ b/examples/remotebuildexecution/hello_world/cc/hello_world.cc
@@ -0,0 +1,22 @@
+// Copyright 2016 The Bazel Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "say_hello.h"
+
+#include <iostream>
+
+int main(int argc, char** argv) {
+  std::cout << sayHello("world") << std::endl;
+  return 0;
+}
diff --git a/examples/remotebuildexecution/hello_world/cc/say_hello.cc b/examples/remotebuildexecution/hello_world/cc/say_hello.cc
new file mode 100644
index 0000000..a5760eb
--- /dev/null
+++ b/examples/remotebuildexecution/hello_world/cc/say_hello.cc
@@ -0,0 +1,19 @@
+// Copyright 2016 The Bazel Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <string>
+
+std::string sayHello(std::string name) {
+  return "Hello, " + name;
+}
diff --git a/examples/remotebuildexecution/hello_world/cc/say_hello.h b/examples/remotebuildexecution/hello_world/cc/say_hello.h
new file mode 100644
index 0000000..c446abf
--- /dev/null
+++ b/examples/remotebuildexecution/hello_world/cc/say_hello.h
@@ -0,0 +1,17 @@
+// Copyright 2016 The Bazel Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <string>
+
+std::string sayHello(std::string name);
diff --git a/examples/remotebuildexecution/hello_world/cc/say_hello_test.cc b/examples/remotebuildexecution/hello_world/cc/say_hello_test.cc
new file mode 100644
index 0000000..41b30d5
--- /dev/null
+++ b/examples/remotebuildexecution/hello_world/cc/say_hello_test.cc
@@ -0,0 +1,28 @@
+// Copyright 2016 The Bazel Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "say_hello.h"
+
+#include <iostream>
+#include <string>
+
+int main(int argc, char** argv) {
+  std::string res = sayHello("user");
+  std::string expect = "Hello, user";
+  if (res != expect) {
+    std::cout << "Want '" << expect << "', got '" << res << "'" << std::endl;
+    return 1;
+  }
+  return 0;
+}