]> git.parisson.com Git - pdf.js.git/commitdiff
Use simpler sed and random temp profile names for unit test.
authorKalervo Kujala <kkujala@com>
Thu, 15 Dec 2011 22:23:23 +0000 (00:23 +0200)
committerKalervo Kujala <kkujala@com>
Thu, 15 Dec 2011 22:23:23 +0000 (00:23 +0200)
test/unit/Makefile

index 1e51642e3b97dd552922ba74ac3e04e71a90c690..d2735b16a692cf297a66f972f44166cfb87b30f9 100644 (file)
@@ -1,11 +1,11 @@
 # Create temporary profile directory name.
-TEMP_PROFILE_DIR:=$(shell echo ./test_reports/temp`date +"%Y%m%d%H%M%S"profile`)
+TEMP_PROFILE_DIR=$(shell echo ./test_reports/temp`echo $$RANDOM$$RANDOM`profile)
 
 # These are the Firefox command line arguments.
-FIREFOX_ARGS:=-no-remote -profile $(TEMP_PROFILE_DIR)
+FIREFOX_ARGS=-no-remote -profile $(TEMP_PROFILE_DIR)
 
 # These are the Chrome command line arguments.
-CHROME_ARGS:=--user-data-dir=$(TEMP_PROFILE_DIR) --no-first-run --disable-sync
+CHROME_ARGS=--user-data-dir=$(TEMP_PROFILE_DIR) --no-first-run --disable-sync
 
 # Unit test uses the manifest from ref test to determine which browsers will
 # be used for running the unit tests.
@@ -14,14 +14,14 @@ MANIFEST:=../resources/browser_manifests/browser_manifest.json
 # Fetch the paths to browsers that are going to be used in testing.
 # For OS X the path to the binary needs to be added. Also the browser
 # arguments are added for each of the browser.
-BROWSERS:=$(shell echo `\
-  sed -n 's/.*"path":\(.*\)/\1,/p' $(MANIFEST) | \
-  tr -d '\n' | \
-  sed 's/\(Google Chrome\.app\)/\1\/Contents\/MacOS\/Google Chrome/' | \
-  sed 's/\(Aurora\.app\)/\1\/Contents\/MacOS\/firefox-bin/' | \
-  sed 's/\(Firefox[ Beta]*\.app\)/\1\/Contents\/MacOS\/firefox-bin/' | \
-  sed "s|\(irefox[.exe\-bin]*\)\"|\1;$(FIREFOX_ARGS)\"|g" | \
-  sed "s|\(hrome[.exe]*\)\"|\1;$(CHROME_ARGS)\"|g" \
+BROWSERS=$(shell echo `\
+  sed -n 's|.*"path":\(.*\)|\1,|p' $(MANIFEST) | \
+  sed 's|\(Aurora\.app\)|\1/Contents/MacOS/firefox-bin|' | \
+  sed 's|\(Firefox.*\.app\)|\1/Contents/MacOS/firefox-bin|' | \
+  sed 's|\(Google Chrome\.app\)|\1/Contents/MacOS/Google Chrome|' | \
+  sed "s|\(irefox.*\)\",|\1;$(FIREFOX_ARGS)\",|" | \
+  sed "s|\(hrome.*\)\",|\1;$(CHROME_ARGS)\",|" | \
+  tr -d '\n' \
 `)
 
 # This is the command to invoke the unit test.
@@ -38,7 +38,7 @@ PROG:=java \
 
 test:
        $(PROG)
-       @rm -rf $(TEMP_PROFILE_DIR)
+       @rm -rf ./test_reports/temp*profile
 
 .phony:: test