diff options
Diffstat (limited to 'tests/foo.cc')
-rw-r--r-- | tests/foo.cc | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/foo.cc b/tests/foo.cc index 4359267..3274cf8 100644 --- a/tests/foo.cc +++ b/tests/foo.cc @@ -1 +1,20 @@ -int main(int argc, char* argv[]) { return 0; } +#include <fstream> +#include <iostream> +#include <string> + +extern int a, b; + +// A very roundabout hello world. +int main(int argc, char* argv[]) { + std::string runfiles(argv[0]); + runfiles.append(".runfiles"); + std::string hello(runfiles + "/rules_pkg/tests/testdata/hello.txt"); + std::fstream fs; + fs.open(hello, std::iostream::in); + char tmp[1000]; + fs.read(tmp, sizeof(tmp)); + fs.close(); + std::cout << tmp; + + return (a + b > 0) ? 0 : 1; +} |