Просмотр исходного кода

Do not try to execute an empty shell script in core-plugins-one test

The previous code did:
    if `<code that prints nothing on stdout>`; then ...

So the test failed but not for the good reason. The forked shell
printed:
/bin/sh: gmake[2]:: not found

Now, both "Run 'make ...'" tests are simplified and do not rely on
backticks and test(1) anymore. Either the output is inspected or the
exit code is checked.
Jean-Sébastien Pédron 9 лет назад
Родитель
Сommit
aa6c060fca
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      test/core_plugins.mk

+ 2 - 2
test/core_plugins.mk

@@ -72,7 +72,7 @@ core-plugins-one: build clean-core-plugins-one
 	$t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = plugin_dep\ndep_plugin_dep = git file://$(abspath $(APP)/plugin_dep) master\nDEP_PLUGINS = plugin_dep/mk/plugin1.mk\n"}' $(APP)/Makefile
 
 	$i "Run 'make plugin1' and check that it prints plugin1"
-	$t test -n "`$(MAKE) -C $(APP) plugin1 | grep plugin1`"
+	$t $(MAKE) --no-print-directory -C $(APP) plugin1 | grep -qw plugin1
 
 	$i "Run 'make plugin2' and confirm the target doesn't exist"
-	$t if `$(MAKE) -C $(APP) plugin2`; then false; fi
+	$t ! $(MAKE) --no-print-directory -C $(APP) plugin2