mirror of
				https://github.com/openresty/openresty.git
				synced 2024-10-13 00:29:41 +00:00 
			
		
		
		
	now we also test the generated makefiles in our test suite.
This commit is contained in:
		
							
								
								
									
										4
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								Makefile
									
									
									
									
									
								
							| @ -1,4 +1,4 @@ | |||||||
| .PHONY: all test | .PHONY: all test try-luajit try-lua | ||||||
|  |  | ||||||
| all: | all: | ||||||
| 	./util/mirror-tarballs | 	./util/mirror-tarballs | ||||||
| @ -10,5 +10,5 @@ try-luajit: all | |||||||
| 	cd ngx_openresty-`./util/ver` && ./configure --with-luajit | 	cd ngx_openresty-`./util/ver` && ./configure --with-luajit | ||||||
|  |  | ||||||
| try-lua: all | try-lua: all | ||||||
| 	cd ngx_openresty-`./util/ver` && ./configure | 	cd ngx_openresty-`./util/ver` && ./configure && $(MAKE) | ||||||
|  |  | ||||||
|  | |||||||
							
								
								
									
										12
									
								
								t/Config.pm
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								t/Config.pm
									
									
									
									
									
								
							| @ -60,6 +60,18 @@ sub run_test ($) { | |||||||
|     is($stdout, $expected_out, "$name - stdout ok"); |     is($stdout, $expected_out, "$name - stdout ok"); | ||||||
|     is($stderr, $expected_err, "$name - stderr ok"); |     is($stderr, $expected_err, "$name - stderr ok"); | ||||||
|     is($retval >> 8, $expected_exit, "$name - exit code ok"); |     is($retval >> 8, $expected_exit, "$name - exit code ok"); | ||||||
|  |  | ||||||
|  |     if (defined $block->makefile) { | ||||||
|  |         open my $in, "Makefile" or | ||||||
|  |             die "cannot open Makefile for reading: $!"; | ||||||
|  |         my $got = do { local $/; <$in> }; | ||||||
|  |         close $in; | ||||||
|  |  | ||||||
|  |         my $expected_makefile = $block->makefile; | ||||||
|  |         $expected_makefile =~ s/\$OPENRESTY_BUILD_DIR\b/$BuildRoot/gs; | ||||||
|  |  | ||||||
|  |         is($got, $expected_makefile, "$name - Makefile ok"); | ||||||
|  |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| sub shell (@) { | sub shell (@) { | ||||||
|  | |||||||
							
								
								
									
										41
									
								
								t/sanity.t
									
									
									
									
									
								
							
							
						
						
									
										41
									
								
								t/sanity.t
									
									
									
									
									
								
							| @ -2,7 +2,7 @@ | |||||||
|  |  | ||||||
| use t::Config; | use t::Config; | ||||||
|  |  | ||||||
| plan tests => 3 * blocks(); | plan tests => 3 * blocks() + 3; | ||||||
|  |  | ||||||
| #no_diff(); | #no_diff(); | ||||||
|  |  | ||||||
| @ -199,6 +199,19 @@ cd nginx-0.8.54 | |||||||
|   --add-module=../rds-json-nginx-module-0.11rc2 \ |   --add-module=../rds-json-nginx-module-0.11rc2 \ | ||||||
|   --with-http_ssl_module |   --with-http_ssl_module | ||||||
| cd ../.. | cd ../.. | ||||||
|  | --- makefile | ||||||
|  | .PHONY: all install | ||||||
|  |  | ||||||
|  | all: | ||||||
|  | 	cd build/lua-5.1.4 && $(MAKE) linux | ||||||
|  | 	cd build/nginx-0.8.54 && $(MAKE) | ||||||
|  |  | ||||||
|  | install: | ||||||
|  | 	cd build/lua-5.1.4 && $(MAKE) install INSTALL_TOP=$(DESTDIR)/usr/local/openresty/lua | ||||||
|  | 	cd build/nginx-0.8.54 && $(MAKE) install DESTDIR=$(DESTDIR) | ||||||
|  |  | ||||||
|  | clean: | ||||||
|  | 	rm -rf build | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| @ -234,6 +247,19 @@ cd nginx-0.8.54 | |||||||
|   --add-module=../rds-json-nginx-module-0.11rc2 \ |   --add-module=../rds-json-nginx-module-0.11rc2 \ | ||||||
|   --with-http_ssl_module |   --with-http_ssl_module | ||||||
| cd ../.. | cd ../.. | ||||||
|  | --- makefile | ||||||
|  | .PHONY: all install | ||||||
|  |  | ||||||
|  | all: | ||||||
|  | 	cd build/lua-5.1.4 && $(MAKE) linux | ||||||
|  | 	cd build/nginx-0.8.54 && $(MAKE) | ||||||
|  |  | ||||||
|  | install: | ||||||
|  | 	cd build/lua-5.1.4 && $(MAKE) install INSTALL_TOP=$(DESTDIR)/usr/local/openresty/lua | ||||||
|  | 	cd build/nginx-0.8.54 && $(MAKE) install DESTDIR=$(DESTDIR) | ||||||
|  |  | ||||||
|  | clean: | ||||||
|  | 	rm -rf build | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| @ -278,4 +304,17 @@ cd nginx-0.8.54 | |||||||
|   --with-ld-opt='-Wl,-rpath=/usr/local/openresty/luajit/lib' \ |   --with-ld-opt='-Wl,-rpath=/usr/local/openresty/luajit/lib' \ | ||||||
|   --with-http_ssl_module |   --with-http_ssl_module | ||||||
| cd ../.. | cd ../.. | ||||||
|  | --- makefile | ||||||
|  | .PHONY: all install | ||||||
|  |  | ||||||
|  | all: | ||||||
|  | 	cd build/LuaJIT-2.0.0-beta6 && $(MAKE) PREFIX=/usr/local/openresty/luajit | ||||||
|  | 	cd build/nginx-0.8.54 && $(MAKE) | ||||||
|  |  | ||||||
|  | install: | ||||||
|  | 	cd build/LuaJIT-2.0.0-beta6 && $(MAKE) install PREFIX=/usr/local/openresty/luajit DESTDIR=$(DESTDIR) | ||||||
|  | 	cd build/nginx-0.8.54 && $(MAKE) install DESTDIR=$(DESTDIR) | ||||||
|  |  | ||||||
|  | clean: | ||||||
|  | 	rm -rf build | ||||||
|  |  | ||||||
|  | |||||||
							
								
								
									
										8
									
								
								util/configure
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								util/configure
									
									
									
									
										vendored
									
									
								
							| @ -133,6 +133,7 @@ push @make_install_cmds, "cd build/$ngx_dir && " | |||||||
|     . "\$(MAKE) install DESTDIR=\$(DESTDIR)"; |     . "\$(MAKE) install DESTDIR=\$(DESTDIR)"; | ||||||
|  |  | ||||||
| cd '../..'; # to the root | cd '../..'; # to the root | ||||||
|  | #die "pwd: " .. `pwd`; | ||||||
|  |  | ||||||
| gen_makefile(); | gen_makefile(); | ||||||
|  |  | ||||||
| @ -513,8 +514,13 @@ sub gen_makefile { | |||||||
|     open my $out, ">Makefile" or |     open my $out, ">Makefile" or | ||||||
|         die "Cannot open Makefile for writing: $!\n"; |         die "Cannot open Makefile for writing: $!\n"; | ||||||
|  |  | ||||||
|  |     print $out ".PHONY: all install\n\n"; | ||||||
|  |  | ||||||
|     print $out "all:\n\t" . join("\n\t", @make_cmds) . "\n\n"; |     print $out "all:\n\t" . join("\n\t", @make_cmds) . "\n\n"; | ||||||
|     print $out "install:\n\t" . join("\n\t", @make_install_cmds) . "\n"; |  | ||||||
|  |     print $out "install:\n\t" . join("\n\t", @make_install_cmds) . "\n\n"; | ||||||
|  |  | ||||||
|  |     print $out "clean:\n\trm -rf build\n"; | ||||||
|  |  | ||||||
|     close $out; |     close $out; | ||||||
| } | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user