Permalink
Browse files

update plugin tester

  • Loading branch information...
1 parent c2b2aa4 commit 5bc41cf7d33be4f9a2a0fcbc8b2fbc5a9f2ac0aa @dams dams committed Sep 26, 2012
Showing with 13 additions and 7 deletions.
  1. +2 −0 lib/Dancer/Plugin.pm
  2. +11 −7 tools/plugins_auto_tests/Makefile
View
@@ -136,6 +136,8 @@ sub register_plugin {
( grep { $_ eq $dancer_major_version } @$supported_versions) || $ENV{DANCER_FORCE_PLUGIN_REGISTRATION}
or croak "$plugin $plugin_version does not support Dancer $dancer_major_version.";
+ $ENV{DANCER_FORCE_PLUGIN_REGISTRATION}
+ and print "DANCER2_PLUGIN_WERE_REGISTERED\n";
# we have a $dsl in our caller, we can register our symbols then
my $dsl = $caller->dsl;
@@ -7,12 +7,13 @@ CPANM_DANCER1=${PERLBREW} exec --with dancer1_plugin_tests ${PERLBREW_DIR}/bin/c
CPANM_DANCER2=${PERLBREW} exec --with dancer2_plugin_tests ${PERLBREW_DIR}/bin/cpanm
all: got_curl got_bash got_perlbrew_perl plugins_list
- echo "Plugin name,Pass on Dancer 1,Pass on Dancer 2" > result.csv
+ @echo "Plugin name,Pass on Dancer 1,Pass on Dancer 2" > result.csv
@for i in `cat plugins_list`; do pass_d1=0; pass_d2=0; \
- echo " ---------- TESTING on Dancer 1 : $$i"; \
- ${CPANM_DANCER1} -n --installdeps $$i && ${CPANM_DANCER1} --test-only $$i && pass_d1=1; \
- echo " ---------- TESTING on Dancer 2 : $$i"; \
- ${CPANM_DANCER2} -n --installdeps $$i && DANCER_FORCE_PLUGIN_REGISTRATION=1 ${CPANM_DANCER2} --test-only -v $$i && pass_d2=1; \
+ echo "$$i"; \
+ echo " Dancer 1"; \
+ echo " - installing deps"; ${CPANM_DANCER1} -n --installdeps $$i >/dev/null 2>&1 && echo " - testing" && ${CPANM_DANCER1} --test-only $$i 2>&1 | grep 'Successfully tested' >/dev/null && pass_d1=1; \
+ echo " Dancer 2"; \
+ echo " - installing deps"; ${CPANM_DANCER2} -n --installdeps $$i >/dev/null 2>&1 && echo " - testing" && r=$$(DANCER_FORCE_PLUGIN_REGISTRATION=1 ${CPANM_DANCER2} --test-only $$i 2>&1); echo $$r | grep 'Successfully tested' >/dev/null && pass_d2=1; if (( pass_d2 )); then pass_d2='?'; echo $$r | grep DANCER2_PLUGIN_WERE_REGISTERED >/dev/null && pass_d2=1; fi;\
echo "$$i,$$pass_d1,$$pass_d2" >> result.csv; \
done;
@@ -38,11 +39,14 @@ got_bash:
got_perlbrew_perl: ${PERLBREW_DIR}/bin/perlbrew ${PERLBREW_DIR}/bin/cpanm perlbrew_dancer1_plugin_tests perlbrew_dancer2_plugin_tests
perlbrew_dancer1_plugin_tests:
- ${PERLBREW} list | grep dancer1_plugin_tests > /dev/null || ( ${PERLBREW} install -j 2 -n perl-5.16.1 --as dancer1_plugin_tests )
+ @${PERLBREW} list | grep dancer1_plugin_tests > /dev/null || ( ${PERLBREW} install -j 5 -n perl-5.16.1 --as dancer1_plugin_tests )
perlbrew_dancer2_plugin_tests:
- ${PERLBREW} list | grep dancer2_plugin_tests > /dev/null || ( ${PERLBREW} install -j 2 -n perl-5.16.1 --as dancer2_plugin_tests && ${CPANM_DANCER2} ${HERE}/../.. )
+ @${PERLBREW} list | grep dancer2_plugin_tests > /dev/null || ( ${PERLBREW} install -j 5 -n perl-5.16.1 --as dancer2_plugin_tests && ${CPANM_DANCER2} ${HERE}/../.. )
plugins_list:
cpanm -n Modern::Perl LWP::Simple ElasticSearch
${HERE}/get_modules_list.pl > plugins_list
+
+update_dancer2:
+ ${CPANM_DANCER2} ${HERE}/../..

0 comments on commit 5bc41cf

Please sign in to comment.