0
私はAutotoolsが新しく、Autestoolsを使用しているプロジェクトにgtestユニットテストを追加しようとしています。他の変数に依存するautomakeの汎用SOURCES定義
私はシンプルなディレクトリ構造を有する: -
./src
メイン - ソース
./tests
から
.
テストを
./paths
- tests
ディレクトリにパス
私がテストしたクラスごとに1つのcppのファイルを持っているとしてgitのサブモジュール私のMakefile.am
は次のようになります:
AUTOMAKE_OPTIONS = serial-tests
AM_CXXFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/paths -DUNIT_TEST
AM_LDFLAGS = -pthread
LDADD = -lgtest -lgtest_main
TESTS = test_networkconfig test_dummy ### depending on content of this variable
check_PROGRAMS = $(TESTS)
test_networkconfig_SOURCES = test_networkconfig.cpp ### generate this
test_networkconfig_LDADD = $(top_srcdir)/src/networkconfig.o \
-lgtest \
-lgtest_main
test_networkconfig_CPPFLAGS = $(somelibrary_CFLAGS)
test_dummy_SOURCES = test_dummy.cpp ### and this variable
私が自動的に生成したいと思います:
test_networkconfig_SOURCES = test_networkconfig.cpp
test_dummy_SOURCES = test_dummy.cpp
はTESTS
変数によって保持されている各値の変数<some_name>_SOURCES = <some_name>.cpp
を作成する方法はありますか?