David Reiss | c6fc329 | 2007-08-30 00:58:43 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | rm -rf gen-py |
David Reiss | 0c87ad4 | 2008-12-02 02:11:13 +0000 | [diff] [blame] | 4 | ../../../compiler/cpp/thrift --gen py test1.thrift || exit 1 |
| 5 | ../../../compiler/cpp/thrift --gen py test2.thrift || exit 1 |
David Reiss | c6fc329 | 2007-08-30 00:58:43 +0000 | [diff] [blame] | 6 | PYTHONPATH=./gen-py python -c 'import foo.bar.baz' || exit 1 |
| 7 | PYTHONPATH=./gen-py python -c 'import test2' || exit 1 |
| 8 | PYTHONPATH=./gen-py python -c 'import test1' &>/dev/null && exit 1 # Should fail. |
| 9 | cp -r gen-py simple |
David Reiss | 0c87ad4 | 2008-12-02 02:11:13 +0000 | [diff] [blame] | 10 | ../../../compiler/cpp/thrift -r --gen py test2.thrift || exit 1 |
David Reiss | c6fc329 | 2007-08-30 00:58:43 +0000 | [diff] [blame] | 11 | PYTHONPATH=./gen-py python -c 'import test2' || exit 1 |
| 12 | diff -ur simple gen-py > thediffs |
| 13 | file thediffs | grep -s -q empty || exit 1 |
| 14 | rm -rf simple thediffs |
| 15 | echo 'All tests pass!' |