From e552688b70889a4879ef16ce38bc8c95e6f447c7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 19 Sep 2012 14:35:36 -0500 Subject: Steal a bunch of test infrastructure from libpam-icaclient --- tests/Makefile.am | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 tests/Makefile.am (limited to 'tests/Makefile.am') diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..e687799 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,65 @@ +CLEANFILES = +DISTCLEANFILES = +EXTRA_DIST = + +TESTS = \ + test-auth-check \ + test-icaclient-wrapper + +check_PROGRAMS = $(TESTS) + +########################## +# Google Test Test Suite # +########################## +check_LIBRARIES = libgtest.a + +AM_CPPFLAGS = $(GTEST_CPPFLAGS) \ + $(REMOTE_APPS_MANAGER_CFLAGS) \ + -I${top_srcdir}/src -Wall -Werror +AM_CXXFLAGS = $(GTEST_CXXFLAGS) \ + $(REMOTE_APPS_MANAGER_CFLAGS) + +AM_CFLAGS = \ + -Wall \ + -g + +nodist_libgtest_a_SOURCES = \ + $(GTEST_SOURCE)/src/gtest-all.cc \ + $(GTEST_SOURCE)/src/gtest_main.cc + +libgtest_a_CPPFLAGS = \ + $(GTEST_CPPFLAGS) -w \ + $(AM_CPPFLAGS) +libgtest_a_CXXFLAGS = \ + $(AM_CXXFLAGS) + +test_auth_check_SOURCES = \ + test-auth-check.cc + +test_auth_check_LDADD = \ + $(top_builddir)/src/pam_ica.la \ + libgtest.a + +test_auth_check_CXXFLAGS = \ + $(AM_CXXFLAGS) \ + -I${top_srcdir}/src + +test_auth_check_LDFLAGS = \ + -pthread + +test_icaclient_wrapper_SOURCES = \ + mock_pam.c \ + mock_guest.c \ + test-icaclient-wrapper.cc + +test_icaclient_wrapper_LDADD = \ + $(top_builddir)/src/pam_ica.la \ + libgtest.a + +test_icaclient_wrapper_CXXFLAGS = \ + $(AM_CXXFLAGS) \ + -I${top_srcdir}/src + +test_icaclient_wrapper_LDFLAGS = \ + -pthread + -- cgit v1.2.3 From 01847ab5a61a22986301ea0b9246f3f107786a51 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 19 Sep 2012 15:33:38 -0500 Subject: Clean up Makefile and add proper files --- tests/Makefile.am | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) (limited to 'tests/Makefile.am') diff --git a/tests/Makefile.am b/tests/Makefile.am index e687799..49f1701 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -3,16 +3,10 @@ DISTCLEANFILES = EXTRA_DIST = TESTS = \ - test-auth-check \ - test-icaclient-wrapper + test-freerdpclient-wrapper check_PROGRAMS = $(TESTS) -########################## -# Google Test Test Suite # -########################## -check_LIBRARIES = libgtest.a - AM_CPPFLAGS = $(GTEST_CPPFLAGS) \ $(REMOTE_APPS_MANAGER_CFLAGS) \ -I${top_srcdir}/src -Wall -Werror @@ -23,6 +17,12 @@ AM_CFLAGS = \ -Wall \ -g +########################## +# Google Test Test Suite # +########################## + +check_LIBRARIES = libgtest.a + nodist_libgtest_a_SOURCES = \ $(GTEST_SOURCE)/src/gtest-all.cc \ $(GTEST_SOURCE)/src/gtest_main.cc @@ -33,33 +33,23 @@ libgtest_a_CPPFLAGS = \ libgtest_a_CXXFLAGS = \ $(AM_CXXFLAGS) -test_auth_check_SOURCES = \ - test-auth-check.cc - -test_auth_check_LDADD = \ - $(top_builddir)/src/pam_ica.la \ - libgtest.a - -test_auth_check_CXXFLAGS = \ - $(AM_CXXFLAGS) \ - -I${top_srcdir}/src - -test_auth_check_LDFLAGS = \ - -pthread +########################## +# Wrapper +########################## -test_icaclient_wrapper_SOURCES = \ +test_freerdpclient_wrapper_SOURCES = \ mock_pam.c \ mock_guest.c \ - test-icaclient-wrapper.cc + test-freerdp-wrapper.cc -test_icaclient_wrapper_LDADD = \ - $(top_builddir)/src/pam_ica.la \ +test_freerdpclient_wrapper_LDADD = \ + $(top_builddir)/src/pam_freerdp.la \ libgtest.a -test_icaclient_wrapper_CXXFLAGS = \ +test_freerdpclient_wrapper_CXXFLAGS = \ $(AM_CXXFLAGS) \ -I${top_srcdir}/src -test_icaclient_wrapper_LDFLAGS = \ +test_freerdpclient_wrapper_LDFLAGS = \ -pthread -- cgit v1.2.3 From b01690eee03b89b04cbccbf111a67d9e270d7149 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 19 Sep 2012 15:34:58 -0500 Subject: Make sure to distribute the header files --- tests/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/Makefile.am') diff --git a/tests/Makefile.am b/tests/Makefile.am index 49f1701..c5da385 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -38,8 +38,8 @@ libgtest_a_CXXFLAGS = \ ########################## test_freerdpclient_wrapper_SOURCES = \ - mock_pam.c \ - mock_guest.c \ + mock_pam.c mock_pam.h \ + mock_guest.c mock_guest.h \ test-freerdp-wrapper.cc test_freerdpclient_wrapper_LDADD = \ -- cgit v1.2.3 From d7705fcc79144eb895a8ebc04dd5561f3c8afd70 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 19 Sep 2012 16:42:55 -0500 Subject: Set everything up so that the auth check binary can be different in the tests --- tests/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/Makefile.am') diff --git a/tests/Makefile.am b/tests/Makefile.am index c5da385..4e51e62 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -43,7 +43,7 @@ test_freerdpclient_wrapper_SOURCES = \ test-freerdp-wrapper.cc test_freerdpclient_wrapper_LDADD = \ - $(top_builddir)/src/pam_freerdp.la \ + $(top_builddir)/src/libfreerdpcore.la \ libgtest.a test_freerdpclient_wrapper_CXXFLAGS = \ -- cgit v1.2.3 From a2d6c7eed22dafba1350d97471304d30046b99cc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 19 Sep 2012 16:59:53 -0500 Subject: Adding a small auth check utility --- tests/Makefile.am | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'tests/Makefile.am') diff --git a/tests/Makefile.am b/tests/Makefile.am index 4e51e62..b7c39f0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -3,9 +3,11 @@ DISTCLEANFILES = EXTRA_DIST = TESTS = \ - test-freerdpclient-wrapper + test-freerdpclient-wrapper -check_PROGRAMS = $(TESTS) +check_PROGRAMS = \ + test-freerdp-auth \ + $(TESTS) AM_CPPFLAGS = $(GTEST_CPPFLAGS) \ $(REMOTE_APPS_MANAGER_CFLAGS) \ @@ -37,6 +39,8 @@ libgtest_a_CXXFLAGS = \ # Wrapper ########################## +test_freerdp_wrapper: test-freerdp-auth + test_freerdpclient_wrapper_SOURCES = \ mock_pam.c mock_pam.h \ mock_guest.c mock_guest.h \ @@ -53,3 +57,10 @@ test_freerdpclient_wrapper_CXXFLAGS = \ test_freerdpclient_wrapper_LDFLAGS = \ -pthread +########################## +# Auth tool +########################## + +test_freerdp_auth_SOURCES = \ + test-freerdp-auth.c + -- cgit v1.2.3 From 7d6377d559133048ddb17d39be6395b6c2281a19 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 19 Sep 2012 17:01:11 -0500 Subject: Make the auth use the auth check utility --- tests/Makefile.am | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/Makefile.am') diff --git a/tests/Makefile.am b/tests/Makefile.am index b7c39f0..56fe7b9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -52,6 +52,7 @@ test_freerdpclient_wrapper_LDADD = \ test_freerdpclient_wrapper_CXXFLAGS = \ $(AM_CXXFLAGS) \ + -DAUTH_CHECK="\"$(builddir)/test-freerdp-auth\"" \ -I${top_srcdir}/src test_freerdpclient_wrapper_LDFLAGS = \ -- cgit v1.2.3 From 976901cfca791d661f79cc5ac4e54c5d1d36805b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 19 Sep 2012 23:29:18 -0500 Subject: Make sure we have the full path to execute the auth check --- tests/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/Makefile.am') diff --git a/tests/Makefile.am b/tests/Makefile.am index 56fe7b9..c257ac9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -52,7 +52,7 @@ test_freerdpclient_wrapper_LDADD = \ test_freerdpclient_wrapper_CXXFLAGS = \ $(AM_CXXFLAGS) \ - -DAUTH_CHECK="\"$(builddir)/test-freerdp-auth\"" \ + -DAUTH_CHECK="\"$(abs_builddir)/test-freerdp-auth\"" \ -I${top_srcdir}/src test_freerdpclient_wrapper_LDFLAGS = \ -- cgit v1.2.3