Skip to content

Commit

Permalink
promote unit tests to a top-level directory, delete some old unused t…
Browse files Browse the repository at this point in the history
…est scripts, fix py3k compat in tests

git-svn-id: https://xpra.org/svn/Xpra/trunk@13941 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 30, 2016
1 parent 1595ea1 commit b91dfab
Show file tree
Hide file tree
Showing 38 changed files with 73 additions and 424 deletions.
21 changes: 11 additions & 10 deletions rpmbuild/xpra.spec
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,9 @@ BuildRequires: x264-xpra-devel
BuildRequires: xvidcore-devel
BuildRequires: ffmpeg-xpra-devel
BuildRequires: desktop-file-utils
#needed for running tests
%if 0%{?run_tests}
BuildRequires: %{numpy}
%endif
Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils
Requires: %{requires_crypto}
Expand Down Expand Up @@ -352,15 +353,15 @@ mv $RPM_BUILD_DIR/xpra-%{version} $RPM_BUILD_DIR/xpra-%{version}-python3
pushd xpra-%{version}-python3
rm -rf build install
# set pkg_config_path for xpra video libs:
CFLAGS="%{CFLAGS}" LDFLAGS="%{LDFLAGS}" %{__python3} setup.py build %{build_args} --with-tests --pkg-config-path=%{_libdir}/xpra/pkgconfig
%{__python3} setup.py build %{build_args} --with-tests
CFLAGS="%{CFLAGS}" LDFLAGS="%{LDFLAGS}" %{__python3} setup.py build %{build_args} --pkg-config-path=%{_libdir}/xpra/pkgconfig
%{__python3} setup.py build %{build_args}
popd
%endif

pushd xpra-%{version}-python2
rm -rf build install
# set pkg_config_path for xpra video libs
CFLAGS="%{CFLAGS}" LDFLAGS="%{LDFLAGS}" %{__python2} setup.py build %{build_args} --with-tests --pkg-config-path=%{_libdir}/xpra/pkgconfig
CFLAGS="%{CFLAGS}" LDFLAGS="%{LDFLAGS}" %{__python2} setup.py build %{build_args} --pkg-config-path=%{_libdir}/xpra/pkgconfig
%if 0%{?with_selinux}
pushd selinux/cups_xpra
for selinuxvariant in %{selinux_variants}
Expand Down Expand Up @@ -400,8 +401,8 @@ find %{buildroot}%{_datadir}/xpra/www/include -name '*.js' -exec chmod 0644 {} \

#remove the tests, not meant to be installed in the first place
#(but I can't get distutils to play nice: I want them built, not installed)
rm -fr ${RPM_BUILD_ROOT}/%{python2_sitearch}/tests
rm -fr ${RPM_BUILD_ROOT}/%{python3_sitearch}/tests
rm -fr ${RPM_BUILD_ROOT}/%{python2_sitearch}/unit
rm -fr ${RPM_BUILD_ROOT}/%{python3_sitearch}/unit


%clean
Expand Down Expand Up @@ -460,13 +461,13 @@ rm -rf $RPM_BUILD_ROOT
/usr/bin/desktop-file-validate %{buildroot}%{_datadir}/applications/xpra.desktop

%if 0%{?run_tests}
pushd xpra-%{version}-python2/tests
PYTHONPATH=%{buildroot}%{python2_sitearch}:. %{__python2} unit/run.py
pushd xpra-%{version}-python2/
PYTHONPATH=%{buildroot}%{python2_sitearch}:. %{__python2} ./unit/run.py
popd

%if 0%{?with_python3}
pushd xpra-%{version}-python3/tests
PYTHONPATH=%{buildroot}%{python3_sitearch}:. %{__python3} unit/run.py
pushd xpra-%{version}-python3/
PYTHONPATH=%{buildroot}%{python3_sitearch}:. %{__python3} ./unit/run.py
popd
%endif
%endif
Expand Down
8 changes: 4 additions & 4 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def is_msvc():

vsock_ENABLED = sys.platform.startswith("linux") and os.path.exists("/usr/include/linux/vm_sockets.h")
bencode_ENABLED = DEFAULT
cython_bencode_ENABLED = DEFAULT
cython_bencode_ENABLED = DEFAULT and not PYTHON3
clipboard_ENABLED = DEFAULT and not PYTHON3
Xdummy_ENABLED = None #None means auto-detect
Xdummy_wrapper_ENABLED = None #None means auto-detect
Expand Down Expand Up @@ -1985,15 +1985,15 @@ def osx_pkgconfig(*pkgs_options, **ekw):


#build tests, but don't install them:
toggle_packages(tests_ENABLED, "tests/unit")
toggle_packages(tests_ENABLED, "unit")


if bundle_tests_ENABLED:
#bundle the tests directly (not in library.zip):
for k,v in glob_recurse("tests").items():
for k,v in glob_recurse("unit").items():
if (k!=""):
k = os.sep+k
add_data_files("tests"+k, v)
add_data_files("unit"+k, v)

#python-cryptography needs workarounds for bundling:
if crypto_ENABLED and (OSX or WIN32):
Expand Down
3 changes: 0 additions & 3 deletions src/tests/__init__.py

This file was deleted.

10 changes: 0 additions & 10 deletions src/tests/run-tests

This file was deleted.

Loading

0 comments on commit b91dfab

Please sign in to comment.