bootstrap-test.ekam-rule (2409B)
1 #! /bin/sh 2 3 # Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors 4 # Licensed under the MIT License: 5 # 6 # Permission is hereby granted, free of charge, to any person obtaining a copy 7 # of this software and associated documentation files (the "Software"), to deal 8 # in the Software without restriction, including without limitation the rights 9 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 # copies of the Software, and to permit persons to whom the Software is 11 # furnished to do so, subject to the following conditions: 12 # 13 # The above copyright notice and this permission notice shall be included in 14 # all copies or substantial portions of the Software. 15 # 16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 # THE SOFTWARE. 23 24 # This is a one-off test rule. 25 26 set -eu 27 28 echo findProvider special:ekam-interceptor 29 read INTERCEPTOR 30 31 if test "$INTERCEPTOR" = ""; then 32 echo "error: couldn't find intercept.so." >&2 33 exit 1 34 fi 35 36 echo findProvider file:capnp 37 read CAPNP 38 39 if test "$CAPNP" = ""; then 40 echo "error: couldn't find capnp." >&2 41 exit 1 42 fi 43 44 echo findProvider file:capnpc-c++ 45 read CAPNPC_CXX 46 47 if test "$CAPNPC_CXX" = ""; then 48 echo "error: couldn't find capnpc-c++." >&2 49 exit 1 50 fi 51 52 mkdir -p tmp/capnp/bootstrap-test-tmp 53 54 INPUTS="capnp/c++.capnp capnp/schema.capnp capnp/stream.capnp capnp/compiler/lexer.capnp \ 55 capnp/compiler/grammar.capnp capnp/rpc.capnp capnp/rpc-twoparty.capnp capnp/persistent.capnp \ 56 capnp/compat/json.capnp" 57 58 SRC_INPUTS="" 59 for file in $INPUTS; do 60 echo findProvider file:$file 61 read srcfile 62 SRC_INPUTS="$SRC_INPUTS $srcfile" 63 done 64 65 $CAPNP compile --src-prefix=src -Isrc --no-standard-import \ 66 -o$CAPNPC_CXX:tmp/capnp/bootstrap-test-tmp $SRC_INPUTS 67 68 for file in $INPUTS; do 69 for ext in h c++; do 70 echo findProvider file:$file.$ext 71 read srcfile 72 test "x$srcfile" != x || (echo "missing: $file.$ext" >&2 && exit 1) 73 diff -u $srcfile tmp/capnp/bootstrap-test-tmp/$file.$ext >&2 74 done 75 done 76 77 echo passed