Project

General

Profile

« Previous | Next » 

Revision 201fcfad

Added by jahoti almost 2 years ago

  • ID 201fcfadc87e21b0b10ecf3a2a9d114328a65ffb
  • Parent c39c6b9e

Support tests outside the source directory

Explicitly use certs in the build directory, and tests in the source

View differences:

Makefile.in
61 61

  
62 62
# testing-related targets
63 63
test/certs/:
64
	[ -d test ] || mkdir test
64 65
	mkdir $@
65 66

  
66 67
test/certs/%.key: | test/certs/
......
71 72
		 -subj "/CN=Haketilo Test"
72 73

  
73 74
test: test/certs/rootCA.pem test/certs/site.key
74
	@echo 'Warning: if the build directory is not the same'
75
	@echo 'as the source directory, THIS WILL NOT WORK.'
76
	MOZ_HEADLESS=whatever $(PYTEST)
75
	MOZ_HEADLESS=whatever $(PYTEST) "$(srcdir)"
77 76

  
78 77
test-environment: test/certs/rootCA.pem test/certs/site.key
79
	@echo 'Warning: if the build directory is not the same'
80
	@echo 'as the source directory, THIS WILL NOT WORK.'
81
	$(PYTHON) -m test
82

  
83
hello: record.conf
84
	@ls
78
	PYTHONPATH="$(srcdir)" $(PYTHON) -m test
85 79

  
86 80
# helper targets
87 81
clean mostlyclean:
configure
119 119
[ "x$TEST_BROWSER" != x ] && echo BINARY "$TEST_BROWSER" >> testing.conf
120 120
[ "x$TEST_PROFILE" != x ] && echo TEST_PROFILE "$TEST_PROFILE" >> testing.conf
121 121
[ "x$TEST_PORT" != x ] && echo TEST_PORT "$TEST_PORT" >> testing.conf
122
[ "$srcdir" != '.' ] && echo CERT_DIR "$PWD/test/certs" >> testing.conf
122 123

  
123 124
# Prepare and run write_makefile.sh (as config.status)
124 125
if [ ! -e config.status ]; then
test/misc_constants.py
43 43

  
44 44
# Use user-specified values instead where available
45 45
try:
46
	with open(str(here.parent / 'testing.conf')) as f:
46
	with open('testing.conf') as f:
47 47
		option = f.readline()
48 48
		while ' ' in option:
49 49
			key, value = option[:-1].split(' ', maxsplit=1)
......
56 56
			elif key == 'TEST_PORT':
57 57
				default_proxy_port = int(value)
58 58
			
59
			elif key == 'CERT_DIR':
60
				default_cert_dir = Path(value)
61
			
59 62
			else:
60 63
				raise KeyError(key)
61 64
			

Also available in: Unified diff