diff options
| author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-02-03 11:00:27 -0500 |
|---|---|---|
| committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-02-09 20:36:50 -0500 |
| commit | a6fcd567f6aa01746471fd639db63fecadbf166b (patch) | |
| tree | bcdc273c61aa32335b6733cc0e560ae3ec69e429 /test | |
| parent | 2a9f934aae45b7d4fab93ccbd761d39600bdf385 (diff) | |
| download | phosphor-inventory-manager-a6fcd567f6aa01746471fd639db63fecadbf166b.tar.gz phosphor-inventory-manager-a6fcd567f6aa01746471fd639db63fecadbf166b.zip | |
build: split app/test pimgen invocation
Run pimgen twice, once for the application with the real YAML
and once for the testcase with the example YAML so that the
testcase can run and build sucessfully when an alternate YAML
tree is provided.
Move extra interface rule generation from pimgen to a makefile
generating script.
Change-Id: Ib0c01bd2207007b815019232a466fa16889f2005
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'test')
| -rw-r--r-- | test/.gitignore | 1 | ||||
| -rw-r--r-- | test/Makefile.am | 29 | ||||
| -rw-r--r-- | test/Makefile.extra.in | 1 | ||||
| -rw-r--r-- | test/test.cpp | 8 |
4 files changed, 30 insertions, 9 deletions
diff --git a/test/.gitignore b/test/.gitignore index 65c2e9e..1520cd8 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -1 +1,2 @@ phosphor-inventory-test +xyz diff --git a/test/Makefile.am b/test/Makefile.am index 1f6470d..07f8453 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,8 +1,27 @@ +BUILT_SOURCES=generated.cpp extra_ifaces.cpp +CLEANFILES=$(BUILT_SOURCES) + +AM_CPPFLAGS = -iquote$(top_srcdir) + check_PROGRAMS = noinst_PROGRAMS = phosphor-inventory-test +noinst_LTLIBRARIES = libtest.la + +extra_yamldir=$(top_srcdir)/example/extra_interfaces.d + +phosphor_inventory_test_SOURCES = test.cpp +phosphor_inventory_test_LDADD = libtest.la +phosphor_inventory_test_LDFLAGS = $(SDBSUPLUS_LIBS) $(PTHREAD_CFLAGS) +phosphor_inventory_test_CFLAGS = $(SDBUSPLUS_CFLAGS) + +libtest_la_SOURCES = \ + extra_ifaces.cpp \ + generated.cpp +libtest_la_LIBADD = $(top_builddir)/libmanagercommon.la $(SDBUSPLUS_LIBS) + +clean-local: clean-extra + +generated.cpp: + $(AM_V_GEN)$(PYTHON) $(top_srcdir)/pimgen.py -d $(extra_yamldir)/.. -o $(builddir) generate-cpp -phosphor_inventory_test_SOURCES = \ - test.cpp -phosphor_inventory_test_LDFLAGS = $(SYSTEMD_LIBS) $(PTHREAD_CFLAGS) -phosphor_inventory_test_CFLAGS = $(SYSTEMD_CFLAGS) -phosphor_inventory_test_LDADD = ${top_builddir}/libmanager.la +-include Makefile.extra diff --git a/test/Makefile.extra.in b/test/Makefile.extra.in new file mode 100644 index 0000000..128a178 --- /dev/null +++ b/test/Makefile.extra.in @@ -0,0 +1 @@ +# Empty file so that 'configure' attempts to generate Makefile.extra. diff --git a/test/test.cpp b/test/test.cpp index 3f39fa9..6ffad51 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "../manager.hpp" -#include "../config.h" +#include "manager.hpp" +#include "config.h" #include <cassert> #include <iostream> #include <algorithm> #include <thread> #include <chrono> -#include <xyz/openbmc_project/Example/Iface1/server.hpp> -#include <xyz/openbmc_project/Example/Iface2/server.hpp> +#include "xyz/openbmc_project/Example/Iface1/server.hpp" +#include "xyz/openbmc_project/Example/Iface2/server.hpp" using namespace std::literals::chrono_literals; using namespace std::literals::string_literals; |

