~ubuntu-branches/ubuntu/raring/icedtea-web/raring

« back to all changes in this revision

Viewing changes to Makefile.am

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-02-04 18:19:46 UTC
  • mfrom: (1.1.16)
  • Revision ID: package-import@ubuntu.com-20120204181946-jngobgzz4mlen9yl
Tags: 1.2~pre1-0ubuntu1
* Update to hg 20120203, taken from the icedtea-web-1.2 release branch.
* Build separate plugin packages for OpenJDK 6 and OpenJDK 7, needed
  to provide the path to the runtime and the mime description in the plugin.
* Use icedtea-<jre version>-plugin as the name for both plugin packages.
* Remove icedtea-web-1.1.4-npapi-fix.patch, fixed upstream.
* Pass -n to gzip when compressing manpages to be Multi-Arch: same safe.
* Build multiarch packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
NETX_EXTRA_DIR=$(abs_top_srcdir)/extra/net/sourceforge/javaws/about/resources
7
7
NETX_EXTRA_DIST_DIR=$(abs_top_builddir)/extra-lib/net/sourceforge/javaws/about/resources
8
8
 
 
9
REPORT_STYLES_DIRNAME=report-styles
 
10
 
9
11
TESTS_SRCDIR=$(abs_top_srcdir)/tests
10
12
TESTS_DIR=$(abs_top_builddir)/tests.build
11
13
 
15
17
JUNIT_RUNNER_DIR=$(TESTS_DIR)/junit-runner
16
18
JUNIT_RUNNER_SRCDIR=$(TESTS_SRCDIR)/junit-runner
17
19
 
 
20
JNLP_TESTS_ENGINE_SRCDIR=$(TESTS_SRCDIR)/netx/jnlp_testsengine
 
21
JNLP_TESTS_SRCDIR=$(TESTS_SRCDIR)/jnlp_tests
 
22
JNLP_TESTS_ENGINE_DIR=$(TESTS_DIR)/netx/jnlp_testsengine
 
23
JNLP_TESTS_SERVER_DEPLOYDIR=$(TESTS_DIR)/jnlp_test_server
 
24
JNLP_TESTS_DIR=$(TESTS_DIR)/jnlp_tests
 
25
KEYSTORE_NAME=teststore.ks
 
26
 
18
27
JUNIT_RUNNER_JAR=$(abs_top_builddir)/junit-runner.jar
 
28
UNIT_CLASS_NAMES = $(abs_top_builddir)/unit_class_names
 
29
REPRODUCERS_CLASS_NAMES = $(abs_top_builddir)/reproducers_class_names
19
30
 
20
31
# Build directories
21
32
 
97
108
endif
98
109
 
99
110
if WITH_JUNIT
100
 
  JUNIT_TESTS=run-netx-unit-tests
 
111
  JUNIT_TESTS=stamps/run-netx-unit-tests.stamp
101
112
else
102
113
  JUNIT_TESTS=
103
114
endif
137
148
 
138
149
.PHONY: clean-IcedTeaPlugin clean-add-netx clean-add-netx-debug clean-add-plugin clean-add-plugin-debug \
139
150
 clean-bootstrap-directory clean-native-ecj clean-desktop-files clean-netx-docs clean-docs clean-plugin-docs \
140
 
 clean-tests check-local clean-launchers check-pac-functions run-netx-unit-tests clean-netx-tests \
 
151
 clean-tests check-local clean-launchers check-pac-functions stamps/run-netx-unit-tests.stamp clean-netx-tests \
141
152
 clean-junit-runner clean-netx-unit-tests
142
153
 
143
154
install-exec-local:
202
213
        mkdir -p $(PLUGIN_DIR) && \
203
214
        cd $(PLUGIN_DIR) && \
204
215
        $(CXX) $(CXXFLAGS) \
 
216
           $(DEFS) \
205
217
          -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \
206
218
          -DPLUGIN_NAME="\"IcedTea-Web Plugin\"" \
207
219
          -DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \
209
221
          -DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \
210
222
          -DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \
211
223
          -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_BOOTCLASSPATH) \
 
224
           $(DEFS7) \
212
225
          $(GLIB_CFLAGS) \
213
226
          $(GTK_CFLAGS) \
214
227
          $(MOZILLA_CFLAGS) \
446
459
          @junit-runner-source-files.txt && \
447
460
        $(BOOT_DIR)/bin/jar cf $@  -C $(JUNIT_RUNNER_DIR) .
448
461
 
 
462
stamps/junit-jnlp-dist-dirs: junit-jnlp-dist-simple.txt junit-jnlp-dist-signed.txt
 
463
        mkdir -p $(JNLP_TESTS_SERVER_DEPLOYDIR)
 
464
        mkdir -p $(JNLP_TESTS_DIR)
 
465
        mkdir -p $(JNLP_TESTS_ENGINE_DIR)
 
466
        touch $@
 
467
 
 
468
junit-jnlp-dist-simple.txt:
 
469
        cd $(JNLP_TESTS_SRCDIR)/simple/ ; \
 
470
        find .  -maxdepth 1 -mindepth 1 | sed "s/.\/*//" > $(abs_top_builddir)/$@
 
471
 
 
472
junit-jnlp-dist-signed.txt: 
 
473
        cd $(JNLP_TESTS_SRCDIR)/signed/ ; \
 
474
        find .  -maxdepth 1 -mindepth 1 | sed "s/.\/*//" > $(abs_top_builddir)/$@
 
475
 
 
476
stamps/netx-dist-tests-prepare-reproducers.stamp: stamps/junit-jnlp-dist-dirs
 
477
        types=(simple signed); \
 
478
        for which in "$${types[@]}" ; do \
 
479
          . $(abs_top_builddir)/NEW_LINE_IFS ; \
 
480
          simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \
 
481
          IFS="$$IFS_BACKUP" ; \
 
482
          for dir in "$${simpleReproducers[@]}" ; do \
 
483
            echo "processing: $$dir" ; \
 
484
            mkdir -p "$(JNLP_TESTS_DIR)/$$dir" ; \
 
485
            d=`pwd` ; \
 
486
            cd "$(JNLP_TESTS_SRCDIR)/$$which/$$dir/srcs/" ; \
 
487
            srcFiles=`find . -mindepth 1 -type f -name "*.java" | sed "s/.\/*//"` ; \
 
488
            notSrcFiles=`find . -mindepth 1 -type f \! -name "*.java" | sed "s/.\/*//"` ; \
 
489
            $(BOOT_DIR)/bin/javac -d  "$(JNLP_TESTS_DIR)/$$dir/" $$srcFiles ; \
 
490
            if [ -n "$$notSrcFiles" ] ; then \
 
491
              cp -R --parents "$$notSrcFiles" "$(JNLP_TESTS_DIR)/$$dir/" ; \
 
492
            fi ; \
 
493
            cd "$(JNLP_TESTS_DIR)/$$dir/" ; \
 
494
            $(BOOT_DIR)/bin/jar cf "$(JNLP_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" * ; \
 
495
            cd "$$d" ; \
 
496
            cp -R "$(JNLP_TESTS_SRCDIR)/$$which/$$dir/resources/"*  $(JNLP_TESTS_SERVER_DEPLOYDIR)/ ; \
 
497
          done ; \
 
498
        done ; \
 
499
        mkdir -p stamps && \
 
500
        touch $@
 
501
 
 
502
stamps/netx-dist-tests-sign-some-reproducers.stamp: stamps/netx-dist-tests-prepare-reproducers.stamp
 
503
        alias=icedteaweb; \
 
504
        keystore=$(abs_top_builddir)/$(KEYSTORE_NAME); \
 
505
        pass=123456789; \
 
506
        $(BOOT_DIR)/bin/keytool -genkey -alias $$alias -keystore $$keystore -keypass $$pass -storepass $$pass -dname "cn=$$alias, ou=$$alias, o=$$alias, c=$$alias" ; \
 
507
          . $(abs_top_builddir)/NEW_LINE_IFS ; \
 
508
        signedReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-signed.txt `); \
 
509
          IFS="$$IFS_BACKUP" ; \
 
510
        for dir in "$${signedReproducers[@]}" ; do \
 
511
         $(BOOT_DIR)/bin/jarsigner -keystore $$keystore -storepass $$pass -keypass $$pass  "$(JNLP_TESTS_SERVER_DEPLOYDIR)/$$dir.jar"  $$alias ; \
 
512
        done ; \
 
513
        mkdir -p stamps && \
 
514
        touch $@
 
515
 
 
516
netx-dist-tests-source-files.txt:
 
517
        find $(JNLP_TESTS_ENGINE_SRCDIR) -name '*.java' | sort > $@
 
518
 
 
519
stamps/netx-dist-tests-compile.stamp: stamps/netx.stamp \
 
520
 stamps/junit-jnlp-dist-dirs netx-dist-tests-source-files.txt
 
521
        $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
 
522
         -d $(JNLP_TESTS_ENGINE_DIR) \
 
523
         -classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar \
 
524
         @netx-dist-tests-source-files.txt && \
 
525
        mkdir -p stamps && \
 
526
        touch $@
 
527
 
 
528
stamps/netx-dist-tests-compile-testcases.stamp: stamps/netx.stamp stamps/junit-jnlp-dist-dirs \
 
529
 netx-dist-tests-source-files.txt stamps/netx-dist-tests-compile.stamp
 
530
        types=(simple signed); \
 
531
        for which in "$${types[@]}" ; do \
 
532
          . $(abs_top_builddir)/NEW_LINE_IFS ; \
 
533
          simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \
 
534
          IFS="$$IFS_BACKUP" ; \
 
535
          for dir in "$${simpleReproducers[@]}" ; do \
 
536
            $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
 
537
            -d $(JNLP_TESTS_ENGINE_DIR) \
 
538
            -classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar:$(JNLP_TESTS_ENGINE_DIR) \
 
539
            "$(JNLP_TESTS_SRCDIR)/$$which/$$dir/testcases/"* ; \
 
540
          done ; \
 
541
        done ; \
 
542
        mkdir -p stamps && \
 
543
        touch $@
 
544
 
 
545
$(REPRODUCERS_CLASS_NAMES):
 
546
        cd $(JNLP_TESTS_ENGINE_DIR) ; \
 
547
        class_names= ; \
 
548
        for test in `find -type f` ; do \
 
549
          class_name=`echo $$test | sed -e 's|\.class$$||' -e 's|^\./||'` ; \
 
550
          class_name=`echo $$class_name | sed -e 's|/|.|g' ` ; \
 
551
          class_names="$$class_names $$class_name" ; \
 
552
        done ; \
 
553
        echo $$class_names > $(REPRODUCERS_CLASS_NAMES)
 
554
 
 
555
stamps/run-netx-dist-tests.stamp: stamps/netx-dist.stamp extra-lib/about.jar stamps/plugin.stamp launcher.build/$(javaws) \
 
556
 javaws.desktop stamps/docs.stamp launcher.build/$(itweb_settings) itweb-settings.desktop \
 
557
 stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-sign-some-reproducers.stamp \
 
558
 stamps/netx-dist-tests-compile.stamp stamps/netx-dist-tests-compile-testcases.stamp $(JUNIT_RUNNER_JAR) \
 
559
 $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(REPRODUCERS_CLASS_NAMES)
 
560
        cd $(JNLP_TESTS_ENGINE_DIR) ; \
 
561
        class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \
 
562
        CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):. \
 
563
          $(BOOT_DIR)/bin/java -Dtest.server.dir=$(JNLP_TESTS_SERVER_DEPLOYDIR) -Djavaws.build.bin=$(DESTDIR)$(bindir)/javaws \
 
564
         -Xbootclasspath:$(RUNTIME) CommandLine $$class_names \
 
565
          > stdout.log 2> stderr.log ; \
 
566
         cat stdout.log ; \
 
567
         cat stderr.log >&2
 
568
if WITH_XSLTPROC
 
569
        $(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(JNLP_TESTS_ENGINE_DIR)/tests-output.xml > $(TESTS_DIR)/index_reproducers.html
 
570
endif
 
571
        touch $@
 
572
 
449
573
netx-unit-tests-source-files.txt:
450
574
        find $(NETX_UNIT_TEST_SRCDIR) -name '*.java' | sort > $@
451
575
 
459
583
        mkdir -p stamps && \
460
584
        touch $@
461
585
 
462
 
run-netx-unit-tests: stamps/netx-unit-tests-compile.stamp \
463
 
 $(JUNIT_RUNNER_JAR)
464
 
        cp {$(NETX_UNIT_TEST_SRCDIR),$(NETX_UNIT_TEST_DIR)}/net/sourceforge/jnlp/basic.jnlp
 
586
$(TESTS_DIR)/$(REPORT_STYLES_DIRNAME):
 
587
        mkdir $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)
 
588
        cp $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/*.css $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)/
 
589
        cp $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/*.js $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)/
 
590
 
 
591
$(UNIT_CLASS_NAMES):
465
592
        cd $(NETX_UNIT_TEST_DIR) ; \
466
593
        class_names= ; \
467
594
        for test in `find -type f` ; do \
469
596
          class_name=`echo $$class_name | sed -e 's|/|.|g' ` ; \
470
597
          class_names="$$class_names $$class_name" ; \
471
598
        done ; \
472
 
        echo $$class_names ; \
 
599
        echo $$class_names > $(UNIT_CLASS_NAMES);
 
600
 
 
601
stamps/run-netx-unit-tests.stamp: stamps/netx-unit-tests-compile.stamp $(JUNIT_RUNNER_JAR)  \
 
602
 $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)  $(UNIT_CLASS_NAMES)
 
603
        filename=" " ; \
 
604
        cd $(NETX_UNIT_TEST_SRCDIR) ; \
 
605
        for file in `find . -type f \! -iname "*.java"`; do\
 
606
                filename=`echo $$file `; \
 
607
                cp --parents $$filename $(NETX_UNIT_TEST_DIR) ; \
 
608
        done ; \
 
609
        cd $(NETX_UNIT_TEST_DIR) ; \
 
610
        class_names=`cat $(UNIT_CLASS_NAMES)` ; \
473
611
        CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):. \
474
 
          $(BOOT_DIR)/bin/java -Xbootclasspath:$(RUNTIME) CommandLine $$class_names
475
 
 
476
 
clean-netx-tests: clean-netx-unit-tests clean-junit-runner
 
612
          $(BOOT_DIR)/bin/java -Xbootclasspath:$(RUNTIME) CommandLine $$class_names \
 
613
          > stdout.log 2> stderr.log ; \
 
614
        cat stdout.log ; \
 
615
        cat stderr.log >&2
 
616
if WITH_XSLTPROC
 
617
        $(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(NETX_UNIT_TEST_DIR)/tests-output.xml > $(TESTS_DIR)/index_unit.html
 
618
endif
 
619
        touch $@
 
620
 
 
621
#warning,  during this target tests.build/netx/unit/tests-output.xml is backup and rewriten (but not coresponding html file)
 
622
#xml results run from emma sandbox, however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored
 
623
#you can add -ix "-*Test*" -ix "-*test*"  to ignore all test cases from statistics
 
624
stamps/run-unit-test-code-coverage.stamp: check  $(UNIT_CLASS_NAMES);
 
625
if WITH_EMMA
 
626
        mv $(NETX_UNIT_TEST_DIR)/tests-output.xml  $(NETX_UNIT_TEST_DIR)/tests-output.xml_noEmma ; \
 
627
        cd $(NETX_UNIT_TEST_DIR) ; \
 
628
        class_names=`cat $(UNIT_CLASS_NAMES)` ; \
 
629
        $(BOOT_DIR)/bin/java -Xbootclasspath:$(RUNTIME) -cp $(EMMA_JAR) -Demma.report.html.out.encoding=UTF-8 emmarun \
 
630
         -Dreport.html.out.encoding=UTF-8 \
 
631
         -raw \
 
632
         -sp $(NETX_SRCDIR) \
 
633
         -sp $(NETX_UNIT_TEST_SRCDIR) \
 
634
         -sp $(JUNIT_RUNNER_SRCDIR) \
 
635
         -r html \
 
636
         -r xml \
 
637
         -cp $(NETX_DIR)/lib/classes.jar \
 
638
         -cp $(JUNIT_JAR) \
 
639
         -cp $(JUNIT_RUNNER_JAR) \
 
640
         -cp $(BOOT_DIR)/jre/lib/rt.jar \
 
641
         -cp $(BOOT_DIR)/jre/lib/jsse.jar \
 
642
         -cp $(RHINO_RUNTIME) \
 
643
         -cp . \
 
644
         -ix "-org.junit.*" \
 
645
         -ix "-junit.*" \
 
646
         CommandLine $$class_names ;  \
 
647
        mv $(NETX_UNIT_TEST_DIR)/tests-output.xml  $(NETX_UNIT_TEST_DIR)/tests-output_withEmma.xml ; \
 
648
        mv $(NETX_UNIT_TEST_DIR)/tests-output.xml_noEmma  $(NETX_UNIT_TEST_DIR)/tests-output.xml ; 
 
649
else 
 
650
        echo "Sorry, coverage report cant be run without emma installed. Try install emma or specify with-emma value" ;
 
651
        exit 5
 
652
endif 
 
653
        touch $@
 
654
 
 
655
#warning,  during this target tests.build/netx/jnlp_testsengine/tests-output.xml is backup and rewriten (but not coresponding html file)
 
656
#xml results run from emma sandbox, however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored
 
657
stamps/run-reproducers-test-code-coverage.stamp: stamps/run-netx-dist-tests.stamp $(REPRODUCERS_CLASS_NAMES)
 
658
if WITH_EMMA
 
659
        cd $(TESTS_DIR) ; \
 
660
        mv $(JNLP_TESTS_ENGINE_DIR)/tests-output.xml  $(JNLP_TESTS_ENGINE_DIR)/tests-output.xml_noEmma ; \
 
661
        echo "backuping javaws and netx.jar in $(DESTDIR)" ; \
 
662
        netx_backup=$(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx_backup.jar ; \
 
663
        javaws_backup=$(DESTDIR)$(bindir)/javaws_backup ; \
 
664
        mv $(DESTDIR)$(bindir)/javaws $$javaws_backup ;  \
 
665
        mv $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar $$netx_backup ; \
 
666
        nw_bootclasspath="$(LAUNCHER_BOOTCLASSPATH):$(EMMA_JAR):$$netx_backup" ; \
 
667
        instructed_dir=$(TESTS_DIR)/instr ; \
 
668
        echo "instrumenting netx.jar from $$netx_backup through $$instructed_dir" ; \
 
669
        $(BOOT_DIR)/bin/java -cp  $(EMMA_JAR) emma instr -d $$instructed_dir -ip $$netx_backup ; \
 
670
        pushd $$instructed_dir ; \
 
671
        $(BOOT_DIR)/bin/jar -cf $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar * ; \
 
672
        popd ; \
 
673
        rm -rf $$instructed_dir ; \
 
674
        echo "patching javaws" ; \
 
675
        cat $$javaws_backup | sed "s,$(LAUNCHER_BOOTCLASSPATH),$$nw_bootclasspath," > $(DESTDIR)$(bindir)/javaws ; \
 
676
        chmod 777 $(DESTDIR)$(bindir)/javaws ; \
 
677
        testcases_srcs=( ) ; \
 
678
        k=0 ; \
 
679
        types=(simple signed); \
 
680
        for which in "$${types[@]}" ; do \
 
681
          . $(abs_top_builddir)/NEW_LINE_IFS ; \
 
682
          simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \
 
683
          IFS="$$IFS_BACKUP" ; \
 
684
          for dir in "$${simpleReproducers[@]}" ; do \
 
685
            testcases_srcs[k]="-sp" ; \
 
686
            k=$$((k+1)) ; \
 
687
            testcases_srcs[k]="$(JNLP_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \
 
688
            k=$$((k+1)) ; \
 
689
            done ; \
 
690
          done ; \
 
691
        cd $(JNLP_TESTS_ENGINE_DIR) ; \
 
692
        class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \
 
693
        $(BOOT_DIR)/bin/java  \
 
694
         -Dtest.server.dir=$(JNLP_TESTS_SERVER_DEPLOYDIR) \
 
695
         -Djavaws.build.bin=$(DESTDIR)$(bindir)/javaws \
 
696
         -Xbootclasspath:$(RUNTIME) -cp $(EMMA_JAR) emmarun  \
 
697
           -raw \
 
698
           -cp $(NETX_DIR)/lib/classes.jar \
 
699
           -cp $(JUNIT_JAR) \
 
700
           -cp $(JUNIT_RUNNER_JAR) \
 
701
           -cp $(BOOT_DIR)/jre/lib/rt.jar \
 
702
           -cp $(BOOT_DIR)/jre/lib/jsse.jar \
 
703
           -cp $(RHINO_RUNTIME) \
 
704
           -cp . \
 
705
           -ix "-org.junit.*" \
 
706
           -ix "-junit.*" \
 
707
           CommandLine $$class_names ; \
 
708
        mv $(JNLP_TESTS_ENGINE_DIR)/coverage.ec $(JNLP_TESTS_ENGINE_DIR)/coverageX.ec ; \
 
709
        mv $(JNLP_TESTS_ENGINE_DIR)/coverage.es $(JNLP_TESTS_ENGINE_DIR)/coverageX.es ; \
 
710
        $(BOOT_DIR)/bin/java -cp $(EMMA_JAR) emma merge \
 
711
          -in $(TESTS_DIR)/coverage.em \
 
712
          -in $(JNLP_TESTS_ENGINE_DIR)/coverageX.ec \
 
713
          -in $(JNLP_TESTS_ENGINE_DIR)/coverageX.es ; \
 
714
        $(BOOT_DIR)/bin/java -cp $(EMMA_JAR)  -Demma.report.html.out.encoding=UTF-8 emma report \
 
715
          -Dreport.html.out.encoding=UTF-8 \
 
716
          -in $(JNLP_TESTS_ENGINE_DIR)/coverage.es  \
 
717
          -sp $(NETX_SRCDIR) \
 
718
          -sp $(NETX_UNIT_TEST_SRCDIR) \
 
719
          -sp $(JUNIT_RUNNER_SRCDIR) \
 
720
          -sp $(JNLP_TESTS_ENGINE_SRCDIR) \
 
721
          -r html \
 
722
          -r xml \
 
723
          "$${testcases_srcs[@]}" ; \
 
724
        echo "restoring javaws and netx.jar in $(DESTDIR)" ; \
 
725
        rm -f $(DESTDIR)$(bindir)/javaws $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar ; \
 
726
        rm -f $(DESTDIR)$(bindir)/javaws;  \
 
727
        mv $$javaws_backup $(DESTDIR)$(bindir)/javaws;  \
 
728
        mv $$netx_backup $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar ; \
 
729
        mv $(JNLP_TESTS_ENGINE_DIR)/tests-output.xml  $(JNLP_TESTS_ENGINE_DIR)/tests-output_withEmma.xml ; \
 
730
        mv $(JNLP_TESTS_ENGINE_DIR)/tests-output.xml_noEmma  $(JNLP_TESTS_ENGINE_DIR)/tests-output.xml ; \
 
731
        rm $(JNLP_TESTS_ENGINE_DIR)/coverage.txt ; 
 
732
else
 
733
        echo "Sorry, coverage report cant be run without emma installed. Try install emma or specify with-emma value" ;
 
734
        exit 5
 
735
endif
 
736
        touch $@
 
737
 
 
738
run-test-code-coverage: run-unit-test-code-coverage run-reproducers-test-code-coverage
 
739
if WITH_EMMA
 
740
        cd $(TESTS_DIR) ; \
 
741
        k=0 ; \
 
742
        types=(simple signed); \
 
743
        for which in "$${types[@]}" ; do \
 
744
          . $(abs_top_builddir)/NEW_LINE_IFS ; \
 
745
          simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \
 
746
          IFS="$$IFS_BACKUP" ; \
 
747
          for dir in "$${simpleReproducers[@]}" ; do \
 
748
            testcases_srcs[k]="-sp" ; \
 
749
            k=$$((k+1)) ; \
 
750
            testcases_srcs[k]="$(JNLP_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \
 
751
            k=$$((k+1)) ; \
 
752
          done ; \
 
753
        done ; \
 
754
        $(BOOT_DIR)/bin/java -cp $(EMMA_JAR) emma merge \
 
755
         -in $(NETX_UNIT_TEST_DIR)/coverage.es \
 
756
         -in $(JNLP_TESTS_ENGINE_DIR)/coverage.es ; \
 
757
        $(BOOT_DIR)/bin/java -cp $(EMMA_JAR)  -Demma.report.html.out.encoding=UTF-8 emma report \
 
758
         -Dreport.html.out.encoding=UTF-8 \
 
759
         -in $(TESTS_DIR)/coverage.es \
 
760
         -in $(TESTS_DIR)/coverage.em \
 
761
         -sp $(NETX_SRCDIR) \
 
762
         -sp $(NETX_UNIT_TEST_SRCDIR) \
 
763
         -sp $(JUNIT_RUNNER_SRCDIR) \
 
764
         -sp $(JNLP_TESTS_ENGINE_SRCDIR) \
 
765
         "$${testcases_srcs[@]}" \
 
766
         -r html \
 
767
         -r xml ; 
 
768
else
 
769
        echo "Sorry, coverage report cant be run without emma installed. Try install emma or specify with-emma value" ;
 
770
        exit 5
 
771
endif
 
772
 
 
773
clean-netx-tests: clean-netx-unit-tests clean-junit-runner clean-netx-dist-tests clean-test-code-coverage
477
774
        if [ -e $(TESTS_DIR)/netx ]; then \
478
775
          rmdir $(TESTS_DIR)/netx ; \
479
776
        fi
483
780
        rm -rf $(JUNIT_RUNNER_DIR)
484
781
        rm -f $(JUNIT_RUNNER_JAR)
485
782
 
486
 
clean-netx-unit-tests:
 
783
clean-netx-unit-tests: clean_tests_reports
487
784
        rm -f netx-unit-tests-source-files.txt
488
785
        rm -rf $(NETX_UNIT_TEST_DIR)
 
786
        rm -f $(UNIT_CLASS_NAMES)
 
787
        rm -f stamps/run-netx-unit-tests.stamp
489
788
        rm -f stamps/netx-unit-tests-compile.stamp
490
789
 
 
790
clean_tests_reports:
 
791
        rm -rf  $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)/
 
792
        rm -f  $(TESTS_DIR)/index*.html
 
793
 
 
794
clean-netx-dist-tests: clean_tests_reports
 
795
        rm -f netx-dist-tests-source-files.txt
 
796
        rm -rf $(JNLP_TESTS_DIR)
 
797
        rm -rf $(JNLP_TESTS_SERVER_DEPLOYDIR)
 
798
        rm -rf $(JNLP_TESTS_ENGINE_DIR)
 
799
        rm -f stamps/junit-jnlp-dist-dirs
 
800
        rm -f stamps/netx-dist-tests-compile.stamp
 
801
        rm -f stamps/netx-dist-tests-prepare-reproducers.stamp
 
802
        rm -f stamps/netx-dist-tests-compile-testcases.stamp
 
803
        rm -f stamps/netx-dist-tests-sign-some-reproducers.stamp
 
804
        rm -f junit-jnlp-dist-simple.txt
 
805
        rm -f junit-jnlp-dist-signed.txt
 
806
        rm -f $(REPRODUCERS_CLASS_NAMES)
 
807
        rm -f $(abs_top_builddir)/$(KEYSTORE_NAME)
 
808
        rm -f stamps/run-netx-dist-tests.stamp
 
809
 
 
810
clean-unit-test-code-coverage:
 
811
        if [ -e stamps/run-unit-test-code-coverage.stamp ]; then \
 
812
          rm -rf $(NETX_UNIT_TEST_DIR)/coverage ; \
 
813
          rm -f $(NETX_UNIT_TEST_DIR)/coverage.xml ; \
 
814
          rm -f $(NETX_UNIT_TEST_DIR)/coverageX.es ; \
 
815
          rm -f $(NETX_UNIT_TEST_DIR)/coverageX.ec ; \
 
816
          rm -f $(NETX_UNIT_TEST_DIR)/coverage.es ; \
 
817
          rm -f $(NETX_UNIT_TEST_DIR)/tests-output_withEmma.xml ; \
 
818
          rm -f stamps/run-unit-test-code-coverage.stamp ; \
 
819
        fi
 
820
 
 
821
clean-reproducers-test-code-coverage:
 
822
        if [ -e stamps/run-reproducers-test-code-coverage.stamp ]; then \
 
823
         rm -rf $(JNLP_TESTS_ENGINE_DIR)/coverage ; \
 
824
         rm -f $(JNLP_TESTS_ENGINE_DIR)/coverage.xml ; \
 
825
         rm -f $(JNLP_TESTS_ENGINE_DIR)/coverage.es ; \
 
826
         rm -f $(JNLP_TESTS_ENGINE_DIR)/tests-output_withEmma.xml ; \
 
827
         rm -f stamps/run-reproducers-test-code-coverage.stamp ; \
 
828
        fi
 
829
 
 
830
clean-test-code-coverage: clean-unit-test-code-coverage clean-reproducers-test-code-coverage
 
831
        if [ -e $(TESTS_DIR)/coverage.xml ]; then \
 
832
          rm -rf $(TESTS_DIR)/coverage  ; \
 
833
          rm -f $(TESTS_DIR)/coverage.xml  ; \
 
834
          rm -f $(TESTS_DIR)/coverage.es  ; \
 
835
          rm -f $(TESTS_DIR)/coverage.em ; \
 
836
        fi
 
837
 
 
838
 
491
839
# plugin tests
492
840
 
493
841
if ENABLE_PLUGIN
528
876
        ln -sf $(JAR) $(BOOT_DIR)/bin/jar
529
877
        ln -sf $(abs_top_builddir)/javac $(BOOT_DIR)/bin/javac
530
878
        ln -sf $(JAVADOC) $(BOOT_DIR)/bin/javadoc
 
879
        if [ -e "$(KEYTOOL)" ] ; then \
 
880
          ln -sf $(KEYTOOL) $(BOOT_DIR)/bin/keytool ;\
 
881
        else \
 
882
          echo "#! /bin/sh" > $(BOOT_DIR)/bin/keytool ;\
 
883
          echo "echo \"keytool not exist on your system, signed part of reproducers test will fail\"" >> $(BOOT_DIR)/bin/keytool ;\
 
884
          chmod 777 $(BOOT_DIR)/bin/keytool ;\
 
885
        fi
 
886
        if [ -e "$(JARSIGNER)" ] ; then \
 
887
          ln -sf $(JARSIGNER) $(BOOT_DIR)/bin/jarsigner ;\
 
888
        else \
 
889
          echo "#! /bin/sh" > $(BOOT_DIR)/bin/jarsigner ;\
 
890
          echo "echo \"jarsigner not exist on your system, signed part of reproducers test will fail\"" >> $(BOOT_DIR)/bin/jarsigner ;\
 
891
          chmod 777 $(BOOT_DIR)/bin/jarsigner ;\
 
892
        fi
531
893
        mkdir -p $(BOOT_DIR)/jre/lib && \
532
894
        ln -s $(SYSTEM_JRE_DIR)/lib/rt.jar $(BOOT_DIR)/jre/lib && \
533
895
        if [ -e $(SYSTEM_JRE_DIR)/lib/jsse.jar ] ; then \
573
935
plugin: stamps/plugin.stamp
574
936
 
575
937
plugin-tests: stamps/plugin-tests.stamp
 
938
 
 
939
run-netx-unit-tests: stamps/run-netx-unit-tests.stamp
 
940
 
 
941
run-netx-dist-tests: stamps/run-netx-dist-tests.stamp
 
942
 
 
943
run-unit-test-code-coverage: stamps/run-unit-test-code-coverage.stamp
 
944
 
 
945
run-reproducers-test-code-coverage: stamps/run-reproducers-test-code-coverage.stamp