Makefile.SH: 'make test' for cross-compilation builds.
authorJess Robinson <castaway@desert-island.me.uk>
Thu, 31 Jan 2013 14:12:31 +0000 (14:12 +0000)
committerBrian Fraser <fraserbn@gmail.com>
Wed, 22 Jan 2014 16:08:21 +0000 (13:08 -0300)
Along with the previous commit, this enables us to run 'make test'
on the host and have the tests run on the target. We do this by
calling ./Cross/run ./TEST with -cwd $targetdir/t, and setting its
LD_LIBRARY_PATH to $targetdir, so that libperl.so is found.

Makefile.SH

index cafc94c..3bd20e2 100755 (executable)
@@ -1485,10 +1485,26 @@ $spitshell >>$Makefile <<'!NO!SUBS!'
 test_prep_reonly: $(MINIPERL_EXE) $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL)
        $(MINIPERL) make_ext.pl $(dynamic_ext_re) MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic
        cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
+!NO!SUBS!
+
+case "$targethost" in
+'') $spitshell >>$Makefile <<'!NO!SUBS!'
 
 test check: test_prep
        $(RUN_TESTS) choose
 
+!NO!SUBS!
+;;
+*) $spitshell >>$Makefile <<!GROK!THIS!
+
+test check: test_prep
+       $run -cwd $targetdir/t -env LD_LIBRARY_PATH=$targetdir ./TEST
+
+!GROK!THIS!
+;;
+esac
+
+$spitshell >>$Makefile <<'!NO!SUBS!'
 test_tty test-tty: test_prep
        $(RUN_TESTS) tty