mirror of
https://github.com/macports/macports-user-wms.git
synced 2026-07-13 03:18:37 -07:00
Branch into /users/wms/
git-svn-id: https://svn.macports.org/repository/macports/users/wms@97674 d073be05-634f-4543-b044-5fe20cf6d1d6
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
include ../Mk/macports.autoconf.mk
|
||||
|
||||
TESTS?=checksums-1 svn-and-patchsites envvariables site-tags trace universal universal-2 xcodeversion dependencies-c dependencies-d dependencies-e case-insensitive-deactivate variants statefile-version1 statefile-version1-outdated statefile-version2 statefile-version2-outdated statefile-version2-invalid statefile-unknown-version
|
||||
|
||||
PWD=$(shell pwd)
|
||||
|
||||
.PHONY: all clean install test PortIndex
|
||||
|
||||
all::
|
||||
|
||||
/tmp/macports-tests/opt/local/etc/macports/sources.conf: sources.conf
|
||||
@echo setting up test installation
|
||||
rm -rf /tmp/macports-tests/
|
||||
mkdir -p /tmp/macports-tests/ports
|
||||
mkdir -p /tmp/macports-tests/opt/local/etc/macports/
|
||||
mkdir -p /tmp/macports-tests/opt/local/share/
|
||||
mkdir -p /tmp/macports-tests/opt/local/var/macports/receipts/
|
||||
mkdir -p /tmp/macports-tests/opt/local/var/macports/registry/
|
||||
mkdir -p /tmp/macports-tests/opt/local/var/macports/build/
|
||||
ln -s $(datadir)/macports /tmp/macports-tests/opt/local/share/
|
||||
ln -s $(PWD)/test /tmp/macports-tests/ports/
|
||||
cp sources.conf /tmp/macports-tests/opt/local/etc/macports/
|
||||
|
||||
/tmp/macports-tests/ports/PortIndex: /tmp/macports-tests/opt/local/etc/macports/sources.conf PortIndex
|
||||
cp PortIndex PortIndex.quick /tmp/macports-tests/ports/
|
||||
|
||||
PortIndex:
|
||||
$(bindir)/portindex
|
||||
|
||||
clean::
|
||||
rm -rf /tmp/macports-tests/
|
||||
rm -f PortIndex PortIndex.quick
|
||||
for testname in $(TESTS); do \
|
||||
rm -f test/$$testname/{output,output.sed,difference,work}; \
|
||||
done
|
||||
|
||||
$(bindir)/port:
|
||||
@echo "Please install MacPorts before running these tests"
|
||||
@exit 1
|
||||
|
||||
# Run all tests
|
||||
# Use TESTS to choose which tests to run
|
||||
# For example: make test TESTS="checkums-1 universal"
|
||||
test:: clean /tmp/macports-tests/ports/PortIndex /tmp/macports-tests/opt/local/etc/macports/sources.conf
|
||||
@num=0; \
|
||||
success=0; \
|
||||
for testname in $(TESTS); do\
|
||||
subdir=test/$$testname; \
|
||||
echo ===\> test ${DIRPRFX}$$subdir; \
|
||||
if [ -e $$subdir/Makefile ]; then \
|
||||
( cd $$subdir && \
|
||||
$(MAKE) DIRPRFX=${DIRPRFX}$$subdir/ PORTSRC=$(PWD)/test-macports.conf test) && \
|
||||
success=$$(( success + 1 )); \
|
||||
else \
|
||||
( cd $$subdir && \
|
||||
PORTSRC=$(PWD)/test-macports.conf $(bindir)/port clean > /dev/null && \
|
||||
PORTSRC=$(PWD)/test-macports.conf $(bindir)/port test > output 2>&1 \
|
||||
|| ([ -e error_expected ] || (cat output; exit 1)) && \
|
||||
sed -e "s|${PWD}|PWD|g" < output > output.sed && \
|
||||
diff -u master output.sed 2>&1 | tee difference && \
|
||||
if [ -s difference ]; then \
|
||||
exit 1; \
|
||||
else \
|
||||
rm -f difference output.sed; \
|
||||
fi) && \
|
||||
success=$$(( success + 1 )); \
|
||||
if [ -n "`PORTSRC=$(PWD)/test-macports.conf $(bindir)/port -q echo installed`" ]; then \
|
||||
PORTSRC=$(PWD)/test-macports.conf $(bindir)/port -f clean --all installed > /dev/null && \
|
||||
PORTSRC=$(PWD)/test-macports.conf $(bindir)/port -f uninstall installed > /dev/null; \
|
||||
fi; \
|
||||
fi; \
|
||||
num=$$(( num + 1 )); \
|
||||
done; \
|
||||
echo ===\> $$success of $$num tests passed.
|
||||
@rm -rf /tmp/macports-tests/
|
||||
@rm -f PortIndex PortIndex.quick
|
||||
|
||||
# Run specific test
|
||||
# Prepend the directory name with "test-" and use it as target
|
||||
# For example: make test-checksums-1
|
||||
test-%:
|
||||
$(MAKE) TESTS="$(@:test-%=%)" test
|
||||
|
||||
install::
|
||||
|
||||
distclean:: clean
|
||||
@@ -0,0 +1,3 @@
|
||||
# To enable your local ports repository, uncomment and customize the
|
||||
# following line to point at your local ports directory
|
||||
file:///tmp/macports-tests/ports [default]
|
||||
@@ -0,0 +1,53 @@
|
||||
# MacPorts system wide configuration file, tests module
|
||||
# $Id$
|
||||
|
||||
# Set the directory in which to install ports
|
||||
prefix /tmp/macports-tests/opt/local
|
||||
|
||||
# Where to store MacPorts working data
|
||||
portdbpath /tmp/macports-tests/opt/local/var/macports
|
||||
|
||||
# Type of storage to use for the port registry information, "flat" or "sqlite"
|
||||
portdbformat sqlite
|
||||
|
||||
# Where to find the sources list.
|
||||
sources_conf /tmp/macports-tests/opt/local/etc/macports/sources.conf
|
||||
|
||||
# Where to find global variants definition file (optional)
|
||||
#variants_conf /opt/local/etc/macports/variants.conf
|
||||
|
||||
# Type of binary archive packages to create when using archive mode
|
||||
#
|
||||
# Note: Multiple types ARE allowed and must be a colon or comma
|
||||
# separated list of choices (NO spaces). Use of multiple types will
|
||||
# cause archive creation to build all the specified types in one step.
|
||||
# Unarchive uses multiple types as a search list to locate the archive,
|
||||
# first archive to match one of the specified types in order is used.
|
||||
#
|
||||
# Supported types: tgz (default), tar, tbz, tbz2, xar, zip, cpgz, cpio
|
||||
portarchivetype tbz
|
||||
|
||||
# Set whether to automatically execute "clean" after "install" of ports
|
||||
portautoclean yes
|
||||
|
||||
# Rsync server to fetch MacPorts sources from
|
||||
rsync_server rsync.macports.org
|
||||
|
||||
# Rsync directory from which to pull the base/ component (infrastructure) of MacPorts
|
||||
rsync_dir release/base/
|
||||
|
||||
# Rsync options
|
||||
rsync_options -rtzv --delete-after
|
||||
|
||||
# Options for generated startup items
|
||||
# startupitem_type may be "default", "systemstarter", or "launchd";
|
||||
# if the option is empty or "default" then a startupitem type appropriate
|
||||
# to the platform will be chosen. Tiger will default to launchd, while
|
||||
# older Mac OS X systems will default to systemstarter.
|
||||
startupitem_type default
|
||||
|
||||
# Extra environment variables to keep. Any variables listed here are added
|
||||
# to the list of variables that are not removed from the environment used
|
||||
# while processing ports
|
||||
# extra_env KEEP_THIS THIS_TOO
|
||||
extra_env ENVA ENVB
|
||||
@@ -0,0 +1,31 @@
|
||||
include ../../../Mk/macports.autoconf.mk
|
||||
|
||||
# see test-macports.conf for the value of prefix
|
||||
TESTFILE=/tmp/macports-tests/opt/local/var/test/case
|
||||
TESTPORT1=casesensitive
|
||||
TESTPORT2=CaseSensitivE
|
||||
|
||||
.PHONY: test
|
||||
|
||||
$(bindir)/port:
|
||||
@echo "Please install MacPorts before running this test"
|
||||
@exit 1
|
||||
|
||||
test:
|
||||
@echo port install $(TESTPORT1)
|
||||
@sed 's/@name@/$(TESTPORT1)/' Portfile.in > Portfile
|
||||
@PORTSRC=$(PORTSRC) $(bindir)/port install > output 2>&1 || (cat output; exit 1)
|
||||
@if [ ! -f $(TESTFILE) ]; then \
|
||||
echo "FAILED: File should exist after install: $(TESTFILE)" && exit 1; \
|
||||
fi
|
||||
@echo port uninstall $(TESTPORT2)
|
||||
@sed 's/@name@/$(TESTPORT2)/' Portfile.in > Portfile
|
||||
@PORTSRC=$(PORTSRC) $(bindir)/port uninstall > output 2>&1 || (cat output; exit 1)
|
||||
@if [ -f $(TESTFILE) ]; then \
|
||||
rm $(TESTFILE); \
|
||||
echo "FAILED: File should NOT exist after uninstall: $(TESTFILE)" && exit 1; \
|
||||
else \
|
||||
echo "SUCCESS!"; \
|
||||
fi
|
||||
rm Portfile
|
||||
rm output
|
||||
@@ -0,0 +1,21 @@
|
||||
# $Id$
|
||||
|
||||
PortSystem 1.0
|
||||
|
||||
name @name@
|
||||
version 1
|
||||
categories test
|
||||
maintainers raimue
|
||||
description Test port for case sensitive port uninstalls
|
||||
homepage http://www.macports.org/
|
||||
platforms darwin
|
||||
|
||||
long_description ${description}
|
||||
|
||||
distfiles
|
||||
use_configure no
|
||||
build {}
|
||||
destroot {
|
||||
xinstall -d ${destroot}${prefix}/var/test
|
||||
system "touch ${destroot}${prefix}/var/test/case"
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
See ticket #11759,
|
||||
https://trac.macports.org/ticket/11759
|
||||
@@ -0,0 +1,35 @@
|
||||
# $Id$
|
||||
|
||||
PortSystem 1.0
|
||||
name checksum
|
||||
version 1
|
||||
categories test
|
||||
maintainers opendarwin.org@darkart.com
|
||||
description Test port for checksum functionalities
|
||||
homepage http://www.macports.org/
|
||||
platforms darwin
|
||||
|
||||
long_description ${description}
|
||||
|
||||
master_sites file:///dev/null
|
||||
|
||||
fetch {
|
||||
system "mkdir -p $distpath"
|
||||
system "cat /dev/null > $distpath/$distname.tar.gz"
|
||||
}
|
||||
|
||||
checksums \
|
||||
md5 d41d8cd98f00b204e9800998ecf8427e \
|
||||
sha1 da39a3ee5e6b4b0d3255bfef95601890afd80709 \
|
||||
rmd160 9c1185a5c5e9fc54612808977ee8f548b2258d31
|
||||
|
||||
extract {}
|
||||
configure {}
|
||||
build {}
|
||||
destroot {
|
||||
system "touch ${destroot}${prefix}/lib/${name}"
|
||||
}
|
||||
|
||||
test {
|
||||
# test is actually running checksum target
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
---> Fetching distfiles for checksum
|
||||
---> Verifying checksum(s) for checksum
|
||||
---> Extracting checksum
|
||||
---> Configuring checksum
|
||||
---> Building checksum
|
||||
---> Testing checksum
|
||||
@@ -0,0 +1,29 @@
|
||||
# $Id$
|
||||
|
||||
PortSystem 1.0
|
||||
name dependencies-a
|
||||
version 1
|
||||
categories test
|
||||
maintainers pguyot@kallisys.net
|
||||
description Test port for dependencies
|
||||
homepage http://www.macports.org/
|
||||
platforms darwin
|
||||
|
||||
long_description ${description}
|
||||
|
||||
distfiles
|
||||
use_configure no
|
||||
build {}
|
||||
destroot {
|
||||
system "touch ${destroot}${prefix}/lib/${name}"
|
||||
}
|
||||
|
||||
default_variants +i_want_b
|
||||
|
||||
variant i_want_b {
|
||||
depends_lib-append port:dependencies-b
|
||||
}
|
||||
|
||||
test {
|
||||
# testing consists in processing dependencies
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
# $Id$
|
||||
|
||||
PortSystem 1.0
|
||||
name dependencies-b
|
||||
version 1
|
||||
categories test
|
||||
maintainers pguyot@kallisys.net
|
||||
description Test port for dependencies
|
||||
homepage http://www.macports.org/
|
||||
platforms darwin
|
||||
|
||||
long_description ${description}
|
||||
|
||||
distfiles
|
||||
use_configure no
|
||||
build {}
|
||||
destroot {
|
||||
system "touch ${destroot}${prefix}/lib/${name}"
|
||||
}
|
||||
|
||||
test {
|
||||
# testing consists in processing dependencies
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
# $Id$
|
||||
|
||||
PortSystem 1.0
|
||||
name dependencies-c
|
||||
version 1
|
||||
categories test
|
||||
maintainers pguyot@kallisys.net
|
||||
description Test port for dependencies
|
||||
homepage http://www.macports.org/
|
||||
platforms darwin
|
||||
|
||||
long_description ${description}
|
||||
|
||||
distfiles
|
||||
use_configure no
|
||||
build {}
|
||||
destroot {
|
||||
system "touch ${destroot}${prefix}/lib/${name}"
|
||||
}
|
||||
|
||||
default_variants +i_want_a
|
||||
|
||||
variant i_want_a {
|
||||
depends_lib-append port:dependencies-a
|
||||
}
|
||||
|
||||
test {
|
||||
# testing consists in processing dependencies
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
---> Computing dependencies for dependencies-c
|
||||
---> Dependencies to be installed: dependencies-a dependencies-b
|
||||
---> Fetching distfiles for dependencies-b
|
||||
---> Verifying checksum(s) for dependencies-b
|
||||
---> Extracting dependencies-b
|
||||
---> Configuring dependencies-b
|
||||
---> Building dependencies-b
|
||||
---> Staging dependencies-b into destroot
|
||||
---> Installing dependencies-b @1_0
|
||||
---> Activating dependencies-b @1_0
|
||||
---> Cleaning dependencies-b
|
||||
---> Fetching distfiles for dependencies-a
|
||||
---> Verifying checksum(s) for dependencies-a
|
||||
---> Extracting dependencies-a
|
||||
---> Configuring dependencies-a
|
||||
---> Building dependencies-a
|
||||
---> Staging dependencies-a into destroot
|
||||
---> Installing dependencies-a @1_0+i_want_b
|
||||
---> Activating dependencies-a @1_0+i_want_b
|
||||
---> Cleaning dependencies-a
|
||||
---> Fetching distfiles for dependencies-c
|
||||
---> Verifying checksum(s) for dependencies-c
|
||||
---> Extracting dependencies-c
|
||||
---> Configuring dependencies-c
|
||||
---> Building dependencies-c
|
||||
---> Testing dependencies-c
|
||||
@@ -0,0 +1,31 @@
|
||||
# $Id$
|
||||
|
||||
PortSystem 1.0
|
||||
name dependencies-d
|
||||
version 1
|
||||
categories test
|
||||
maintainers pguyot@kallisys.net
|
||||
description Test port for dependencies
|
||||
homepage http://www.macports.org/
|
||||
platforms darwin
|
||||
|
||||
long_description ${description}
|
||||
|
||||
distfiles
|
||||
use_configure no
|
||||
build {}
|
||||
destroot {
|
||||
system "touch ${destroot}${prefix}/lib/${name}"
|
||||
}
|
||||
|
||||
# Check that macports doesn't chunk on this junk.
|
||||
# This might mean this port depends on port dependencies-a without variant
|
||||
# i_want_b (which is a default variant).
|
||||
depends_lib port:-i_want_b:dependencies-a
|
||||
|
||||
# Check that macports doesn't chunk on this junk, but just generates a warning.
|
||||
depends {configure {dependencies-a +i_want_b >= 1}}
|
||||
|
||||
test {
|
||||
# testing consists in processing dependencies
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
Warning: depends option is not handled yet
|
||||
Warning: depends option is not handled yet
|
||||
---> Computing dependencies for dependencies-d
|
||||
---> Dependencies to be installed: dependencies-a dependencies-b
|
||||
---> Fetching distfiles for dependencies-b
|
||||
---> Verifying checksum(s) for dependencies-b
|
||||
---> Extracting dependencies-b
|
||||
---> Configuring dependencies-b
|
||||
---> Building dependencies-b
|
||||
---> Staging dependencies-b into destroot
|
||||
---> Installing dependencies-b @1_0
|
||||
---> Activating dependencies-b @1_0
|
||||
---> Cleaning dependencies-b
|
||||
---> Fetching distfiles for dependencies-a
|
||||
---> Verifying checksum(s) for dependencies-a
|
||||
---> Extracting dependencies-a
|
||||
---> Configuring dependencies-a
|
||||
---> Building dependencies-a
|
||||
---> Staging dependencies-a into destroot
|
||||
---> Installing dependencies-a @1_0+i_want_b
|
||||
---> Activating dependencies-a @1_0+i_want_b
|
||||
---> Cleaning dependencies-a
|
||||
---> Fetching distfiles for dependencies-d
|
||||
---> Verifying checksum(s) for dependencies-d
|
||||
---> Extracting dependencies-d
|
||||
---> Configuring dependencies-d
|
||||
---> Building dependencies-d
|
||||
---> Testing dependencies-d
|
||||
@@ -0,0 +1,30 @@
|
||||
# $Id$
|
||||
|
||||
PortSystem 1.0
|
||||
name dependencies-e
|
||||
version 1
|
||||
categories test
|
||||
maintainers pguyot@kallisys.net
|
||||
description Test port for dependencies
|
||||
homepage http://www.macports.org/
|
||||
platforms darwin
|
||||
|
||||
long_description ${description}
|
||||
|
||||
distfiles
|
||||
use_configure no
|
||||
build {}
|
||||
destroot {
|
||||
system "touch ${destroot}${prefix}/lib/${name}"
|
||||
}
|
||||
|
||||
depends_build \
|
||||
port:docbook-xml-4.1.2 \
|
||||
port:docbook-xml-4.2 \
|
||||
port:docbook-xml-4.3 \
|
||||
port:docbook-xml-4.4 \
|
||||
port:docbook-xml-4.5
|
||||
|
||||
test {
|
||||
# testing consists in processing dependencies
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
---> Computing dependencies for dependencies-e
|
||||
Error: Dependency 'docbook-xml-4.1.2' not found.
|
||||
To report a bug, follow the instructions in the guide:
|
||||
http://guide.macports.org/#project.tickets
|
||||
Error: Processing of port dependencies-e failed
|
||||
@@ -0,0 +1,18 @@
|
||||
include ../../../Mk/macports.autoconf.mk
|
||||
|
||||
.PHONY: test
|
||||
|
||||
$(bindir)/port:
|
||||
@echo "Please install MacPorts before running this test"
|
||||
@exit 1
|
||||
|
||||
test:
|
||||
@PORTSRC=$(PORTSRC) $(bindir)/port clean > /dev/null
|
||||
@sh -c "export ENVA=A ; export ENVB=B; \
|
||||
export PORTSRC=$(PORTSRC); $(bindir)/port test" > output 2>&1 || (cat output; exit 1)
|
||||
@diff -u master output 2>&1 | tee difference
|
||||
@if [ -s difference ]; then \
|
||||
exit 1; \
|
||||
else \
|
||||
rm -f difference; \
|
||||
fi
|
||||
@@ -0,0 +1,24 @@
|
||||
# $Id$
|
||||
|
||||
PortSystem 1.0
|
||||
name envvariables
|
||||
version 1
|
||||
categories test
|
||||
maintainers pguyot@kallisys.net
|
||||
description Test port for env variables
|
||||
homepage http://www.macports.org/
|
||||
platforms darwin
|
||||
|
||||
long_description ${description}
|
||||
|
||||
distfiles
|
||||
use_configure no
|
||||
build {}
|
||||
destroot {
|
||||
system "touch ${destroot}${prefix}/lib/${name}"
|
||||
}
|
||||
|
||||
test {
|
||||
puts $env(ENVA)
|
||||
puts $env(ENVB)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
---> Fetching distfiles for envvariables
|
||||
---> Verifying checksum(s) for envvariables
|
||||
---> Extracting envvariables
|
||||
---> Configuring envvariables
|
||||
---> Building envvariables
|
||||
---> Testing envvariables
|
||||
A
|
||||
B
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user