mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 18:58:51 +00:00
c6fc329a40
Summary: Previously, Thrift used the name of the .thrift file as the python module name. This wasn't very flexible. Now the python module can be explicitly declared. Also, there was no need for t_py_generator to inherit from t_oop_generator. Reviewed By: mcslee Test Plan: cd test/py/explicit_module ./runtest.sh Revert Plan: ok git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665234 13f79535-47bb-0310-9956-ffa450edef68
16 lines
595 B
Bash
Executable File
16 lines
595 B
Bash
Executable File
#!/bin/bash
|
|
|
|
rm -rf gen-py
|
|
../../../compiler/cpp/thrift -py test1.thrift || exit 1
|
|
../../../compiler/cpp/thrift -py test2.thrift || exit 1
|
|
PYTHONPATH=./gen-py python -c 'import foo.bar.baz' || exit 1
|
|
PYTHONPATH=./gen-py python -c 'import test2' || exit 1
|
|
PYTHONPATH=./gen-py python -c 'import test1' &>/dev/null && exit 1 # Should fail.
|
|
cp -r gen-py simple
|
|
../../../compiler/cpp/thrift -r -py test2.thrift || exit 1
|
|
PYTHONPATH=./gen-py python -c 'import test2' || exit 1
|
|
diff -ur simple gen-py > thediffs
|
|
file thediffs | grep -s -q empty || exit 1
|
|
rm -rf simple thediffs
|
|
echo 'All tests pass!'
|