From 1dcec992ea036f56dd03a57e1dfc34977e6e8bda Mon Sep 17 00:00:00 2001 From: Helin Wang Date: Mon, 13 Nov 2017 15:35:12 -0800 Subject: [PATCH] Move the tests of book chapters from test/ into tests/book --- python/paddle/v2/framework/tests/CMakeLists.txt | 2 ++ python/paddle/v2/framework/tests/book/CMakeLists.txt | 5 +++++ .../paddle/v2/framework/tests/{ => book}/test_fit_a_line.py | 0 .../tests/{ => book}/test_image_classification_train.py | 0 .../framework/tests/{ => book}/test_recognize_digits_conv.py | 0 .../framework/tests/{ => book}/test_recognize_digits_mlp.py | 0 .../v2/framework/tests/{ => book}/test_recommender_system.py | 0 .../tests/{ => book}/test_understand_sentiment_conv.py | 0 .../{ => book}/test_understand_sentiment_dynamic_lstm.py | 0 .../tests/{ => book}/test_understand_sentiment_lstm.py | 0 python/paddle/v2/framework/tests/{ => book}/test_word2vec.py | 0 11 files changed, 7 insertions(+) create mode 100644 python/paddle/v2/framework/tests/book/CMakeLists.txt rename python/paddle/v2/framework/tests/{ => book}/test_fit_a_line.py (100%) rename python/paddle/v2/framework/tests/{ => book}/test_image_classification_train.py (100%) rename python/paddle/v2/framework/tests/{ => book}/test_recognize_digits_conv.py (100%) rename python/paddle/v2/framework/tests/{ => book}/test_recognize_digits_mlp.py (100%) rename python/paddle/v2/framework/tests/{ => book}/test_recommender_system.py (100%) rename python/paddle/v2/framework/tests/{ => book}/test_understand_sentiment_conv.py (100%) rename python/paddle/v2/framework/tests/{ => book}/test_understand_sentiment_dynamic_lstm.py (100%) rename python/paddle/v2/framework/tests/{ => book}/test_understand_sentiment_lstm.py (100%) rename python/paddle/v2/framework/tests/{ => book}/test_word2vec.py (100%) diff --git a/python/paddle/v2/framework/tests/CMakeLists.txt b/python/paddle/v2/framework/tests/CMakeLists.txt index 4d7664469..e795627bf 100644 --- a/python/paddle/v2/framework/tests/CMakeLists.txt +++ b/python/paddle/v2/framework/tests/CMakeLists.txt @@ -3,3 +3,5 @@ string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}") foreach(src ${TEST_OPS}) py_test(${src} SRCS ${src}.py) endforeach() + +add_subdirectory(book) diff --git a/python/paddle/v2/framework/tests/book/CMakeLists.txt b/python/paddle/v2/framework/tests/book/CMakeLists.txt new file mode 100644 index 000000000..4d7664469 --- /dev/null +++ b/python/paddle/v2/framework/tests/book/CMakeLists.txt @@ -0,0 +1,5 @@ +file(GLOB TEST_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_*.py") +string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}") +foreach(src ${TEST_OPS}) + py_test(${src} SRCS ${src}.py) +endforeach() diff --git a/python/paddle/v2/framework/tests/test_fit_a_line.py b/python/paddle/v2/framework/tests/book/test_fit_a_line.py similarity index 100% rename from python/paddle/v2/framework/tests/test_fit_a_line.py rename to python/paddle/v2/framework/tests/book/test_fit_a_line.py diff --git a/python/paddle/v2/framework/tests/test_image_classification_train.py b/python/paddle/v2/framework/tests/book/test_image_classification_train.py similarity index 100% rename from python/paddle/v2/framework/tests/test_image_classification_train.py rename to python/paddle/v2/framework/tests/book/test_image_classification_train.py diff --git a/python/paddle/v2/framework/tests/test_recognize_digits_conv.py b/python/paddle/v2/framework/tests/book/test_recognize_digits_conv.py similarity index 100% rename from python/paddle/v2/framework/tests/test_recognize_digits_conv.py rename to python/paddle/v2/framework/tests/book/test_recognize_digits_conv.py diff --git a/python/paddle/v2/framework/tests/test_recognize_digits_mlp.py b/python/paddle/v2/framework/tests/book/test_recognize_digits_mlp.py similarity index 100% rename from python/paddle/v2/framework/tests/test_recognize_digits_mlp.py rename to python/paddle/v2/framework/tests/book/test_recognize_digits_mlp.py diff --git a/python/paddle/v2/framework/tests/test_recommender_system.py b/python/paddle/v2/framework/tests/book/test_recommender_system.py similarity index 100% rename from python/paddle/v2/framework/tests/test_recommender_system.py rename to python/paddle/v2/framework/tests/book/test_recommender_system.py diff --git a/python/paddle/v2/framework/tests/test_understand_sentiment_conv.py b/python/paddle/v2/framework/tests/book/test_understand_sentiment_conv.py similarity index 100% rename from python/paddle/v2/framework/tests/test_understand_sentiment_conv.py rename to python/paddle/v2/framework/tests/book/test_understand_sentiment_conv.py diff --git a/python/paddle/v2/framework/tests/test_understand_sentiment_dynamic_lstm.py b/python/paddle/v2/framework/tests/book/test_understand_sentiment_dynamic_lstm.py similarity index 100% rename from python/paddle/v2/framework/tests/test_understand_sentiment_dynamic_lstm.py rename to python/paddle/v2/framework/tests/book/test_understand_sentiment_dynamic_lstm.py diff --git a/python/paddle/v2/framework/tests/test_understand_sentiment_lstm.py b/python/paddle/v2/framework/tests/book/test_understand_sentiment_lstm.py similarity index 100% rename from python/paddle/v2/framework/tests/test_understand_sentiment_lstm.py rename to python/paddle/v2/framework/tests/book/test_understand_sentiment_lstm.py diff --git a/python/paddle/v2/framework/tests/test_word2vec.py b/python/paddle/v2/framework/tests/book/test_word2vec.py similarity index 100% rename from python/paddle/v2/framework/tests/test_word2vec.py rename to python/paddle/v2/framework/tests/book/test_word2vec.py -- GitLab