]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
added preload=auto to unit tests. muted unit tests. added Module stuff to Makefile...
authorChristopher De Cairos <chris.decairos@gmail.com>
Mon, 19 Sep 2011 14:54:03 +0000 (10:54 -0400)
committerChristopher De Cairos <chris.decairos@gmail.com>
Mon, 19 Sep 2011 14:54:03 +0000 (10:54 -0400)
Makefile
modules/timeline-sources/popcorn.timeline-sources.unit.html
modules/timeline-sources/popcorn.timeline-sources.unit.js

index 5bffbf44e15ecd7bce8c4b6ad75d8227fe94e58f..08ed9f964c5b92da5191ecf1a642b0b9107120a8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ PLUGINS_DIR = ${PREFIX}/plugins
 PARSERS_DIR = ${PREFIX}/parsers
 PLAYERS_DIR = ${PREFIX}/players
 EFFECTS_DIR = $(PREFIX)/effects
+MODULES_DIR = $(PREFIX)/modules
 
 # Version number used in naming release files. Defaults to git commit sha.
 VERSION ?= $(shell git show -s --pretty=format:%h)
@@ -27,6 +28,10 @@ POPCORN_SRC = ${PREFIX}/popcorn.js
 POPCORN_DIST = ${DIST_DIR}/popcorn.js
 POPCORN_MIN = ${DIST_DIR}/popcorn.min.js
 
+# modules
+MODULES_DIST = ${DIST_DIR}/popcorn.modules.js
+MODULES_MIN = ${DIST_DIR}/popcorn.modules.min.js
+
 # plugins
 PLUGINS_DIST = ${DIST_DIR}/popcorn.plugins.js
 PLUGINS_MIN = ${DIST_DIR}/popcorn.plugins.min.js
@@ -52,23 +57,30 @@ PARSERS_SRC := $(filter-out %unit.js, $(shell find ${PARSERS_DIR} -name 'popcorn
 # Grab all popcorn.<player-name>.js files from players dir
 PLAYERS_SRC := $(filter-out %unit.js, $(shell find ${PLAYERS_DIR} -name 'popcorn.*.js' -print))
 
-# Grab all popcorn.<effect-name>.js files from players dir
+# Grab all popcorn.<effect-name>.js files from effects dir
 EFFECTS_SRC := $(filter-out %unit.js, $(shell find $(EFFECTS_DIR) -name 'popcorn.*.js' -print))
 
-# Grab all popcorn.<player-name>.unit.js files from plugins dir
+# Grab all popcorn.<Module-name>.js files from modules dir
+MODULES_SRC := $(filter-out %unit.js, $(shell find $(MODULES_DIR) -name 'popcorn.*.js' -print))
+
+# Grab all popcorn.<plugin-name>.unit.js files from plugins dir
 PLUGINS_UNIT := $(shell find ${PLUGINS_DIR} -name 'popcorn.*.unit.js' -print)
 
-# Grab all popcorn.<player-name>.unit.js files from parsers dir
+# Grab all popcorn.<parser-name>.unit.js files from parsers dir
 PARSERS_UNIT := $(shell find ${PARSERS_DIR} -name 'popcorn.*.unit.js' -print)
 
 # Grab all popcorn.<player-name>.unit.js files from players dir
 PLAYERS_UNIT := $(shell find ${PLAYERS_DIR} -name 'popcorn.*.unit.js' -print)
 
-# Grab all popcorn.<effects>.unit.js files from players dir
+# Grab all popcorn.<effects>.unit.js files from effects dir
 EFFECTS_UNIT := $(shell find $(EFFECTS_DIR) -name 'popcorn.*.unit.js' -print)
 
+# Grab all popcorn.<module-name>.unit.js files from modules dir
+MODULES_UNIT := $(shell find $(MODULES_DIR) -name 'popcorn.*.unit.js' -print)
+
 # popcorn + plugins
 POPCORN_COMPLETE_LIST := --js ${POPCORN_SRC} \
+                         $(shell for js in ${MODULES_SRC} ; do echo --js $$js ; done) \
                          $(shell for js in ${PLUGINS_SRC} ; do echo --js $$js ; done) \
                          $(shell for js in ${PARSERS_SRC} ; do echo --js $$js ; done) \
                          $(shell for js in ${PLAYERS_SRC} ; do echo --js $$js ; done)
@@ -96,7 +108,7 @@ ${POPCORN_DIST}: ${POPCORN_SRC} | ${DIST_DIR}
        @@echo "Building" ${POPCORN_DIST}
        @@$(call add_license, $(POPCORN_SRC), $(POPCORN_DIST))
 
-min: ${POPCORN_MIN} ${PLUGINS_MIN} ${PARSERS_MIN} ${PLAYERS_MIN} $(EFFECTS_MIN) ${POPCORN_COMPLETE_MIN}
+min: ${POPCORN_MIN} ${MODULES_MIN} ${PLUGINS_MIN} ${PARSERS_MIN} ${PLAYERS_MIN} $(EFFECTS_MIN) ${POPCORN_COMPLETE_MIN}
 
 ${POPCORN_MIN}: ${POPCORN_DIST}
        @@echo "Building" ${POPCORN_MIN}
@@ -104,12 +116,22 @@ ${POPCORN_MIN}: ${POPCORN_DIST}
        @@$(call add_license, ${POPCORN_MIN}.tmp, ${POPCORN_MIN})
        @@rm ${POPCORN_MIN}.tmp
 
-${POPCORN_COMPLETE_MIN}: update ${POPCORN_SRC} ${PLUGINS_SRC} ${PARSERS_SRC} $(EFFECTS_SRC) ${DIST_DIR}
+${POPCORN_COMPLETE_MIN}: update ${POPCORN_SRC} ${MODULES_SRC} ${PLUGINS_SRC} ${PARSERS_SRC} $(EFFECTS_SRC) ${DIST_DIR}
        @@echo "Building" ${POPCORN_COMPLETE_MIN}
        @@$(call compile, ${POPCORN_COMPLETE_LIST}, ${POPCORN_COMPLETE_MIN}.tmp)
        @@$(call add_license, ${POPCORN_COMPLETE_MIN}.tmp, ${POPCORN_COMPLETE_MIN})
        @@rm ${POPCORN_COMPLETE_MIN}.tmp
 
+modules: ${MODULES_DIST}
+
+${MODULES_MIN}: ${MODULES_DIST}
+       @@echo "Building" ${MODULES_MIN}
+       @@$(call compile, $(shell for js in ${MODULES_SRC} ; do echo --js $$js ; done), ${MODULES_MIN})
+
+${MODULES_DIST}: ${MODULES_SRC} ${DIST_DIR}
+       @@echo "Building ${MODULES_DIST}"
+       @@cat ${MODULES_SRC} > ${MODULES_DIST}
+
 plugins: ${PLUGINS_DIST}
 
 ${PLUGINS_MIN}: ${PLUGINS_DIST}
@@ -150,9 +172,9 @@ $(EFFECTS_DIST): $(EFFECTS_SRC) $(DIST_DIR)
        @@echo "Building $(EFFECTS_DIST)"
        @@cat $(EFFECTS_SRC) > $(EFFECTS_DIST)
 
-complete: update ${POPCORN_SRC} ${PARSERS_SRC} ${PLUGINS_SRC} ${PLAYERS_SRC} $(EFFECTS_SRC) ${DIST_DIR}
-       @@echo "Building popcorn + plugins + parsers + players + effects..."
-       @@cat ${POPCORN_SRC} ${PLUGINS_SRC} ${PARSERS_SRC} ${PLAYERS_SRC} $(EFFECTS_SRC) > ${POPCORN_COMPLETE_DIST}.tmp
+complete: update ${POPCORN_SRC} ${MODULES_SRC} ${PARSERS_SRC} ${PLUGINS_SRC} ${PLAYERS_SRC} $(EFFECTS_SRC) ${DIST_DIR}
+       @@echo "Building popcorn + modules + plugins + parsers + players + effects..."
+       @@cat ${POPCORN_SRC} ${MODULES_SRC} ${PLUGINS_SRC} ${PARSERS_SRC} ${PLAYERS_SRC} $(EFFECTS_SRC) > ${POPCORN_COMPLETE_DIST}.tmp
        @@$(call add_license, ${POPCORN_COMPLETE_DIST}.tmp, ${POPCORN_COMPLETE_DIST})
        @@rm ${POPCORN_COMPLETE_DIST}.tmp
 
@@ -164,6 +186,10 @@ lint-core-tests:
        @@echo "Checking core unit tests against JSLint..."
        @@$(call run_lint,test/popcorn.unit.js)
 
+lint-modules:
+       @@echo "Checking all modules against JSLint..."
+       @@$(call run_lint,$(MODULES_SRC))
+
 lint-plugins:
        @@echo "Checking all plugins against JSLint..."
        @@$(call run_lint,$(PLUGINS_SRC))
@@ -180,6 +206,10 @@ lint-effects:
        @@echo "Checking all effects against JSLint..."
        @@$(call run_lint,$(EFFECTS_SRC))
 
+lint-modules-tests:
+       @@echo "Checking modules unit tests against JSLint..."
+       @@$(call run_lint,$(MODULES_UNIT))
+
 lint-plugin-tests:
        @@echo "Checking plugin unit tests against JSLint..."
        @@$(call run_lint,$(PLUGINS_UNIT))
@@ -216,6 +246,7 @@ testing: complete
        @@rm -fr ${TESTING_MIRROR}/AUTHORS ${TESTING_MIRROR}/LICENSE ${TESTING_MIRROR}/LICENSE_HEADER \
            ${TESTING_MIRROR}/Makefile ${TESTING_MIRROR}/readme.md
        @@touch "${TESTING_MIRROR}/THIS IS A TESTING MIRROR -- READ-ONLY"
+       $(call overwrite_js, ${TESTING_MIRROR}/modules)
        $(call overwrite_js, ${TESTING_MIRROR}/plugins)
        $(call overwrite_js, ${TESTING_MIRROR}/players)
        $(call overwrite_js, ${TESTING_MIRROR}/parsers)
index 122aee3b13eed2bc62498eda8e736da646aa4bc9..c9578fe82a2af16426e3c3dd11387f799f7ca7c0 100644 (file)
@@ -19,7 +19,7 @@
   <div id="qunit-fixture">  </div>
 
   <video id='video'
-    controls preload='none'
+    controls preload='auto'
     width= '250px'
     poster="../../test/poster.png"
     data-timeline-sources="../../parsers/parserJSON/data/video.json">
index e48f174dd1c7e578069b5d21b78c623a1ee8cd34..362158b9f20537965c11714646236656c3df4c54 100644 (file)
@@ -50,7 +50,8 @@
     expect( 3 );
 
     var count = 0,
-        p = Popcorn.getInstanceById( "video" );
+        p = Popcorn.getInstanceById( "video" )
+        .volume( 0 );
 
     function plus() {
       if ( ++count === 3 ) {