(List (= scope= flags=0 words=[] bindings=[('CURRENT_DIR', {[DQ [ComSub (AndOr OP_AND_IF (Com {[LIT_CHARS cd]} {[DQ [ComSub (Com {[LIT_CHARS dirname]} {[DQ [VarSub BASH_SOURCE bracket_op=(Index {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 0]}})]]})]]}) (Com {[LIT_CHARS pwd]}) )]]})]) (AndOr OP_OR_IF (Com {[LIT_CHARS source]} {[DQ [VarSub CURRENT_DIR][LIT_CHARS /../integration_test_setup.sh]]}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "integration_test_setup.sh not found!"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]}) ) ) (AndOr OP_OR_IF (Com {[LIT_CHARS source]} {[VarSub CURRENT_DIR] [LIT_CHARS /bazel_sandboxing_test_utils.sh]}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "bazel_sandboxing_test_utils.sh not found!"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]}) ) ) (FunctionDef set_up [] (List (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[LIT_CHARS examples/cpp/] [LIT_LBRACE "{"] [LIT_CHARS bin] [LIT_COMMA ","] [LIT_CHARS lib] [LIT_RBRACE "}"]}) (Com {[LIT_CHARS cat]} < (HereDocRedirectNode here_end='EOF' do_expansion=False body_word={[LIT_CHARS "cc_library(\n"] [LIT_CHARS " name = \"hello-lib\",\n"] [LIT_CHARS " srcs = [\"lib/hello-lib.c\"],\n"] [LIT_CHARS " hdrs = [\"lib/hello-lib.h\"],\n"] [LIT_CHARS ")\n"] [LIT_CHARS "\n"] [LIT_CHARS "cc_binary(\n"] [LIT_CHARS " name = \"hello-world\",\n"] [LIT_CHARS " srcs = [\"bin/hello-world.c\"],\n"] [LIT_CHARS " deps = [\":hello-lib\"],\n"] [LIT_CHARS ")\n"]} 0), (FilenameRedirectNode filename={[LIT_CHARS examples/cpp/BUILD]} "> 1), > ) (Com {[LIT_CHARS cat]} < (HereDocRedirectNode here_end='EOF' do_expansion=False body_word={[LIT_CHARS "#include \"examples/cpp/lib/hello-lib.h\"\n"] [LIT_CHARS "\n"] [LIT_CHARS "void greet(char *greeting) {\n"] [LIT_CHARS " printf(\"hello-lib says: %s\\n\", greeting);\n"] [LIT_CHARS "}\n"]} 0), (FilenameRedirectNode filename={[LIT_CHARS examples/cpp/lib/hello-lib.c]} "> 1), > ) (Com {[LIT_CHARS cat]} < (HereDocRedirectNode here_end='EOF' do_expansion=False body_word={[LIT_CHARS "#ifndef EXAMPLES_CPP_LIB_HELLO_LIB_H_\n"] [LIT_CHARS "#define EXAMPLES_CPP_LIB_HELLO_LIB_H_\n"] [LIT_CHARS "\n"] [LIT_CHARS "#include \n"] [LIT_CHARS "\n"] [LIT_CHARS "void greet(char *greeting);\n"] [LIT_CHARS "\n"] [LIT_CHARS "static inline void greet_from_header() {\n"] [LIT_CHARS " printf(\"greetings from the header\");\n"] [LIT_CHARS "}\n"] [LIT_CHARS "\n"] [LIT_CHARS "#endif // EXAMPLES_CPP_LIB_HELLO_LIB_H_\n"]} 0), (FilenameRedirectNode filename={[LIT_CHARS examples/cpp/lib/hello-lib.h]} "> 1), > ) (Com {[LIT_CHARS cat]} < (HereDocRedirectNode here_end='EOF' do_expansion=False body_word={[LIT_CHARS "#include \"examples/cpp/lib/hello-lib.h\"\n"] [LIT_CHARS "\n"] [LIT_CHARS "int main(int argc, char** argv) {\n"] [LIT_CHARS " if (argc > 1) {\n"] [LIT_CHARS " greet(argv[1]);\n"] [LIT_CHARS " }\n"] [LIT_CHARS " greet_from_header();\n"] [LIT_CHARS " return 0;\n"] [LIT_CHARS "}\n"]} 0), (FilenameRedirectNode filename={[LIT_CHARS examples/cpp/bin/hello-world.c]} "> 1), > ) ) ) (FunctionDef test_sandboxed_cpp_build_rebuilds_on_change [] (List (Fork (Com {[LIT_CHARS bazel]} {[LIT_CHARS build]} {[LIT_CHARS --spawn_strategy] [LIT_OTHER "="] [LIT_CHARS sandboxed]} {[LIT_CHARS //examples/cpp] [LIT_OTHER ":"] [LIT_CHARS hello-world]}) ) (AndOr OP_OR_IF (Com < (FilenameRedirectNode filename={[VarSub TEST_log]} "> 1), > ) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "Building hello-world failed"]]}) ) (AndOr OP_OR_IF (Pipeline (Com {[LIT_CHARS bazel-bin/examples/cpp/hello-world]}) (Com {[LIT_CHARS fgrep]} {[DQ [LIT_CHARS "greetings from the header"]]}) ) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "Did not print expected string 'greetings from the header'"]]}) ) (AndOr OP_OR_IF (Com {[LIT_CHARS sed]} {[DQ [LIT_CHARS "s/from the header/from the modified header/g"]]} < (FilenameRedirectNode filename={[LIT_CHARS examples/cpp/lib/hello-lib.h]} 0), (FilenameRedirectNode filename={[LIT_CHARS tmp]} "> 1), > ) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "modifying hello-lib.h failed"]]}) ) (AndOr OP_OR_IF (Com {[LIT_CHARS mv]} {[LIT_CHARS tmp]} {[LIT_CHARS examples/cpp/lib/hello-lib.h]}) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "moving modified header file back to examples/cpp/lib/hello-lib.h failed"]]}) ) (Fork (Com {[LIT_CHARS bazel]} {[LIT_CHARS build]} {[LIT_CHARS --spawn_strategy] [LIT_OTHER "="] [LIT_CHARS sandboxed]} {[LIT_CHARS //examples/cpp] [LIT_OTHER ":"] [LIT_CHARS hello-world]}) ) (AndOr OP_OR_IF (Com < (FilenameRedirectNode filename={[VarSub TEST_log]} "> 1), > ) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "Building modified hello-world failed"]]}) ) (AndOr OP_OR_IF (Pipeline (Com {[LIT_CHARS bazel-bin/examples/cpp/hello-world]}) (Com {[LIT_CHARS fgrep]} {[DQ [LIT_CHARS "greetings from the modified header"]]}) ) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "Did not print expected string 'greetings from the modified header'"]]}) ) ) ) (FunctionDef test_sandboxed_cpp_build_catches_missing_header_via_sandbox [] (List (Com {[LIT_CHARS cat]} < (HereDocRedirectNode here_end='EOF' do_expansion=False body_word={[LIT_CHARS "cc_library(\n"] [LIT_CHARS " name = \"hello-lib\",\n"] [LIT_CHARS " srcs = [\"lib/hello-lib.c\"],\n"] [LIT_CHARS ")\n"]} 0), (FilenameRedirectNode filename={[LIT_CHARS examples/cpp/BUILD]} "> 1), > ) (Fork (Com {[LIT_CHARS bazel]} {[LIT_CHARS build]} {[LIT_CHARS --spawn_strategy] [LIT_OTHER "="] [LIT_CHARS sandboxed]} {[LIT_CHARS //examples/cpp] [LIT_OTHER ":"] [LIT_CHARS hello-lib]}) ) (AndOr OP_AND_IF (Com < (FilenameRedirectNode filename={[VarSub TEST_log]} "> 1), > ) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "build should not have succeeded with missing header file"]]}) ) (AndOr OP_OR_IF (Com {[LIT_CHARS fgrep]} {[DQ [LIT_CHARS "fatal error: examples/cpp/lib/hello-lib.h: No such file or directory"]]} {[VarSub TEST_log]}) (AndOr OP_OR_IF (Com {[LIT_CHARS fgrep]} {[DQ [LIT_CHARS "fatal error: 'examples/cpp/lib/hello-lib.h' file not found"]]} {[VarSub TEST_log]}) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "could not find 'No such file or directory' error message in bazel output"]]}) ) ) ) ) (FunctionDef DISABLED_test_sandboxed_cpp_build_catches_header_only_in_srcs [] (List (Com {[LIT_CHARS cat]} < (HereDocRedirectNode here_end='EOF' do_expansion=False body_word={[LIT_CHARS "cc_library(\n"] [LIT_CHARS " name = \"hello-lib\",\n"] [LIT_CHARS " srcs = [\"hello-lib.c\", \"hello-lib.h\"],\n"] [LIT_CHARS ")\n"] [LIT_CHARS "\n"] [LIT_CHARS "cc_binary(\n"] [LIT_CHARS " name = \"hello-world\",\n"] [LIT_CHARS " srcs = [\"hello-world.c\"],\n"] [LIT_CHARS " deps = [\":hello-lib\"],\n"] [LIT_CHARS ")\n"]} 0), (FilenameRedirectNode filename={[LIT_CHARS examples/cpp/BUILD]} "> 1), > ) (Fork (Com {[LIT_CHARS bazel]} {[LIT_CHARS build]} {[LIT_CHARS --spawn_strategy] [LIT_OTHER "="] [LIT_CHARS sandboxed]} {[LIT_CHARS //examples/cpp] [LIT_OTHER ":"] [LIT_CHARS hello-lib]}) ) (AndOr OP_OR_IF (Com < (FilenameRedirectNode filename={[VarSub TEST_log]} "> 1), > ) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "building hello-lib should have succeeded with header file in srcs"]]}) ) (Fork (Com {[LIT_CHARS bazel]} {[LIT_CHARS build]} {[LIT_CHARS --spawn_strategy] [LIT_OTHER "="] [LIT_CHARS sandboxed]} {[LIT_CHARS //examples/cpp] [LIT_OTHER ":"] [LIT_CHARS hello-world]}) ) (AndOr OP_AND_IF (Com < (FilenameRedirectNode filename={[VarSub TEST_log]} "> 1), > ) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "building hello-world should not have succeeded with library header file in srcs"]]}) ) (AndOr OP_OR_IF (Com {[LIT_CHARS fgrep]} {[DQ [LIT_CHARS "undeclared inclusion(s) in rule '//examples/cpp:hello-world'"]]} {[VarSub TEST_log]}) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "could not find 'undeclared inclusion' error message in bazel output"]]}) ) ) ) (FunctionDef test_standalone_cpp_build_rebuilds_on_change [] (List (Fork (Com {[LIT_CHARS bazel]} {[LIT_CHARS build]} {[LIT_CHARS --spawn_strategy] [LIT_OTHER "="] [LIT_CHARS standalone]} {[LIT_CHARS //examples/cpp] [LIT_OTHER ":"] [LIT_CHARS hello-world]}) ) (AndOr OP_OR_IF (Com < (FilenameRedirectNode filename={[VarSub TEST_log]} "> 1), > ) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "Building hello-world failed"]]}) ) (AndOr OP_OR_IF (Pipeline (Com {[LIT_CHARS bazel-bin/examples/cpp/hello-world]}) (Com {[LIT_CHARS fgrep]} {[DQ [LIT_CHARS "greetings from the header"]]}) ) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "Did not print expected string 'greetings from the header'"]]}) ) (AndOr OP_OR_IF (Com {[LIT_CHARS sed]} {[DQ [LIT_CHARS "s/from the header/from the modified header/g"]]} < (FilenameRedirectNode filename={[LIT_CHARS examples/cpp/lib/hello-lib.h]} 0), (FilenameRedirectNode filename={[LIT_CHARS tmp]} "> 1), > ) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "modifying hello-lib.h failed"]]}) ) (AndOr OP_OR_IF (Com {[LIT_CHARS mv]} {[LIT_CHARS tmp]} {[LIT_CHARS examples/cpp/lib/hello-lib.h]}) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "moving modified header file back to examples/cpp/lib/hello-lib.h failed"]]}) ) (Fork (Com {[LIT_CHARS bazel]} {[LIT_CHARS build]} {[LIT_CHARS --spawn_strategy] [LIT_OTHER "="] [LIT_CHARS standalone]} {[LIT_CHARS //examples/cpp] [LIT_OTHER ":"] [LIT_CHARS hello-world]}) ) (AndOr OP_OR_IF (Com < (FilenameRedirectNode filename={[VarSub TEST_log]} "> 1), > ) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "Building modified hello-world failed"]]}) ) (AndOr OP_OR_IF (Pipeline (Com {[LIT_CHARS bazel-bin/examples/cpp/hello-world]}) (Com {[LIT_CHARS fgrep]} {[DQ [LIT_CHARS "greetings from the modified header"]]}) ) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "Did not print expected string 'greetings from the modified header'"]]}) ) ) ) (FunctionDef test_standalone_cpp_build_catches_missing_header [] (List (Com {[LIT_CHARS cat]} < (HereDocRedirectNode here_end='EOF' do_expansion=False body_word={[LIT_CHARS "cc_library(\n"] [LIT_CHARS " name = \"hello-lib\",\n"] [LIT_CHARS " srcs = [\"lib/hello-lib.c\"],\n"] [LIT_CHARS ")\n"]} 0), (FilenameRedirectNode filename={[LIT_CHARS examples/cpp/BUILD]} "> 1), > ) (Fork (Com {[LIT_CHARS bazel]} {[LIT_CHARS build]} {[LIT_CHARS --spawn_strategy] [LIT_OTHER "="] [LIT_CHARS standalone]} {[LIT_CHARS //examples/cpp] [LIT_OTHER ":"] [LIT_CHARS hello-lib]}) ) (AndOr OP_AND_IF (Com < (FilenameRedirectNode filename={[VarSub TEST_log]} "> 1), > ) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "build should not have succeeded with missing header file"]]}) ) (AndOr OP_OR_IF (Com {[LIT_CHARS fgrep]} {[DQ [LIT_CHARS "undeclared inclusion(s) in rule '//examples/cpp:hello-lib'"]]} {[VarSub TEST_log]}) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "could not find 'undeclared inclusion' error message in bazel output"]]}) ) ) ) (FunctionDef DISABLED_test_standalone_cpp_build_catches_header_only_in_srcs [] (List (Com {[LIT_CHARS cat]} < (HereDocRedirectNode here_end='EOF' do_expansion=False body_word={[LIT_CHARS "cc_library(\n"] [LIT_CHARS " name = \"hello-lib\",\n"] [LIT_CHARS " srcs = [\"hello-lib.c\", \"hello-lib.h\"],\n"] [LIT_CHARS ")\n"] [LIT_CHARS "\n"] [LIT_CHARS "cc_binary(\n"] [LIT_CHARS " name = \"hello-world\",\n"] [LIT_CHARS " srcs = [\"hello-world.c\"],\n"] [LIT_CHARS " deps = [\":hello-lib\"],\n"] [LIT_CHARS ")\n"]} 0), (FilenameRedirectNode filename={[LIT_CHARS examples/cpp/BUILD]} "> 1), > ) (Fork (Com {[LIT_CHARS bazel]} {[LIT_CHARS build]} {[LIT_CHARS --spawn_strategy] [LIT_OTHER "="] [LIT_CHARS standalone]} {[LIT_CHARS //examples/cpp] [LIT_OTHER ":"] [LIT_CHARS hello-lib]}) ) (AndOr OP_OR_IF (Com < (FilenameRedirectNode filename={[VarSub TEST_log]} "> 1), > ) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "building hello-lib should have succeeded with header file in srcs"]]}) ) (Fork (Com {[LIT_CHARS bazel]} {[LIT_CHARS build]} {[LIT_CHARS --spawn_strategy] [LIT_OTHER "="] [LIT_CHARS standalone]} {[LIT_CHARS //examples/cpp] [LIT_OTHER ":"] [LIT_CHARS hello-world]}) ) (AndOr OP_AND_IF (Com < (FilenameRedirectNode filename={[VarSub TEST_log]} "> 1), > ) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "building hello-world should not have succeeded with library header file in srcs"]]}) ) (AndOr OP_OR_IF (Com {[LIT_CHARS fgrep]} {[DQ [LIT_CHARS "undeclared inclusion(s) in rule '//examples/cpp:hello-world'"]]} {[VarSub TEST_log]}) (Com {[LIT_CHARS fail]} {[DQ [LIT_CHARS "could not find 'undeclared inclusion' error message in bazel output"]]}) ) ) ) (AndOr OP_OR_IF (Com {[LIT_CHARS check_supported_platform]}) (Com {[LIT_CHARS exit]} {[LIT_CHARS 0]}) ) (AndOr OP_OR_IF (Com {[LIT_CHARS check_sandbox_allowed]}) (Com {[LIT_CHARS exit]} {[LIT_CHARS 0]}) ) (Com {[LIT_CHARS run_suite]} {[DQ [LIT_CHARS sandbox]]}) )