diff --git a/.gitmodules b/.gitmodules
index e28db70..1777325 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -31,3 +31,6 @@
[submodule "node_modules/fis-deploy-default"]
path = node_modules/fis-deploy-default
url = https://github.com/fex-team/fis-deploy-default
+[submodule "node_modules/fis-preprocessor-components"]
+ path = node_modules/fis-preprocessor-components
+ url = https://github.com/fex-team/fis-preprocessor-components
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b110be0..b402b8f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,117 @@
+## 1.10.1 / Wed May 13 2016
+
+- 升级 fis-command-server 支持 qrcode。
+
+## 1.10.0 / Wed May 11 2016
+
+提供 Node.js 6.x 支持
+
+- 升级 fis-command-release 依赖支持 Node.js 6.x
+- 升级 fis-optimizer-png-compressor 依赖支持 Node.js 6.x
+- 升级 fis-spriter-csssprites 依赖支持 Node.js 6.x
+- 升级 fis-spriter-csssprites 依赖
+- 升级 fis-command-server 依赖
+- 升级 fis-kernel 依赖
+
+## 1.9.44 / Thu Feb 25 2016
+
+- 升级依赖中多个二进制插件版本选择错误的版本修复。
+
+## 1.9.38 / Mon Nov 16 2015
+- 更新 node 4.x 支持
+- 更新 fis-kernel 解决编译机并发编译问题。
+
+## 1.9.34 / Sat Oct 10 2015
+
+- 更新 fis-optimizer-uglify-js,支持sourcemap 文件 domain 设置。
+
+## 1.9.33 / Tue Aug 21 2015
+
+- hotfix [fex-team/fis#646](https://github.com/fex-team/fis/issues/646)
+
+## 1.9.32 / Tue Aug 18 2015
+
+- 升级 fis-optimizer-uglify-js, 修复 uglify 报错时的提示错误。
+
+## 1.9.31 / Wed Jul 29 2015
+
+- 升级 fis-optimizer-uglify-js, 优化 sourcemap
+
+## 1.9.30 / Wed Jul 22 2015
+
+- 升级 fis-command-install 通过镜像下载 fis-components。
+
+## 1.9.29 / Wed Jul 08 2015
+
+> 升级 fis-command-install,解决 component.json 可能被替换成 0 的问题。
+
+## 1.9.28 / Mon Jun 15 2015
+
+> 升级 fis-command-release 解决 watch 时文件夹被删的 bug.
+
+## 1.9.27 / Thu Jun 11 2015
+
+> 升级 fis-kernel 至 v2.0.17
+> 升级 fis-commond-release 至 v0.12.1
+
+- 修复 Bug [#530](https://github.com/fex-team/fis/issues/530)
+ - 缓存 File 对象导致的 watch 两次相互影响的问题
+
+## 1.9.26 / Mon Jun 08 2015
+
+> 升级 fis-command-release 至 v0.12.0
+> 升级 fis-kernel 至 v2.0.16
+
+- 修复 Bug #455
+- 修复 Bug #527
+- project.exclude & project.include 过滤条件也在 watch 时能正常工作
+- 固定 fis-command-install 的版本号
+- 支持 img `srcset`
+
+
+## 1.9.24 / Tue May 26 2015
+
+> 升级 fis-kenerl 至 v2.0.15
+
+## 1.9.21 / Wed May 13 2015
+
+> 升级 fis-command-server至v0.7.5
+
+- 本地调试支持https服务器
+
+## 1.9.20 / Wed May 13 2015
+
+> 升级 fis-postprocessor-jswrapper至v0.0.12
+
+- 恢复原有 `define` 包裹逻辑,防止现有代码异常
+
+## 1.9.19 / Tue May 12 2015
+
+> 升级 fis-optimizer-png-compressor至v0.1.0
+
+> 升级 fis-spriter-csssprites至v0.3.0
+
+- 禁止 png 图片压缩时 `libpng` warning 信息输出 (非 Windows 环境)
+- 提升 Linux x64 上的图片压缩的稳定性,提升 csssprites 的稳定性
+- 提供 Linux / Unix 系统下手动编译依赖图形工具的[教程]()及其[编译脚本](https://github.com/xiangshouding/some-scripts/blob/master/install-fis-image-deps.sh),以防某些系统由于 glibc 版本过低导致已提供二进制扩展无法加载时方便修复;
+
+## 1.9.18 / Wed May 06 2015
+
+> 升级 fis-command-server至v1.7.4
+
+> 升级 fis-deploy-default至v0.0.6
+
+> 升级 fis-postprocessor-jswrapper至v0.0.11
+
+- 修正 `fis server {open|clean}`, `fis release -d preview` 服务器 root 一致性问题;
+
+ 当用户 `fis server start --root=` 设定了某一个目录为服务器 root,那么后续执行
+ `fis server open`、`fis server clean`、`fis release` 的时候都会操作这个目录。这个 root
+ 信息会被保存,现在未提供**重置**的接口。
+
+- 修正 jswrapper 如果一个文件已经 define 的情况下仍然去做 define 的问题
+- 更新了所有依赖的代码,可方便在 fis 仓库查看 fis 依赖的核心代码。
+
## 1.9.16 / Wed Apr 29 2015
> 升级 fis-preprocessor-components 到 0.1.18
diff --git a/node_modules/fis-command-install b/node_modules/fis-command-install
index 1b79f87..52e6211 160000
--- a/node_modules/fis-command-install
+++ b/node_modules/fis-command-install
@@ -1 +1 @@
-Subproject commit 1b79f87dcacdb2fb5cea1a83cd0944bfc6bf75ec
+Subproject commit 52e62118a0b572787a5e5995da7cb79be4871ade
diff --git a/node_modules/fis-command-release b/node_modules/fis-command-release
index edd589f..fe66677 160000
--- a/node_modules/fis-command-release
+++ b/node_modules/fis-command-release
@@ -1 +1 @@
-Subproject commit edd589f13af745050fadbf10ef79bbf957e28bd8
+Subproject commit fe66677c417fc03a5a3be0beace355d67d558596
diff --git a/node_modules/fis-command-server b/node_modules/fis-command-server
index 6ee12da..d6443d1 160000
--- a/node_modules/fis-command-server
+++ b/node_modules/fis-command-server
@@ -1 +1 @@
-Subproject commit 6ee12daa1a339422ec5a9d2db468d0ae4d5c22a7
+Subproject commit d6443d1cedda1d34579838ac435dba056c54c68e
diff --git a/node_modules/fis-deploy-default b/node_modules/fis-deploy-default
index 7b471d7..096566f 160000
--- a/node_modules/fis-deploy-default
+++ b/node_modules/fis-deploy-default
@@ -1 +1 @@
-Subproject commit 7b471d7c879119aad13c5bf6708c38511a7ba085
+Subproject commit 096566fc0f7d9ef794db136d8e0f9f52605277d4
diff --git a/node_modules/fis-kernel b/node_modules/fis-kernel
index 3661aa0..49db1c9 160000
--- a/node_modules/fis-kernel
+++ b/node_modules/fis-kernel
@@ -1 +1 @@
-Subproject commit 3661aa0f991967495beae5be30effb58d1d62dc2
+Subproject commit 49db1c91564f90ea77aefb9feb2b6c5c755df2cd
diff --git a/node_modules/fis-optimizer-clean-css b/node_modules/fis-optimizer-clean-css
index 85db8d2..54bbf23 160000
--- a/node_modules/fis-optimizer-clean-css
+++ b/node_modules/fis-optimizer-clean-css
@@ -1 +1 @@
-Subproject commit 85db8d2de618b8f75a7c62ed9bf24093b7974d58
+Subproject commit 54bbf2300e6fab785ef20ec16d4ba5263b704d27
diff --git a/node_modules/fis-optimizer-png-compressor b/node_modules/fis-optimizer-png-compressor
index 03824ef..8c0a3e6 160000
--- a/node_modules/fis-optimizer-png-compressor
+++ b/node_modules/fis-optimizer-png-compressor
@@ -1 +1 @@
-Subproject commit 03824ef680bd9cdedfa6f40ee9cd115da9222f0d
+Subproject commit 8c0a3e64e583c40230224e481585a1ba5774e94c
diff --git a/node_modules/fis-optimizer-uglify-js b/node_modules/fis-optimizer-uglify-js
index fc63888..d9d6cc0 160000
--- a/node_modules/fis-optimizer-uglify-js
+++ b/node_modules/fis-optimizer-uglify-js
@@ -1 +1 @@
-Subproject commit fc63888b9da14b11492e7ea8cc3ac0df5cf725b9
+Subproject commit d9d6cc09528e417e8ed141b591b6e2baca20dc68
diff --git a/node_modules/fis-postprocessor-jswrapper b/node_modules/fis-postprocessor-jswrapper
index 8e8607c..8c30df3 160000
--- a/node_modules/fis-postprocessor-jswrapper
+++ b/node_modules/fis-postprocessor-jswrapper
@@ -1 +1 @@
-Subproject commit 8e8607cd760b0636134bcfb407b3f929d85c8149
+Subproject commit 8c30df33e02c9bf26c35cfd3b642e3c1b69d1a4a
diff --git a/node_modules/fis-preprocessor-components b/node_modules/fis-preprocessor-components
new file mode 160000
index 0000000..c267bdb
--- /dev/null
+++ b/node_modules/fis-preprocessor-components
@@ -0,0 +1 @@
+Subproject commit c267bdb15d3e06be5585283a28643967442d85af
diff --git a/node_modules/fis-spriter-csssprites b/node_modules/fis-spriter-csssprites
index 08b4e25..09baa28 160000
--- a/node_modules/fis-spriter-csssprites
+++ b/node_modules/fis-spriter-csssprites
@@ -1 +1 @@
-Subproject commit 08b4e257e4ddfcc43e990d21b5a0dbd3ff3f92d5
+Subproject commit 09baa28fa200daacc75f8cc2b91f73ac1ea034bf
diff --git a/package.json b/package.json
index e7ced1e..3b41f00 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "fis",
"description": "front-end integrated solution.",
- "version": "1.9.17",
+ "version": "1.10.7",
"author": "FIS Team ",
"homepage": "http://fis.baidu.com/",
"keywords": [
@@ -27,18 +27,18 @@
"dependencies": {
"colors": "0.6.2",
"commander": "1.3.2",
- "fis-command-install": "~0.1.11",
- "fis-command-release": "0.11.6",
- "fis-command-server": "0.7.3",
- "fis-deploy-default": "0.0.5",
- "fis-kernel": "2.0.12",
+ "fis-command-install": "0.2.15",
+ "fis-command-release": "0.13.0",
+ "fis-command-server": "0.7.9",
+ "fis-deploy-default": "0.1.4",
+ "fis-kernel": "2.0.19",
"fis-preprocessor-components": "1.0.19",
"fis-optimizer-clean-css": "0.0.9",
- "fis-optimizer-png-compressor": "0.0.8",
- "fis-optimizer-uglify-js": "0.1.7",
+ "fis-optimizer-png-compressor": "0.2.2",
+ "fis-optimizer-uglify-js": "0.2.2",
"fis-packager-map": "0.0.9",
- "fis-postprocessor-jswrapper": "0.0.10",
- "fis-spriter-csssprites": "0.2.9",
- "fis-prepackager-derived": "~0.0.2"
+ "fis-postprocessor-jswrapper": "0.0.12",
+ "fis-spriter-csssprites": "0.4.1",
+ "fis-prepackager-derived": "0.0.3"
}
}
diff --git a/test/util/auto-plugin/TestAutoPlugin.php b/test/util/auto-plugin/TestAutoPlugin.php
deleted file mode 100644
index 69ab3c4..0000000
--- a/test/util/auto-plugin/TestAutoPlugin.php
+++ /dev/null
@@ -1,104 +0,0 @@
-multiPackPath=dirname(__FILE__)."/svntest/hao123/output/config";
- $this->onePackPath=dirname(__FILE__)."/svntest/tuangou";
- $this->indexjsPath="/home/work/lib/node_modules/fis-packager-autopack/index.js";
- $this->libPath="/home/work/lib/node_modules/fis-packager-autopack/lib/temp";
- $this->versionPath="/home/work/lib/node_modules/fis-postpackager-ext-map/package.json";
- $this->data=array();
- }
- private function verificationApiUrl(){
- $string=file_get_contents($this->indexjsPath);
- $this->realUrl=$string;
- if(strstr($string,"fedev.baidu.com:8889")||strstr($string,"solar.baidu.com"))
- return true;
- else
- return false;
- }
- private function checkWritabel(){
- if(is_writable($this->libPath))
- return true;
- else
- return false;
- }
- private function checkVersion(){
- $data=json_decode(file_get_contents($this->versionPath),true);
- $data=$data["version"];
- $this->realVersion=$data;
- if($data=="0.0.1"||$data=="0.0.0")
- return false;
- else
- return true;
- }
- private function checkFileMulti(){
- $handle=opendir($this->multiPackPath);
- $mapFile=0;
- while(($filename=readdir($handle))!==false){
- if(strstr($filename,"flat-home-map")){
- $mapFile++;
- }
- }
- if($mapFile>1)
- return true;
- else
- return false;
- }
- private function checkFileOne(){
- $pathA=$this->onePackPath."/fis-pack.json";
- $pathB=$this->onePackPath."/output/config/common-map.json";
- if(file_exists($pathA)&&file_exists($pathB))
- return true;
- else
- return false;
- }
- public function startTest(){
- $data=array();
- $arrPosSu=0;
- $arrPosFa=0;
- if($this->verificationApiUrl())
- $data['success'][$arrPosSu++]=array("Api Url"=>$this->realUrl);
- else
- $data['fail'][$arrPosFa++]=array("Api Url"=>$this->realUrl);
- if($this->checkWritabel())
- $data['success'][$arrPosSu++]=array("file Writabel"=>"Writabel");
- else
- $data['fail'][$arrPosFa++]=array("file Writabel"=>"No Writabel");
- if($this->checkVersion())
- $data['success'][$arrPosSu++]=array("ext-map verison"=>"0.0.1");
- else
- $data['fail'][$arrPosFa++]=array("ext-map verison"=>$this->realVersion);
- if($this->checkFileMulti())
- $data['success'][$arrPosSu++]=array("multi map"=>"success");
- else
- $data['fail'][$arrPosFa++]=array("multi map"=>"fail");
- if($this->checkFileOne())
- $data['success'][$arrPosSu++]=array("one map"=>"success");
- else
- $data['fail'][$arrPosFa++]=array("one map"=>"fail");
- $data['name']="auto-plugin";
- $this->data=$data;
- }
- public function getData(){
- return $this->data;
- }
-}
-$myTest=new TestAutoPlugin();
-$myTest->startTest();
-$myReport=new TestReport();
-$myReport->setData($myTest->getData());
-$myReport->createTestReport();
diff --git a/test/util/auto-plugin/TestReport.class.php b/test/util/auto-plugin/TestReport.class.php
deleted file mode 100644
index 0e750bf..0000000
--- a/test/util/auto-plugin/TestReport.class.php
+++ /dev/null
@@ -1,69 +0,0 @@
-data=array();
- }
- public function setData($data){
- $this->data=$data;
- }
- public function createTestReport(){
- $dom = new DOMDocument("1.0","utf-8");
- $xmlFile = dirname(__FILE__)."/result/report.xml";
- $data=$this->data;
- $totalCount=0;
- $totalFailure=0;
- if(count($data)==0){
- echo "no array data!";
- exit;
- }
- $name=$data['name'];
- if(array_key_exists("success",$data))
- $totalCount = count($data['success']);
- if(array_key_exists("fail",$data)){
- $totalFailure = count($data['fail']);
- $totalCount+=count($data['fail']);
- }
- $testsuites = $dom->createElement("testsuites");
- $dom->appendChild($testsuites);
- $testsuite = $dom->createElement("testsuite");
- $testsuites->appendChild($testsuite);
- $testsuite->setAttribute("name","$name* ");
- $testsuite->setAttribute("tests",$totalCount);
- $testsuite->setAttribute("time",$totalCount);
- $testsuite->setAttribute("failures",$totalFailure);
- $testsuite->setAttribute("total",$totalCount);
- for($i=$totalFailure;$i<$totalCount;$i++){
- $testcase=$dom->createElement("testcase");
- $testsuite->appendChild($testcase);
- $testcase->setAttribute("name",key($data["success"][$i-$totalFailure]));
- $testcase->setAttribute("time","1");
- $testcase->setAttribute("failures","0");
- $testcase->setAttribute("total","1");
- $testcase->setAttribute("type","OK");
- $msgText = $dom->createTextNode(current($data["success"][$i-$totalFailure]));
- $testcase->appendChild($msgText);
- }
- for($i=0;$i<$totalFailure;$i++){
- $testcase=$dom->createElement("testcase");
- $testsuite->appendChild($testcase);
- $testcase->setAttribute("name",key($data["fail"][$i]));
- $testcase->setAttribute("time","1");
- $testcase->setAttribute("failures","1");
- $testcase->setAttribute("total","1");
-
- $failure = $dom->createElement("failure");
- $testcase->appendChild($failure);
- $failure->setAttribute("type","junit.framework.AssertionFailedError");
- $msgText = $dom->createTextNode(current($data["fail"][$i]));
- $failure->appendChild($msgText);
- }
- $dom->save($xmlFile);
- }
-}
\ No newline at end of file
diff --git a/test/util/auto-plugin/start.sh b/test/util/auto-plugin/start.sh
deleted file mode 100644
index 2ebbade..0000000
--- a/test/util/auto-plugin/start.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-npm install -g fis-postpackager-ext-map
-npm install -g fis-packager-autopack
-npm isntall -g fis-parser-bainuo-less
-if [ -d "./svntest" ]; then
-rm -r svntest
-fi
-mkdir svntest
-cd ./svntest
-svn co --username $1 --password $2 https://svn.baidu.com/app/global/hao123/branches/fe/flat-home/hao123_1-0-988_BRANCH ./hao123
-svn co --username $1 --password $2 https://svn.baidu.com/app/search/tuangou/branches/mobile-bainuo/common/tuangou_4-3-102_BRANCH ./tuangou
-cd ./hao123
-fisp release -p -d ./output
-cd ..
-cd ./tuangou
-fisp release -p -d ./output
-cd ../..
-if [ ! -d "./result" ]; then
-mkdir result
-fi
-php TestAutoPlugin.php
-npm uninstall -g fis-postpackager-ext-map
-npm uninstall -g fis-packager-autopack
-npm uninstall -g fis-parser-bainuo-less
-rm -r svntest
\ No newline at end of file
diff --git a/test/util/autopack/TestReport.class.php b/test/util/autopack/TestReport.class.php
deleted file mode 100644
index 4b3977e..0000000
--- a/test/util/autopack/TestReport.class.php
+++ /dev/null
@@ -1,111 +0,0 @@
- Array
- (
- [0] => Array
- (
- [/widget/hot-site/hot-site-async.js] => diff
- )
-
- [1] => Array
- (
- [/widget/sidetoolbar/sidetoolbar-async.js] => diff
- )
-
- [2] => Array
- (
- [/widget/sort-area/shop/shop-async.js] => diff
- )
-
- )
-
- [success] => Array
- (
- [0] => Array
- (
- [diff autopack] => success
- )
- )
-
- [name] => autopack
-)
-*/
-class TestReport {
- private $data;
- public function __construct(){
- $this->data=array();
- }
- public function setData($data){
- $this->data=$data;
- print_r($data);
- }
- public function createTestReport(){
- $dom = new DOMDocument("1.0","utf-8");
- $xmlFile = dirname(__FILE__)."/result/report.xml";
- $data=$this->data;
- $totalCount=0;
- $totalFailure=0;
- $Count = 0;
- $Failure = 0;
- if(file_exists($xmlFile)){
- $dom->load($xmlFile);
- $testsuite = $dom->getElementsByTagName("testsuite")->item(0);
- $totalCount = $testsuite->getAttribute("tests");
- $totalFailure = $testsuite->getAttribute("failures");
- }else{
- $testsuite = $dom->createElement("testsuite");
- $dom->appendChild($testsuite);
- }
- $name=$data['name'];
- if(array_key_exists("success",$data)){
- $Count = count($data['success']);
- $totalCount += $Count;
- }
- if(array_key_exists("fail",$data)){
- $Failure = count($data['fail']);
- $Count += count($data['fail']);
- $totalFailure += $Failure;
- $totalCount += $Count;
- }
- $testsuite->setAttribute("name","$name* ");
- $testsuite->setAttribute("tests",$totalCount);
- $testsuite->setAttribute("time",$totalCount);
- $testsuite->setAttribute("failures",$totalFailure);
- $testsuite->setAttribute("total",$totalCount);
- for($i=$Failure;$i<$Count;$i++){
- $testcase=$dom->createElement("testcase");
- $testsuite->appendChild($testcase);
- $testcase->setAttribute("name",key($data["success"][$i-$Failure]));
- $testcase->setAttribute("time","1");
- $testcase->setAttribute("failures","0");
- $testcase->setAttribute("total","1");
- $testcase->setAttribute("type","OK");
- $msgText = $dom->createTextNode(current($data["success"][$i-$Failure]));
- $testcase->appendChild($msgText);
- }
- for($i=0;$i<$Failure;$i++){
- $testcase=$dom->createElement("testcase");
- $testsuite->appendChild($testcase);
- $testcase->setAttribute("name",key($data["fail"][$i]));
- $testcase->setAttribute("time","1");
- $testcase->setAttribute("failures","1");
- $testcase->setAttribute("total","1");
-
- $failure = $dom->createElement("failure");
- $testcase->appendChild($failure);
- $failure->setAttribute("type","junit.framework.AssertionFailedError");
- $msgText = $dom->createTextNode(current($data["fail"][$i]));
- $failure->appendChild($msgText);
- }
- $dom->save($xmlFile);
- }
-}
\ No newline at end of file
diff --git a/test/util/autopack/TestStaticPack.php b/test/util/autopack/TestStaticPack.php
deleted file mode 100644
index f2d73ee..0000000
--- a/test/util/autopack/TestStaticPack.php
+++ /dev/null
@@ -1,90 +0,0 @@
-data['fail'] = array();
- }
- public function setFile($file1,$file2){
- $this->fileData1=$file1;
- $this->fileData2=$file2;
- }
- private function getJsonData($filePath){
- $fileData=file_get_contents($filePath);
- $fileData=json_decode($fileData,true);
- $arr = array();
- foreach($fileData['data'] as $pack){
- foreach($pack as $key=>$value){
- $arr[$key]=$value;
- }
- }
- return $arr;
- }
- private function calculate($data1,$data2){
- $data1=$this->getJsonData($data1);
- $data2=$this->getJsonData($data2);
- $hash=array();
- foreach($data1 as $key1=>$arrValue1){
- $max=0;
- $tmp="";
- $outdata=array();
- foreach($data2 as $key2=>$arrValue2){
- if(array_key_exists($key2,$hash)) continue;
- $num=0;
- $data=array();
- foreach($arrValue1 as $value1){
- if(in_array($value1,$arrValue2))
- $num++;
- else
- array_push($data,array($value1=>"diff"));
- }
- if($num>=(count($arrValue2)+1)/2){
- foreach($data as $v){
- array_push($this->data["fail"],$v);
- }
- $tmp = $key2;
- $hash[$key2]=1;
- break;
- }
- if($num>$max||$max == 0){
- $max=$num;
- $outdata=$data;
- $tmp=$key2;
- }
- unset($data);
- }
- if(!array_key_exists($tmp,$hash)){
- foreach($outdata as $v){
- array_push($this->data["fail"],$v);
- }
- $hash[$tmp]=1;
- }
- unset($outdata);
- }
- }
-
- public function getResult(){
- $this->calculate($this->fileData1,$this->fileData2);
- $this->data["name"]="autopack";
- $this->data['success'][0]=array("diff autopack"=>"success");
- }
- public function getData(){
- return $this->data;
- }
-};
-
-$case=new TestStaticPack();
-$case->setFile("a.txt","b.txt");
-$case->getResult();
-$report=new TestReport();
-$report->setData($case->getData());
-$report->createTestReport();
-?>
\ No newline at end of file
diff --git a/test/util/autopack/start.sh b/test/util/autopack/start.sh
deleted file mode 100644
index 83a2608..0000000
--- a/test/util/autopack/start.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-npm install -g fis-postpackager-ext-map
-npm install -g fis-packager-autopack
-npm isntall -g fis-parser-bainuo-less
-if [ -d "./result" ]; then
-rm -r result
-fi
-wget -O a.txt "http://fedev.baidu.com:8803/autopack?return=json&fid=baidunuomi&svn=https://svn.baidu.com/app/search/tuangou/branches/mobile-bainuo/common/tuangou_4-3-102_BRANCH"
-wget -O b.txt "http://solar.baidu.com/autopack?return=json&fid=baidunuomi&svn=https://svn.baidu.com/app/search/tuangou/branches/mobile-bainuo/common/tuangou_4-3-102_BRANCH"
-if [ ! -d "./result" ]; then
- mkdir result
-fi
-php TestStaticPack.php
-rm a.txt b.txt
-wget -O a.txt "http://fedev.baidu.com:8803/autopack?return=json&fid=globalhao123&svn=https://svn.baidu.com/app/global/hao123/branches/fe/flat-home/hao123_1-0-988_BRANCH"
-wget -O b.txt "http://solar.baidu.com/autopack?return=json&fid=globalhao123&svn=https://svn.baidu.com/app/global/hao123/branches/fe/flat-home/hao123_1-0-988_BRANCH"
-php TestStaticPack.php
-rm a.txt b.txt
-npm uninstall -g fis-postpackager-ext-map
-npm uninstall -g fis-packager-autopack
-npm uninstall -g fis-parser-bainuo-less
\ No newline at end of file
diff --git a/test/util/diff/File.class.php b/test/util/diff/File.class.php
deleted file mode 100644
index c15bbc1..0000000
--- a/test/util/diff/File.class.php
+++ /dev/null
@@ -1,757 +0,0 @@
-query = substr($path, $pos + 1);
- $path = substr($path, 0, $pos);
- }
- if (is_file($path)) {
- $path = self::realpath($path);
- } else if (is_dir($path)) {
- FISLog::error("File类不能处理目录[{$path}].");
- } else {
- $path = self::normalize($path);
- }
- $this->filepath = $path;
- $split = self::getPathSplit($path, $prefix);
- $this->basename = $basename = array_pop($split);
- $this->dirname = $prefix . implode('/', $split);
- if (($pos = strrpos($basename, '.')) === false) {
- $this->filename = $basename;
- } else {
- $this->filename = substr($basename, 0, $pos);
- $this->ext = $ext = substr($basename, $pos + 1);
- $this->_isText = self::isTextFile('.' . $ext);
- }
- /*
- if($root){
- $this->release = $this->subpath = str_replace($root, '', $this->filepath);
- $this->split = self::getPathSplit($this->subpath);
- } else {
- */
- $this->split = $split;
- //}
- }
-
- /**
- * 返回格式化的文件绝对路径
- * @return string
- */
- public function __toString(){
- return $this->filepath;
- }
-
- /**
- * 返回文件或者目录是否存在
- * @return bool
- */
- public function exists(){
- return file_exists($this->filepath);
- }
-
- /**
- * 从缓存文件中恢复文件数据,包括info、content
- * @param FISCache $cache 缓存对象
- * @return bool 如果缓存存在,则返回true,否则返回false
- */
- public function revertCache(FISCache $cache){
- if($cache->exists()){
- $this->_content = $cache->get();
- $properties = $cache->getCachedFileProperties();
- foreach($properties as $key => $value){
- $this->setInfo($key, $value);
- }
- return true;
- }
- return false;
- }
-
- /**
- * 将文件数据存储为缓存
- * @param FISCache $cache 缓存对象
- * @param bool $replacePHPTag 是否替换php标签
- */
- public function saveCache(FISCache $cache, $replacePHPTag = true){
- $cache->setData($this->getContent(), $replacePHPTag);
- $cache->setProperties($this->getInfo());
- $cache->save();
- }
-
- /**
- * 当前文件是否为文本文件
- * @return bool
- */
- public function isText(){
- return $this->_isText;
- }
-
- /**
- * 获取文件内容,第一次会从源文件中读取,后面会暂存在对象中,供语法工具处理
- * @return mixed
- */
- public function getContent(){
- if($this->_content === null){
- $this->_content = self::read($this->filepath);
- }
- return $this->_content;
- }
-
- /**
- * 设置文件内容
- * @param string $content
- */
- public function setContent($content){
- $this->_content = $content;
- }
-
- /**
- * 设置文件附属信息
- * @param string|array $key
- * @param mixed $value
- */
- public function setInfo($key, $value = null){
- $this->_info[$key] = $value;
- }
-
- /**
- * 批量设置文件附属信息
- * @param array $value
- */
- public function setInfos(Array $value){
- foreach($value as $key => $val){
- $this->_info[$key] = $val;
- }
- }
-
- /**
- * 获取文件附属信息
- * @param null|string $key 如果为null,则返回所有附属信息
- * @return mixed
- */
- public function getInfo($key = null){
- if($key == null){
- return $this->_info;
- } else {
- return $this->_info[$key];
- }
- }
-
- /**
- * 获取文件的hash值,默认返回前8位,可以通过project的md5_length属性来修改
- * @return string
- */
- public function getHash(){
- if(!$this->_hash){
- if(!$this->parsed){
- FIS::parse($this);
- }
- $this->_hash = self::getContentHash($this->getContent());
- }
- return $this->_hash;
- }
-
- //---------------------------------------------- 静态方法 ----------------------------------------------//
-
- /**
- * 获取文件后缀,可以排除“?”查询字符串
- * @static
- * @param string $path
- * @return string
- */
- public static function getExt($path){
- if (($pos = strpos($path, '?')) !== false) {
- $path = substr($path, 0, $pos);
- }
- if (($pos = strrpos($path, '.')) !== false) {
- $ext = substr($path, $pos + 1);
- } else {
- $ext = '';
- }
- return $ext;
- }
-
- /**
- * 根据文件内容获取hash值
- * @static
- * @param $content
- * @return string
- */
- public static function getContentHash($content){
- return substr(
- hash('md4', $content),
- 0,
- FIS::get('project', 'md5_length', 8)
- );
- }
-
- /**
- * 格式化路径字符串
- *
- * * replace "\" to "/"
- * * replace contiguous "/" to one "/"
- * * replace "a/b/../c" to "a/c"
- * * remove "/./"
- * * remove "/" at the end.
- *
- * @static
- * @param string $path 路径字符串(路径存在与否)
- * @return string
- */
- public static function normalize($path) {
- $normal_path = preg_replace(
- array('/[\/\\\\]+/', '/\/\.\//', '/^\.\/|\/\.$/', '/\/$/'),
- array('/', '/', '', ''),
- $path
- );
- $path = $normal_path;
- do {
- $normal_path = $path;
- $path = preg_replace('/[^\\/\\.]+\\/\\.\\.(?:\\/|$)/', '', $normal_path);
- } while ($path != $normal_path);
- $path = preg_replace('/\/$/', '', $path);
- return $path;
- }
-
- /**
- * 判断当前系统是否为windows
- * @static
- * @return bool
- */
- public static function isWin() {
- return FIS_IS_WIN;
- }
-
- /**
- * 判断路径字符串是否是绝对路径
- * @static
- * @param string $path
- * @return bool
- */
- public static function isAbsolute($path) {
- if (self::isWin()) {
- return 0 != preg_match("/^[a-z]\\:/i", $path);
- } else {
- if ($path == '/') {
- return false;
- }
- $split = explode('/', $path);
- return (($split[0] == '' && $split[1] && is_dir('/' . $split[1])) || $split[0] == '~');
- }
- }
-
- /**
- * @static 编译后查看css中引用的文件是否是相对路径,"./"
- * @param $path
- * @return bool
- */
- public static function isRelative($path) {
- return 0 != preg_match('/^[^\/]/i', $path);
- }
-
- /**
- * @static 编译后查看Smarty中引用的文件是否是相对路径,"./"
- * @param $path
- * @return bool
- */
- public static function isTplRelative($path) {
- return 0 != preg_match('/^\./i', $path);
- }
-
- /**
- * 判断文件路径字符串是否为文本文件,文本文件由后缀决定,包括(css、tpl、js、php、txt、json、xml、htm、text、xhtml、html、conf、json、po、config)
- * @static
- * @param string $path
- * @return bool
- */
- public static function isTextFile($path){
- return preg_match('/\.(?:css|tpl|js|php|txt|json|xml|htm|text|xhtml|html|conf|json|po|config)$/i', $path) != false;
- }
-
- /**
- * 将路径或url切分为数组
- * @static
- * @param $url 路径或url
- * @param null $prefix 通过该值可以获取到要处理的路径第一位字符,该值是“/”或空字符串
- * @return array
- */
- public static function getPathSplit($url, &$prefix = null) {
- $prefix = $url{0} == '/' ? '/' : '';
- $url = preg_replace(array('/^\//', '/\/$/'), '', $url);
- return explode('/', $url);
- }
-
- /**
- * 判断给定文件路径是否符合include和exclude规则
- * @static
- * @param string $file 路径字符串
- * @param null $include 包含文件的正则
- * @param null $exclude 排除文件的正则
- * @param null $m 从这个值可以获取包含正则的匹配分组
- * @return bool
- */
- public static function filter($file, $include = null, $exclude = null, &$m = null) {
- return !(($include && preg_match($include, $file, $m) == 0) || ($exclude && preg_match($exclude, $file) != 0));
- }
-
- /**
- * 将通配符字符串翻译为正则表达式
- * @static
- * @param string $pattern
- * @return string
- */
- public static function getPathExpReg($pattern) {
- $rePattern = preg_quote(str_replace('\\', '/', $pattern), '/');
- $dirSep = preg_quote('\\', '/');
- $patternReplacements = array(
- $dirSep . '\*\*' . $dirSep => $dirSep . '.*(?:' . $dirSep . ')?',
- $dirSep . '\*\*' => $dirSep . '.*',
- '\*\*' . $dirSep => '.*',
- '\*\*' => '.*',
- '\*' => '[^' . $dirSep . ']*',
- '\?' => '[^' . $dirSep . ']'
- );
- return str_replace(
- array_keys($patternReplacements),
- array_values($patternReplacements),
- $rePattern
- ) . '$';
- }
-
- /**
- * 返回统一'/'分隔符的realpath结果
- * @static
- * @param string $path
- * @return string|bool
- */
- public static function realpath($path){
- //第一次字符从替换,是防止linux下对\识别错误
- $path = realpath(str_replace('\\', '/', $path));
- if($path && self::isWin()){
- //第二次替换,是将win下的反斜杠替换回来
- $path = str_replace('\\', '/', $path);
- }
- return $path;
- }
-
- /**
- * 查找指定目录下的文件或目录
- * @static
- * @param string $path 目录路径
- * @param null $include 要包含的文件正则,如果设置了,则只有符合这个正则的文件才能被请求到
- * @param null $exclude 要排除的文件正则,如果设置了,即使是包含的文件,也会被排除
- * @param bool $recursion 是否递归查找,默认是true
- * @param bool $include_dir 找到的结果是否包含目录,默认为false,不包含
- * @param array $files 递归用的存储容器,不应该被用到
- * @return array 数组
- */
- public static function find($path, $include = null, $exclude = null, $recursion = true, $include_dir = false, &$files = array()) {
- $path = self::realpath($path);
- if (is_dir($path)) {
- $path .= '/';
- $dir = dir($path);
- while (false !== ($entry = $dir->read())) {
- if ($entry == '.' || $entry == '..' || ($entry{0} == '.' && is_dir($entry))) {
- continue;
- }
- $entry = $path . $entry;
- if (is_dir($entry)) {
- if ($include_dir && self::filter($entry, $include, $exclude)) {
- $files[] = $entry;
- }
- if ($recursion) {
- self::find($entry, $include, $exclude, true, $include_dir, $files);
- }
- } else {
- if (!self::filter($entry, $include, $exclude)) {
- continue;
- }
- $files[] = $entry;
- }
- }
- $dir->close();
- return $files;
- } else if (is_file($path) && self::filter($path, $include, $exclude)) {
- $files[] = $path;
- }
- return $files;
- }
-
- /**
- * 将文件或目录复制到到指定位置,支持从文件复制到文件、从目录复制到目录、从文件复制到目录
- * @static
- * @param string $source 要复制的文件或目录路径
- * @param string $target 目标路径
- * @param null $include 包含文件正则
- * @param null $exclude 排除文件正则
- * @param bool $cover 是否覆盖已存在的目标文件,默认是TRUE,覆盖
- * @param bool $recursion 是否递归复制操作,默认是TRUE,递归
- * @param bool $move 是否为移动操作 默认False
- */
- public static function copy($source, $target, $include = null, $exclude = null, $cover = true, $recursion = true, $move = false) {
- $source = self::realpath($source);
- if (is_dir($source)) {
- $source = $source . '/';
- if (is_file(self::realpath($target))) {
- FISLog::error("There is a file named {$target} can't copy to.");
- } else {
- self::mkdir($target, 0777);
- $target = self::realpath($target) . '/';
- $dir = dir($source);
- while (($file = $dir->read()) !== false) {
- if ($file == '.' || $file == '..' || ($file{0} == '.' && is_dir($file))) {
- continue;
- }
- if (!self::filter(str_replace('\\', '/', $source) . $file, $include, $exclude)) {
- continue;
- }
- $s = $source . $file;
- $t = $target . $file;
- if (is_dir($s)) {
- if ($recursion && stripos(self::realpath($target), self::realpath($file)) === false) {
- self::copy($s, $t, $include, $exclude, $cover, true, $move);
- }
- continue;
- } else if (file_exists($t) && $cover == false) {
- continue;
- } else {
- if (file_exists($t)) {
- self::delete($t);
- }
- if($move)
- rename($s, $t);
- else
- copy($s, $t);
- }
- }
- $dir->close();
- }
- } elseif (is_file($source)) {
- if (is_file($target) && !$cover) {
- return;
- }
- $targetName = null;
- $info = pathinfo($target);
- if (!file_exists($target)) {
- if (array_key_exists('extension', $info)) {
- $target = $info['dirname'];
- $targetName = $info['basename'];
- }
- self::mkdir($target);
- } elseif (is_file($target)) {
- self::delete($target);
- $target = dirname($target);
- $targetName = $info['basename'];
- }
- $info = pathinfo($source);
- $name = isset($targetName) ? $targetName : $info['basename'];
- if($move)
- rename($source, self::realpath($target) . '/' . $name);
- else
- copy($source, self::realpath($target) . '/' . $name);
- } else {
- FISLog::error("The {$source} is not a file or directory!");
- }
- }
-
- /**
- * 删除文件或目录
- * @static
- * @param string $path 要删除的文件或目录
- * @param null $include 要删除的文件正则
- * @param null $exclude 不删除的文件正则
- * @return bool 删除成功返回true,否则返回false
- */
- public static function delete($path, $include = null, $exclude = null) {
- $result = true;
- $path = self::realpath($path);
- //防止错误删除根目录
- if ($path == false || $path == self::realpath('/')) {
- return $result;
- }
- if (is_dir($path)) {
- $path = $path . DIRECTORY_SEPARATOR;
- $dir = dir($path);
- while (($file = $dir->read()) !== false) {
- if ($file == '.' || $file == '..') {
- continue;
- }
- $file = $path . $file;
- if (!self::filter(str_replace('\\', '/', $file), $include, $exclude)) {
- continue;
- }
- if (is_dir($file)) {
- $result = $result && self::delete($file, $include, $exclude);
- } else {
- $result = $result && @unlink($file);
- }
- }
- $dir->close();
- $result = $result && @rmdir($path);
- return $result;
- } else {
- return @unlink($path);
- }
- }
-
- /**
- * 修改文件或目录权限
- * @static
- * @param string $path 文件或目录
- * @param int $mod 权限,默认是0777
- * @return bool 设置成功返回true,否则返回false
- */
- public static function chmod($path, $mod = 0777){
- if(file_exists($path)){
- if(@chmod($path, $mod)){
- return true;
- } else {
- FISLog::error("Chmod path[{$path}] mod[{$mod}] faild.");
- }
- } else {
- FISLog::error("Path[{$path}] is not a dir, can't chmod.");
- }
- return false;
- }
-
- /**
- * 写内容进文件,如果文件不存在,则创建
- * @static
- * @param string $path 目标路径
- * @param string $contents 文件内容
- * @param string $charset 写入的文件编码
- * @param int $dir_perms 设置权限,默认是0777
- * @return bool 写入成功则返回true,否则返回false
- */
- public static function write($path, $contents, $charset = null, $dir_perms = 0777) {
- if ($charset != null) {
- $contents = iconv('UTF-8', $charset, $contents);
- }
- $file = new self($path);
- if ($file->dirname !== '.' && !file_exists($file->dirname)) {
- if(self::mkdir($file->dirname, $dir_perms) == false){
- return false;
- }
- }
- return @file_put_contents($path, $contents) !== false;
- }
-
- /**
- * 从文件中读取内容,如果是文本文件,则以utf-8编码读入内存中
- * @static
- * @param string $file 文件路径
- * @param null|string $charset 此参数可以读取文件编码
- * @return string 返回文件内容
- */
- public static function read($file, &$charset = null) {
- if (is_file($file)) {
- $content = file_get_contents($file);
- if(self::isTextFile($file)){
- $charset = $charset == null ? self::getCharset($content) : self::normalizeCharset($charset);
- $content = iconv($charset, FIS_DEFAULT_CHARSET, $content);
- }
- return $content;
- } else {
- FISLog::error("Unable to get file contents {$file}");
- return '';
- }
- }
-
- /**
- * 判断文本内容的编码
- * @static
- * @param string $content 文本内容
- * @return string 编码值,UTF-8、GB2312或GBK
- */
- public static function getCharset($content) {
- $charset = $defaultCharset = "UTF-8";
- if (function_exists('mb_detect_encoding')) {
- $charset = mb_detect_encoding(
- $content,
- array_unique(
- array(
- $defaultCharset,
- 'UTF-8',
- 'GB2312',
- 'GBK'
- )
- )
- );
- if ($charset === false) {
- $charset = $defaultCharset;
- }
- } else {
- if(utf8_encode(utf8_decode($content)) == $content){
- $charset = 'UTF-8';
- }
- }
- $charset = self::normalizeCharset($charset);
- return $charset;
- }
-
- /**
- * 格式化字符编码
- *
- * * UTF-8 or UTF8 => UTF-8
- * * GBK or CP936 => GBK
- * * GB2312 or EUC-CN => GB2312
- * * other => report a warning
- *
- * @static
- * @param $charset 字符编码名称
- * @return string 格式化后的字符编码名称
- */
- public static function normalizeCharset($charset) {
- $charset = strtoupper($charset);
- switch ($charset) {
- case "UTF-8":
- case "UTF8":
- return "UTF-8";
- case "GBK":
- case "CP936":
- return "GBK";
- case "GB2312":
- case "EUC-CN":
- return "GB2312";
- default :
- FISLog::warning("Unknown charset[{$charset}].");
- }
- return $charset;
- }
-
- /**
- * 创建目录,并设置权限,默认是0777
- * @static
- * @param string $path 目录路径
- * @param int $mode 权限,默认是0777
- * @return bool 设置成功返回true,否则为false
- */
- public static function mkdir($path, $mode = 0777) {
- if (is_dir($path)) {
- return self::chmod($path, $mode);
- } else {
- if(@mkdir($path, $mode, true)){
- return true;
- }
- }
- return false;
- }
-
- public static function getSubpath($rootPath,$filePath){
- $rootPath = File::normalize($rootPath);
- $filePath = File::normalize($filePath);
- return str_replace($rootPath,"",$filePath);
- }
-}
diff --git a/test/util/diff/config.php b/test/util/diff/config.php
deleted file mode 100644
index 2dbc36a..0000000
--- a/test/util/diff/config.php
+++ /dev/null
@@ -1,56 +0,0 @@
-array( //产品线目录
- 'wenku'=>array(
- 'name'=>'wenku',
- 'newoutputdir' => WENKU_PATH.'output_new', //使用新版本编译后的产出
- 'oldoutputdir' => WENKU_PATH.'output_old', //使用旧版本编译后的产出
- "modules" =>"bookeditor" //待编译的模块
- ),
- 'batman'=>array(
- 'name'=>'batman',
- 'newoutputdir' => BATMAN_PATH.'output_new', //使用新版本编译后的产出
- 'oldoutputdir' => BATMAN_PATH.'output_old', //使用旧版本编译后的产出
- "modules" =>"transit,place,common,index,addr,feedback,drive,walk" //待编译的模块
- ),
- 'tieba'=>array(
- 'name'=>'tieba',
- 'newoutputdir' => TIEBA_PATH.'output_new', //使用新版本编译后的产出
- 'oldoutputdir' => TIEBA_PATH.'output_old', //使用旧版本编译后的产出
- "modules" =>"xpb" //待编译的模块
- ),
- 'place'=>array(
- 'name'=>'place',
- 'newoutputdir' => PLACE_PATH.'output_new', //使用新版本编译后的产出
- 'oldoutputdir' => PLACE_PATH.'output_old', //使用旧版本编译后的产出
- "modules" =>"admin,beauty,cater,common,detail,hotel,movie,scope" //待编译的模块
- ),
- 'hao123'=>array(
- 'name'=>'hao123',
- 'newoutputdir' => HAO123_PATH.'output_new', //使用新版本编译后的产出
- 'oldoutputdir' => HAO123_PATH.'output_old', //使用旧版本编译后的产出
- "modules" =>"common,home,lv2" //待编译的模块
- ),
- 'superman'=>array(
- 'name'=>'superman',
- 'newoutputdir' => SUPERMAN_PATH.'output_new', //使用新版本编译后的产出
- 'oldoutputdir' => SUPERMAN_PATH.'output_old', //使用旧版本编译后的产出
- "modules" =>"transit,place,common,index,addr,feedback,drive,walk,third,taxi,user" //待编译的模块
- )
- ),
- 'smarty' => array(
- 'dir' => DIFF_ROOT_PATH.'../../libs/smarty-3.1.5',
- 'templatedir' =>DIFF_ROOT_PATH. 'result/'
- ),
- 'url' =>"http://10.48.30.87:8088/"
-);
\ No newline at end of file
diff --git a/test/util/diff/config_o.php b/test/util/diff/config_o.php
deleted file mode 100644
index 259df3a..0000000
--- a/test/util/diff/config_o.php
+++ /dev/null
@@ -1,60 +0,0 @@
-array( //产品线目录
- 'wenku'=>array(
- 'name'=>'wenku',
- 'newoutputdir' => WENKU_PATH.'output_o_new', //使用新版本编译后的产出
- 'oldoutputdir' => WENKU_PATH.'output_o_old', //使用旧版本编译后的产出
- "modules" =>"bookeditor" //待编译的模块
- ),
- 'batman'=>array(
- 'name'=>'batman',
- 'newoutputdir' => BATMAN_PATH.'output_o_new', //使用新版本编译后的产出
- 'oldoutputdir' => BATMAN_PATH.'output_o_old', //使用旧版本编译后的产出
- "modules" =>"transit,place,common,index,addr,feedback,drive,walk" //待编译的模块
- ),
- 'tieba'=>array(
- 'name'=>'tieba',
- 'newoutputdir' => TIEBA_PATH.'output_o_new', //使用新版本编译后的产出
- 'oldoutputdir' => TIEBA_PATH.'output_o_old', //使用旧版本编译后的产出
- "modules" =>"xpb" //待编译的模块
- ),
- 'place'=>array(
- 'name'=>'place',
- 'newoutputdir' => PLACE_PATH.'output_o_new', //使用新版本编译后的产出
- 'oldoutputdir' => PLACE_PATH.'output_o_old', //使用旧版本编译后的产出
- "modules" =>"admin,beauty,cater,common,detail,hotel,movie,scope" //待编译的模块
- ),
- 'hao123'=>array(
- 'name'=>'hao123',
- 'newoutputdir' => HAO123_PATH.'output_o_new', //使用新版本编译后的产出
- 'oldoutputdir' => HAO123_PATH.'output_o_old', //使用旧版本编译后的产出
- "modules" =>"common,home,lv2" //待编译的模块
- ),
- 'superman'=>array(
- 'name'=>'superman',
- 'newoutputdir' => SUPERMAN_PATH.'output_o_new', //使用新版本编译后的产出
- 'oldoutputdir' => SUPERMAN_PATH.'output_o_old', //使用旧版本编译后的产出
- "modules" =>"transit,place,common,index,addr,feedback,drive,walk,third,taxi,user" //待编译的模块
- )
- ),
- 'smarty' => array(
- 'dir' => DIFF_ROOT_PATH.'../../libs/smarty-3.1.5',
- 'templatedir' =>DIFF_ROOT_PATH. 'result_o/'
- ),
- 'output' => array(
- 'newoutputdir' => 'output_o_new', //使用新版本编译后的产出
- 'oldoutputdir' => 'output_o_old', //使用旧版本编译后的产出
- ),
- 'url' =>"http://10.48.30.87:8088/"
-);
diff --git a/test/util/diff/diff.class.php b/test/util/diff/diff.class.php
deleted file mode 100644
index 3943f2e..0000000
--- a/test/util/diff/diff.class.php
+++ /dev/null
@@ -1,550 +0,0 @@
-proInfo = $product[$productName];
-// $this->analyze = new Analyze();
- }
-
-// protected function getProduct(){
-// $productsvn = $this->proInfo['svn'];
-// $svncmd = "svn co --username=mawenlin --password= --no-auth-cache $productsvn ".$this->proInfo['dir']." 2>&1";
-// exec($svncmd,$info,$ret);
-// if($ret != 0){
-// echo "svn get code error! exist!"."\n";
-// var_dump($info);
-// exit;
-// }
-// }
-
- /**
- * 用新老版本的FIS对产品线的代码进行编译。
- */
-// public function build(){
-// $new = self::getConfig('new');
-// $old = self::getConfig('old');
-// $productmodules = $this->proInfo['modules'];
-//
-//// $this->getProduct();
-// //使用新版本的fis进行编译
-// $cmd_buildnew="php -f build.class.php ".$new['dir']." ".
-// $this->proInfo['newoutputdir']." ".
-// $this->proInfo['dir']." ".
-// $productmodules." ".
-// $this->proInfo['result']." ".
-// $new['fisname']." 2>&1";
-//
-//
-// //使用老版本的fis进行编译
-// $cmd_buildold="php -f build.class.php ".$old['dir']." ".
-// $this->proInfo['oldoutputdir']." ".
-// $this->proInfo['dir']." ".
-// $productmodules." ".
-// $this->proInfo['result']." ".
-// $old['fisname']." 2>&1";
-//
-// var_dump($cmd_buildnew);
-// var_dump($cmd_buildold);
-// exec($cmd_buildnew,$outputnew,$retnew);
-// if($retnew){
-// var_dump($outputnew);
-// exit;
-// }
-// exec($cmd_buildold,$outputold,$retold);
-// if($retold){
-// var_dump($outputold);
-// exit;
-// }
-// reset_product_svn($this->proInfo['dir']);
-// }
- /**
- * 调用文件依赖分析工具,获取分析结果。
- */
-// protected function analyzeEach($fisname,$outputDir,$resultDir){
-// $this->analyze->init($outputDir,ANALYZE_ROOT_PATH);
-//
-// $this->analyze->analyzeFile();
-// //检查文件依赖关系是否正确
-// $this->analyze->lookForDefine();
-//
-// $defines = "analyzeEach($new['fisname'],$this->proInfo['newoutputdir'],$this->proInfo['result']);
-// $this->analyzeEach($old['fisname'],$this->proInfo['oldoutputdir'],$this->proInfo['result']);
-// }
-
- /**
- * 获取define数据不同的地方
- */
-// public function getDefineDiff(){
-// $fisname_new = self::getConfig('new','fisname');
-// $fisname_old = self::getConfig('old','fisname');
-// $resultDir = $this->proInfo['result'];
-// require_once $resultDir."/".$fisname_new."_define.php";
-// require_once $resultDir."/".$fisname_old."_define.php";
-//
-// /** 先比较两个define中文件tpl文件不同的地方 */
-// foreach(${$fisname_new."_define"}['tpl'] as $key1 => $value1){
-// foreach(${$fisname_old."_define"}['tpl'] as $key2 => $value2){
-// if($key1 == $key2 && $value1 == $value2){
-// unset(${$fisname_old."_define"}['tpl'][$key2]);
-// unset(${$fisname_new."_define"}['tpl'][$key1]);
-// }else if($key1 != $key2 && $value1 == $value2){
-// $diff_data = array(
-// 'name' => str_replace("/","_",$value1),
-// 'new' => $value1,
-// 'old' => $value1,
-// 'ext' => 'tpl',
-// );
-// array_push($this->Diff,$diff_data);
-// unset(${$fisname_old."_define"}['tpl'][$key2]);
-// unset(${$fisname_new."_define"}['tpl'][$key1]);
-// }
-// }
-// }
-// if(!empty(${$fisname_new."_define"}['tpl'])){
-// foreach(${$fisname_new."_define"}['tpl'] as $value){
-// $diff_data = array(
-// 'name' => str_replace("/","_",$value),
-// 'new' => $value,
-// 'old' => $value,
-// 'ext' => 'tpl'
-// );
-// array_push($this->Diff,$diff_data);
-// }
-// }
-// if(!empty(${$fisname_old."_define"}['tpl'])){
-// foreach(${$fisname_old."_define"}['tpl'] as $value){
-// $diff_data = array(
-// 'name' => str_replace("/","_",$value),
-// 'new' => $value,
-// 'old' => $value,
-// 'ext' => 'tpl',
-// );
-// array_push($this->Diff,$diff_data);
-// }
-// }
-// }
-
- /**
- * 根据define diff的结果获取,对应文件在新老版本下require的不同值。
- */
-// protected function getRequireDiffFromDifine(){
-// $fisname_new = self::getConfig('new','fisname');
-// $fisname_old = self::getConfig('old','fisname');
-// $resultDir = $this->proInfo['result'];
-// require_once $resultDir."/"."$fisname_new"."_require.php";
-// require_once $resultDir."/"."$fisname_old"."_require.php";
-// $requireDiff=array();
-// foreach($this->Diff as $diff){
-// $diffs = array();
-// foreach(${$fisname_new."_require"} as $class_values){
-// $diffnew = File::normalize($this->proInfo['newoutputdir'] .$diff['new']);
-// //先获取md5值不一样的文件名,然后根据这个文件名去require的数组中获取对应的key值。
-// $keys = array_keys($class_values, $diffnew);
-// if(!empty($keys)){
-// $diffs['new']=$keys;
-// }
-// }
-// //再从老版本里面拿require的信息
-// foreach(${$fisname_old."_require"} as $class_values){
-// $diffold = File::normalize($this->proInfo['oldoutputdir'] .$diff['old']);
-// //先获取md5值不一样的文件名,然后根据这个文件名去require的数组中获取对应的key值。
-// $keys=array_keys($class_values, $diffold);
-// if(!empty($keys)){
-// $diffs['old']=$keys;
-// }
-// }
-// while(!empty($diffs['new'])){
-// $diff=array();
-// $new = array_pop($diffs['new']);
-// $old = array_pop($diffs['old']);
-// $diff['name'] = str_replace("/","_",$new);
-// $diff['new'] = $new;
-// $diff['old'] = $old;
-//
-// $newfile = new FILE($this->proInfo['newoutputdir'].$new);
-// $diff['ext'] = $newfile->ext;
-// $cmd = "diff ".$this->proInfo['newoutputdir'].$new." ".$this->proInfo['oldoutputdir'].$old." 2>&1";
-// exec($cmd,$output,$retdiff);
-// if($retdiff && $diff['ext']!='tpl' && $diff['ext']!="html"){
-// array_push($requireDiff,$diff);
-// }
-// }
-// }
-// foreach($requireDiff as $value){
-// if(!in_array($this->Diff,$value)){
-// array_push($this->Diff,$value);
-// }
-// }
-// return $requireDiff;
-// }
-
- /**
- * 获取文件依赖分析结果
- */
-// public function getLog(){
-// $fisname_new = self::getConfig('new','fisname');
-// $fisname_old = self::getConfig('old','fisname');
-// $resultDir = $this->proInfo['result'];
-// include $resultDir."/"."$fisname_new"."_log.php";
-// include $resultDir."/"."$fisname_old"."_log.php";
-//
-// $this->loginfo['new'] = ${$fisname_new."_log"};
-// $this->loginfo['old'] = ${$fisname_old."_log"};
-// }
-
- /**
- * 获取前后编译时间不同
- */
-// public function getBuildTime(){
-// $fisname_new = self::getConfig('new','fisname');
-// $fisname_old = self::getConfig('old','fisname');
-// $resultDir = $this->proInfo['result'];
-// include $resultDir."/"."$fisname_new"."_buildtime.php";
-// include $resultDir."/"."$fisname_old"."_buildtime.php";
-//
-// $buildtimes['new']=${$fisname_new."_buildtime"};
-// $buildtimes['old']=${$fisname_old."_buildtime"};
-//
-// foreach($buildtimes['new'] as $key => $value){
-// $buildtime = array();
-// $buildtime['module'] = $key;
-// $buildtime['new'] = $value;
-// $buildtime['old'] = $buildtimes['old'][$key];
-// $buildtime['change']=round(($buildtime['new'] - $buildtime['old'])/$buildtime['old'],4)*100;
-// var_dump($buildtime['change']);
-// array_push($this->buildtimeinfo,$buildtime);
-// }
-// }
-
- /**
- * 获取文件夹下文件路径
- */
- protected function getFiles($path){
- if(is_dir($path)){
- $dp=dir($path);
- while($file=$dp->read())
- if($file!='.'&&$file!='..')
- $this->getFiles($path.'/'.$file);
- $dp->close();
- }
- else {
- array_push($this->proInfo['files'],$path);
- }
- }
-
- protected function isImg($file_name,$pass_type=array('jpg','jpeg','gif','bmp','png')){
- $yx_file = $pass_type;
- $kzm = substr(strrchr($file_name,"."),1);
- $is_img = in_array(strtolower($kzm),$yx_file);
- if($is_img){
- return true;
- }else{
- return false;
- }
- }
- /**
- * 展示文件内容不同
- */
- public function DisplayDetails(){
- $smartyConfig = self::getConfig('smarty');
- $outputConfig = self::getConfig('output');
- $diffdatas = array();
- $this->proInfo['files'] = array();
-
- $this->getFiles($this->proInfo['oldoutputdir']);
-
- foreach($this->proInfo['files'] as $path){
- $old = $path;
- $new = str_replace($outputConfig['oldoutputdir'],$outputConfig['newoutputdir'],$old);
- if(filesize($old) != filesize($new) && !preg_match("/fis_version.txt$/", $old)){
- $this->smarty->assign('new',$new);
- $this->smarty->assign('old',$old);
- $newtext = file_get_contents($new);
- $oldtext = file_get_contents($old);
- $nl = '#**!)@#';
- $diffdata = inline_diff($oldtext, $newtext, $nl);
- array_push($diffdatas,$diffdata);
- //文件内容diff的结果展示
- $this->smarty->assign('diffdata',mb_convert_encoding($diffdata,'utf-8', 'gbk'));
- $html = $this->smarty->fetch($smartyConfig['templatedir']."diffdetails.tpl");
- $htmlpath = $smartyConfig['templatedir'].$this->proInfo['name']."_".str_replace("/", "_",substr($old,strrpos($old,$outputConfig['oldoutputdir']) + 13)).".html";
- $fileurl = self::getConfig('url').str_replace("/home/work/repos/","",$htmlpath);
- $diff = array(
- 'url' => $fileurl,
- 'name' => str_replace("/", "_",substr($old,strrpos($old,$outputConfig['oldoutputdir']) + 13)),
- 'old' => substr($old,strrpos($old,$outputConfig['oldoutputdir']) + 13),
- 'new' => substr($old,strrpos($new,$outputConfig['newoutputdir']) + 13)
- );
- array_push($this->Diff, $diff);
- File::write($htmlpath,$html);
- }
- }
-// $this->generateReport($diffdatas);
- }
- /**
- * 分别展示不同的地方
- */
- public function Display(){
-// $this->getDefineDiff(); //tpl文件不同的地方
-// $this->getRequireDiffFromDifine(); //静态资源不同的地方
-// $this->getLog(); //获取文件依赖关系分析信息
-// $this->getBuildTime();//获取编译时间的diff
- $smartyConfig = self::getConfig('smarty');
- require_once $smartyConfig['dir'].'/Smarty.class.php';
- $this->smarty = new Smarty();
- $this->smarty->setTemplateDir($smartyConfig['templatedir']);
-
- //展示文件内容的不同
- $this->DisplayDetails();
-
-// //文件依赖关系分析内容
-// //老的
-// $this->smarty->assign('difflog',$this->loginfo['old']);
-// $html = $this->smarty->fetch($smartyConfig['templatedir']."/analyzeinfo.tpl");
-// File::write($smartyConfig['templatedir'].$this->proInfo['name']."_old_log.html",$html);
-// $oldlogurl = self::getConfig('url').str_replace("/home/work/repos/","",
-// $smartyConfig['templatedir'].$this->proInfo['name']."_old_log.html");
-//
-// //新的
-// $this->smarty->assign('difflog',$this->loginfo['new']);
-// $html = $this->smarty->fetch($smartyConfig['templatedir']."/analyzeinfo.tpl");
-// File::write($smartyConfig['templatedir'].$this->proInfo['name']."_new_log.html",$html);
-// $newlogurl = self::getConfig('url').str_replace("/home/work/repos/","",
-// $smartyConfig['templatedir'].$this->proInfo['name']."_new_log.html");
-
- //不同文件的list展示
- $this->smarty->assign('newversion',file_get_contents($this->proInfo['newoutputdir']."/fis_version.txt"));
- $this->smarty->assign('oldversion',file_get_contents($this->proInfo['oldoutputdir']."/fis_version.txt"));
- $this->smarty->assign('productname',$this->proInfo['name']);
- $this->smarty->assign('difflist',$this->Diff);
- $html = $this->smarty->fetch($smartyConfig['templatedir']."/difflist.tpl");
- File::write($smartyConfig['templatedir'].$this->proInfo['name']."_difflist.html",$html);
-// $diffData = array(
-// $this->proInfo['name'] =>$this->buildtimeinfo
-// );
-// $this->createDiffDate($diffData);
- $this->generateReport($this->Diff);
- }
-
- /**
- * 从php文件加载config,并合并到当前的配置数据中,加载成功则返回true,否则为false
- * @static
- * @param string $path php配置文件的路径,该文件内部代码为,配置数据必须是名为$config的变量
- * @return bool
- */
- public static function loadConfig($path) {
- if(is_file($path)){
- $config = array();
- try {
- include $path;
- } catch (Exception $e) {
- Log::error("配置文件[{$path}]解析失败:" . $e->getMessage());
- }
- self::merge($config);
- return self::$config;
- } else {
- Log::warning("配置文件[{$path}]不存在.");
- }
- return false;
- }
-
- /**
- * 将数据递归合并到当前配置数据上
- * @static
- * @param mixed $data 要合并的关联数组数据
- */
- public static function merge($data){
- self::_merge(self::$config, $data);
- }
- /**
- * 递归合并数据函数
- * @static
- * @param array $source
- * @param mixed $data
- */
- private static function _merge(&$source, $data){
- if(is_array($data)){
- foreach($data as $key => $value){
- if(array_key_exists($key, $source)){
- self::_merge($source[$key], $value);
- } else {
- $source[$key] = $value;
- }
- }
- } else {
- $source = $data;
- }
- }
-
- /**
- * @static
- * @param $key
- * @param $key1
- * @return null 返回配置信息
- */
- public static function getConfig($key,$key1=null){
- if(!$key){
- return null;
- }else if($key1){
- return self::$config[$key][$key1];
- }else{
- return self::$config[$key];
- }
- }
-
-
-
- /*
- *生成测试报告
- *
- */
- private function generateReport($diffdatas){
- $smartyConfig = self::getConfig('smarty');
- $dom = new DOMDocument("1.0","utf-8");
- $xmlFile = $smartyConfig['templatedir']."report.xml";
- $tatalCount = 0;
- $tatalFailure = 0;
-
- if(file_exists($xmlFile)){
- $dom->load($xmlFile);
- $testsuite = $dom->getElementsByTagName("testsuite")->item(0);
- $tatalCount = $testsuite->getAttribute("tests");
- $tatalFailure = $testsuite->getAttribute("failures");
- }else{
- $testsuites = $dom->createElement("testsuites");
- $dom->appendChild($testsuites);
- $testsuite = $dom->createElement("testsuite");
- $testsuites->appendChild($testsuite);
- }
-
- if(is_array($diffdatas) && count($diffdatas)>0){
- $count = count($diffdatas);
- $tatalCount += $count;
- $tatalFailure += $count;
- $testsuite->setAttribute("name","diff* ");
- $testsuite->setAttribute("tests",$tatalCount);
- $testsuite->setAttribute("time",$tatalCount);
- $testsuite->setAttribute("failures",$tatalFailure);
- $testsuite->setAttribute("total",$tatalCount);
-
- foreach($diffdatas as $diffdata){
- $testcase=$dom->createElement("testcase");
- $testsuite->appendChild($testcase);
- $testcase->setAttribute("name",$diffdata["name"]);
- $testcase->setAttribute("time","1");
- $testcase->setAttribute("failures","1");
- $testcase->setAttribute("total","1");
-
- $failure = $dom->createElement("failure");
- $testcase->appendChild($failure);
- $failure->setAttribute("type","junit.framework.AssertionFailedError");
- $msgText = $dom->createTextNode("diff");
- $failure->appendChild($msgText);
-
- }
-
- }else if(!file_exists($xmlFile)){
-
- $testsuite->setAttribute("name","diff* ");
- $testsuite->setAttribute("tests",1);
- $testsuite->setAttribute("time",1);
- $testsuite->setAttribute("failures",0);
- $testsuite->setAttribute("total",1);
-
- $testcase=$dom->createElement("testcase");
- $testsuite->appendChild($testcase);
- $testcase->setAttribute("name","testcase0");
- $testcase->setAttribute("time","1");
- $testcase->setAttribute("failures","0");
- $testcase->setAttribute("total","1");
- }
- $dom->save($xmlFile);
- }
-
-
-
- /*
- * 生成diff文件,提供给report工具使用
- * */
- private function createDiffDate($diffdatas){
- $smartyConfig = self::getConfig('smarty');
- $saveFile = $smartyConfig['templatedir']."diffDate.php";
- $fileData = array();
- if(file_exists($saveFile)){
- $fileData = include $saveFile;
- }
- //$res = array_diff($fileData,$diffdatas);
- //$fileData = $res;
- $fileData = array_merge($fileData,$diffdatas);
- $str_content = "build();
-//$diff->analyze();
-//$diff->Display();
-//$diff->Display("require");
-
-
-
diff --git a/test/util/diff/diffall.class.php b/test/util/diff/diffall.class.php
deleted file mode 100644
index 263c75a..0000000
--- a/test/util/diff/diffall.class.php
+++ /dev/null
@@ -1,22 +0,0 @@
- $value){
- $diff = new Diff($pro);
-// $diff->build();
-// $diff->analyze();
- $diff->Display();
- $productlist[$pro]['url'] = diff::getConfig('url').str_replace("/home/work/repos/","",
- $smartyConfig['templatedir'].$pro."_difflist.html");
-}
-$smarty = new Smarty();
-$smarty->assign('productsdiff',$productlist);
-$html = $smarty->fetch($smartyConfig['templatedir']."/productsdiff.tpl");
-File::write($smartyConfig['templatedir']."productsdiff.html",$html);
\ No newline at end of file
diff --git a/test/util/diff/inline_diff/inline_function.php b/test/util/diff/inline_diff/inline_function.php
deleted file mode 100644
index c4a3f3e..0000000
--- a/test/util/diff/inline_diff/inline_function.php
+++ /dev/null
@@ -1,63 +0,0 @@
-render($diff);
-}
\ No newline at end of file
diff --git a/test/util/diff/inline_diff/inline_renderer.php b/test/util/diff/inline_diff/inline_renderer.php
deleted file mode 100644
index fe432a8..0000000
--- a/test/util/diff/inline_diff/inline_renderer.php
+++ /dev/null
@@ -1,72 +0,0 @@
-';
- var $ins_suffix = '';
- var $del_prefix = '';
- var $del_suffix = '
';
-
- function Text_Diff_Renderer_inline($context_lines = 10000, $ins_prefix = '', $ins_suffix = '
', $del_prefix = '', $del_suffix = '
')
- {
- $this->$ins_prefix = $ins_prefix;
- $this->$ins_suffix = $ins_suffix;
- $this->$del_prefix = $del_prefix;
- $this->$del_suffix = $del_suffix;
-
- $this->_leading_context_lines = $context_lines;
- $this->_trailing_context_lines = $context_lines;
- }
-
- function _lines($lines)
- {
- $value="";
- foreach ($lines as $line) {
- $value.="$line ";
- // FIXME: don't output space if it's the last line.
- }
- return "".$value."";
- }
-
- function _blockHeader($xbeg, $xlen, $ybeg, $ylen)
- {
- return '';
- }
-
- function _startBlock($header)
- {
- return $header;
- }
-
- function _context($lines)
- {
- return $this->_lines($lines, ' ');
- }
- function _added($lines)
- {
- return $this->ins_prefix.$this->_lines($lines).$this->ins_suffix;
- }
-
- function _deleted($lines)
- {
- return $this->del_prefix.$this->_lines($lines).$this->del_suffix;
- }
-
- function _changed($orig, $final)
- {
- return "".$this->_deleted($orig) ."
". $this->_added($final)."
";
- }
-
-}
diff --git a/test/util/diff/new_fis_ready.sh b/test/util/diff/new_fis_ready.sh
deleted file mode 100644
index e22f20b..0000000
--- a/test/util/diff/new_fis_ready.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env bash
-
-TEST_PATH=/home/work/repos/fis/test/util/diff
-FIS_PATH=/home/work/repos/fis/
-FISP_PATH=/home/work/lib/node_modules/fis-plus
-FISP_FIS_PATH=${FISP_PATH}/node_modules/fis
-
-cd ${FIS_PATH}
-rm -rf node_modules
-npm install
-npm install fis-preprocessor-image-set
-npm install fis-postpackager-ext-map
-npm install fis-packager-autopack
-
-npm cache clean
-npm update -g fis-plus
-
-rm -rf ${FISP_PATH}/node_modules/fis
-cp -r ${FIS_PATH} ${FISP_FIS_PATH}
-rm -rf ${FISP_FIS_PATH}/test
-
-sh ${TEST_PATH}/release$1.sh new
diff --git a/test/util/diff/old_fis_ready.sh b/test/util/diff/old_fis_ready.sh
deleted file mode 100644
index 9ca343b..0000000
--- a/test/util/diff/old_fis_ready.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/home/work/.jumbo/bin/expect
-
-set timeout 480
-set p [lindex $argv 0]
-set o [lindex $argv 1]
-#send_user $s
-spawn su - fis -c "sh /home/work/repos/fis/test/util/diff/release$o.sh old"
-expect "Password:"
-send $p\r
-expect eof
-exit
diff --git a/test/util/diff/old_fis_scp.sh b/test/util/diff/old_fis_scp.sh
deleted file mode 100644
index 876d5da..0000000
--- a/test/util/diff/old_fis_scp.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/home/work/.jumbo/bin/expect
-
-set timeout 60
-set p [lindex $argv 0]
-spawn su - fis -c "sh /home/fis/npm/lib/upload.sh"
-expect "Password:"
-send $p\r
-expect "fis@fe's password:"
-send $p\r
-expect eof
-exit
diff --git a/test/util/diff/product_code.sh b/test/util/diff/product_code.sh
deleted file mode 100644
index 4c7e57d..0000000
--- a/test/util/diff/product_code.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env bash
-
-TEST_PATH=/home/work/repos/fis/test/util/diff
-cd ${TEST_PATH}
-
-PLACE_SVN=https://svn.baidu.com/app/search/lbs-webapp/trunk/pcmap/place
-PLACE_DIR=./product_code/place
-
-BATMAN_SVN=https://svn.baidu.com/app/search/lbs-webapp/trunk/mmap/batman
-BATMAN_DIR=./product_code/batman
-
-WENKU_SVN=https://svn.baidu.com/app/search/wenku/branches/fe/bookeditor/wenku_1001-0-253_BRANCH
-WENKU_DIR=./product_code/wenku
-
-TIEBA_SVN=https://svn.baidu.com/app/search/forum/branches/fe/pad/xpad/pb/xpadpb_1-0-0_BRANCH
-TIEBA_DIR=./product_code/tieba
-
-HAO123_SVN=https://svn.baidu.com/app/global/hao123/trunk/fe
-HAO123_DIR=./product_code/hao123
-
-SUPERMAN_SVN=https://svn.baidu.com/app/search/lbs-webapp/trunk/mmap/superman
-SUPERMAN_DIR=./product_code/superman
-
-svn co --username=$1 --password=$2 --no-auth-cache ${PLACE_SVN} ${PLACE_DIR}
-svn co --username=$1 --password=$2 --no-auth-cache ${BATMAN_SVN} ${BATMAN_DIR}
-svn co --username=$1 --password=$2 --no-auth-cache ${WENKU_SVN} ${WENKU_DIR}
-svn co --username=$1 --password=$2 --no-auth-cache ${TIEBA_SVN} ${TIEBA_DIR}
-svn co --username=$1 --password=$2 --no-auth-cache ${HAO123_SVN}/common ${HAO123_DIR}/common
-svn co --username=$1 --password=$2 --no-auth-cache ${HAO123_SVN}/home ${HAO123_DIR}/home
-svn co --username=$1 --password=$2 --no-auth-cache ${HAO123_SVN}/lv2 ${HAO123_DIR}/lv2
-svn co --username=$1 --password=$2 --no-auth-cache ${SUPERMAN_SVN} ${SUPERMAN_DIR}
diff --git a/test/util/diff/release.sh b/test/util/diff/release.sh
deleted file mode 100644
index 4a4b38d..0000000
--- a/test/util/diff/release.sh
+++ /dev/null
@@ -1,156 +0,0 @@
-#!/usr/bin/env bash
-
-TEST_PATH=/home/work/repos/fis/test/util/diff
-FIS_PATH=/home/work/repos/fis/
-NEW_FISP_FIS_PATH=/home/work/lib/node_modules/fis-plus/node_modules/fis
-OLD_FISP_FIS_PATH=/home/fis/npm/lib/node_modules/fis-plus/node_modules/fis/
-cd ${TEST_PATH}
-WENKU_CODE_PATH=${TEST_PATH}/product_code/wenku
-WENKU_OUTPUT_PATH=${TEST_PATH}/product_output/wenku
-
-TIEBA_CODE_PATH=${TEST_PATH}/product_code/tieba
-TIEBA_OUTPUT_PATH=${TEST_PATH}/product_output/tieba
-
-BATMAN_CODE_PATH=${TEST_PATH}/product_code/batman
-BATMAN_OUTPUT_PATH=${TEST_PATH}/product_output/batman
-BATMAN_MODULES=(transit place common index addr feedback drive walk)
-
-PLACE_CODE_PATH=${TEST_PATH}/product_code/place
-PLACE_OUTPUT_PATH=${TEST_PATH}/product_output/place
-PLACE_MODULES=(admin beauty cater common detail hotel movie scope)
-
-HAO123_CODE_PATH=${TEST_PATH}/product_code/hao123
-HAO123_OUTPUT_PATH=${TEST_PATH}/product_output/hao123
-HAO123_MODULES=(common home lv2)
-
-SUPERMAN_CODE_PATH=${TEST_PATH}/product_code/superman
-SUPERMAN_OUTPUT_PATH=${TEST_PATH}/product_output/superman
-SUPERMAN_MODULES=(transit place common index addr feedback drive walk third taxi user)
-
-#获取fis version
-if [ $1 = 'new' ]
-then
- version=$(node ${NEW_FISP_FIS_PATH}/bin/fis -v --no-color)
-else
- version=$(node ${OLD_FISP_FIS_PATH}/bin/fis -v --no-color)
-fi
-
-OLD_IFS="$IFS"
-IFS=" "
-arr=($version)
-IFS="$OLD_IFS"
-v=${arr[1]}
-
-# 执行release
-if [ $1 = 'new' ]
-then
- #wenku
- rm -rf ${WENKU_OUTPUT_PATH}/output_new
- cd ${WENKU_CODE_PATH}
- ${NEW_FISP_FIS_PATH}/bin/fis release -cd ${WENKU_OUTPUT_PATH}/output_new --no-color
- echo $v > ${WENKU_OUTPUT_PATH}/output_new/fis_version.txt
- chmod 777 ${WENKU_OUTPUT_PATH}
-
- #tieba
- rm -rf ${TIEBA_OUTPUT_PATH}/output_new
- cd ${TIEBA_CODE_PATH}
- ${NEW_FISP_FIS_PATH}/bin/fis release -cpd ${TIEBA_OUTPUT_PATH}/output_new --no-color
- echo $v > ${TIEBA_OUTPUT_PATH}/output_new/fis_version.txt
- chmod 777 ${TIEBA_OUTPUT_PATH}
-
- #batman
- rm -rf ${BATMAN_OUTPUT_PATH}/output_new
- for module in ${BATMAN_MODULES[@]}
- do
- cd ${BATMAN_CODE_PATH}/$module
- fisp release -cpd ${BATMAN_OUTPUT_PATH}/output_new --no-color
- done
- echo $v > ${BATMAN_OUTPUT_PATH}/output_new/fis_version.txt
- chmod 777 ${BATMAN_OUTPUT_PATH}
-
- #place
- rm -rf ${PLACE_OUTPUT_PATH}/output_new
- for module in ${PLACE_MODULES[@]}
- do
- cd ${PLACE_CODE_PATH}/$module
- fisp release -cpd ${PLACE_OUTPUT_PATH}/output_new --no-color
- done
- echo $v > ${PLACE_OUTPUT_PATH}/output_new/fis_version.txt
- chmod 777 ${PLACE_OUTPUT_PATH}
-
- #hao123
- rm -rf ${HAO123_OUTPUT_PATH}/output_new
- for module in ${HAO123_MODULES[@]}
- do
- cd ${HAO123_CODE_PATH}/$module
- fisp release -cpd ${HAO123_OUTPUT_PATH}/output_new --no-color
- done
- echo $v > ${HAO123_OUTPUT_PATH}/output_new/fis_version.txt
- chmod 777 ${HAO123_OUTPUT_PATH}
-
- #superman
- rm -rf ${SUPERMAN_OUTPUT_PATH}/output_new
- for module in ${SUPERMAN_MODULES[@]}
- do
- cd ${SUPERMAN_CODE_PATH}/$module
- fisp release -cpd ${SUPERMAN_OUTPUT_PATH}/output_new --no-color
- done
- echo $v > ${SUPERMAN_OUTPUT_PATH}/output_new/fis_version.txt
- chmod 777 ${SUPERMAN_OUTPUT_PATH}
-
-else
- #wenku
- rm -rf ${WENKU_OUTPUT_PATH}/output_old
- cd ${WENKU_CODE_PATH}
- ${OLD_FISP_FIS_PATH}/bin/fis release -cd ${WENKU_OUTPUT_PATH}/output_old --no-color
- echo $v > ${WENKU_OUTPUT_PATH}/output_old/fis_version.txt
- chmod 777 -R ${WENKU_OUTPUT_PATH}/output_old
-
- #tieba
- rm -rf ${TIEBA_OUTPUT_PATH}/output_old
- cd ${TIEBA_CODE_PATH}
- ${OLD_FISP_FIS_PATH}/bin/fis release -cpd ${TIEBA_OUTPUT_PATH}/output_old --no-color
- echo $v > ${TIEBA_OUTPUT_PATH}/output_old/fis_version.txt
- chmod 777 -R ${TIEBA_OUTPUT_PATH}/output_old
-
- #batman
- rm -rf ${BATMAN_OUTPUT_PATH}/output_old
- for module in ${BATMAN_MODULES[@]}
- do
- cd ${BATMAN_CODE_PATH}/$module
- fisp release -cpd ${BATMAN_OUTPUT_PATH}/output_old --no-color
- done
- echo $v > ${BATMAN_OUTPUT_PATH}/output_old/fis_version.txt
- chmod 777 -R ${BATMAN_OUTPUT_PATH}/output_old
-
- #place
- rm -rf ${PLACE_OUTPUT_PATH}/output_old
- for module in ${PLACE_MODULES[@]}
- do
- cd ${PLACE_CODE_PATH}/$module
- fisp release -cpd ${PLACE_OUTPUT_PATH}/output_old --no-color
- done
- echo $v > ${PLACE_OUTPUT_PATH}/output_old/fis_version.txt
- chmod 777 -R ${PLACE_OUTPUT_PATH}/output_old
-
- #hao123
- rm -rf ${HAO123_OUTPUT_PATH}/output_old
- for module in ${HAO123_MODULES[@]}
- do
- cd ${HAO123_CODE_PATH}/$module
- fisp release -cpd ${HAO123_OUTPUT_PATH}/output_old --no-color
- done
- echo $v > ${HAO123_OUTPUT_PATH}/output_old/fis_version.txt
- chmod 777 -R ${HAO123_OUTPUT_PATH}/output_old
-
- #superman
- rm -rf ${SUPERMAN_OUTPUT_PATH}/output_old
- for module in ${SUPERMAN_MODULES[@]}
- do
- cd ${SUPERMAN_CODE_PATH}/$module
- fisp release -cpd ${SUPERMAN_OUTPUT_PATH}/output_old --no-color
- done
- echo $v > ${SUPERMAN_OUTPUT_PATH}/output_old/fis_version.txt
- chmod 777 -R ${SUPERMAN_OUTPUT_PATH}/output_old
-
-fi
diff --git a/test/util/diff/release_o.sh b/test/util/diff/release_o.sh
deleted file mode 100644
index 7f7d214..0000000
--- a/test/util/diff/release_o.sh
+++ /dev/null
@@ -1,156 +0,0 @@
-#!/usr/bin/env bash
-
-TEST_PATH=/home/work/repos/fis/test/util/diff
-FIS_PATH=/home/work/repos/fis/
-NEW_FISP_FIS_PATH=/home/work/lib/node_modules/fis-plus/node_modules/fis
-OLD_FISP_FIS_PATH=/home/fis/npm/lib/node_modules/fis-plus/node_modules/fis/
-cd ${TEST_PATH}
-WENKU_CODE_PATH=${TEST_PATH}/product_code/wenku
-WENKU_OUTPUT_PATH=${TEST_PATH}/product_output/wenku
-
-TIEBA_CODE_PATH=${TEST_PATH}/product_code/tieba
-TIEBA_OUTPUT_PATH=${TEST_PATH}/product_output/tieba
-
-BATMAN_CODE_PATH=${TEST_PATH}/product_code/batman
-BATMAN_OUTPUT_PATH=${TEST_PATH}/product_output/batman
-BATMAN_MODULES=(transit place common index addr feedback drive walk)
-
-PLACE_CODE_PATH=${TEST_PATH}/product_code/place
-PLACE_OUTPUT_PATH=${TEST_PATH}/product_output/place
-PLACE_MODULES=(admin beauty cater common detail hotel movie scope)
-
-HAO123_CODE_PATH=${TEST_PATH}/product_code/hao123
-HAO123_OUTPUT_PATH=${TEST_PATH}/product_output/hao123
-HAO123_MODULES=(common home lv2)
-
-SUPERMAN_CODE_PATH=${TEST_PATH}/product_code/superman
-SUPERMAN_OUTPUT_PATH=${TEST_PATH}/product_output/superman
-SUPERMAN_MODULES=(transit place common index addr feedback drive walk third taxi user)
-
-#获取fis version
-if [ $1 = 'new' ]
-then
- version=$(node ${NEW_FISP_FIS_PATH}/bin/fis -v --no-color)
-else
- version=$(node ${OLD_FISP_FIS_PATH}/bin/fis -v --no-color)
-fi
-
-OLD_IFS="$IFS"
-IFS=" "
-arr=($version)
-IFS="$OLD_IFS"
-v=${arr[1]}
-
-# 执行release
-if [ $1 = 'new' ]
-then
- #wenku
- rm -rf ${WENKU_OUTPUT_PATH}/output_o_new
- cd ${WENKU_CODE_PATH}
- ${NEW_FISP_FIS_PATH}/bin/fis release -cd ${WENKU_OUTPUT_PATH}/output_o_new --no-color
- echo $v > ${WENKU_OUTPUT_PATH}/output_o_new/fis_version.txt
- chmod 777 ${WENKU_OUTPUT_PATH}
-
- #tieba
- rm -rf ${TIEBA_OUTPUT_PATH}/output_o_new
- cd ${TIEBA_CODE_PATH}
- ${NEW_FISP_FIS_PATH}/bin/fis release -copd ${TIEBA_OUTPUT_PATH}/output_o_new --no-color
- echo $v > ${TIEBA_OUTPUT_PATH}/output_o_new/fis_version.txt
- chmod 777 ${TIEBA_OUTPUT_PATH}
-
- #batman
- rm -rf ${BATMAN_OUTPUT_PATH}/output_o_new
- for module in ${BATMAN_MODULES[@]}
- do
- cd ${BATMAN_CODE_PATH}/$module
- fisp release -copd ${BATMAN_OUTPUT_PATH}/output_o_new --no-color
- done
- echo $v > ${BATMAN_OUTPUT_PATH}/output_o_new/fis_version.txt
- chmod 777 ${BATMAN_OUTPUT_PATH}
-
- #place
- rm -rf ${PLACE_OUTPUT_PATH}/output_o_new
- for module in ${PLACE_MODULES[@]}
- do
- cd ${PLACE_CODE_PATH}/$module
- fisp release -copd ${PLACE_OUTPUT_PATH}/output_o_new --no-color
- done
- echo $v > ${PLACE_OUTPUT_PATH}/output_o_new/fis_version.txt
- chmod 777 ${PLACE_OUTPUT_PATH}
-
- #hao123
- rm -rf ${HAO123_OUTPUT_PATH}/output_o_new
- for module in ${HAO123_MODULES[@]}
- do
- cd ${HAO123_CODE_PATH}/$module
- fisp release -copd ${HAO123_OUTPUT_PATH}/output_o_new --no-color
- done
- echo $v > ${HAO123_OUTPUT_PATH}/output_o_new/fis_version.txt
- chmod 777 ${HAO123_OUTPUT_PATH}
-
- #superman
- rm -rf ${SUPERMAN_OUTPUT_PATH}/output_o_new
- for module in ${SUPERMAN_MODULES[@]}
- do
- cd ${SUPERMAN_CODE_PATH}/$module
- fisp release -copd ${SUPERMAN_OUTPUT_PATH}/output_o_new --no-color
- done
- echo $v > ${SUPERMAN_OUTPUT_PATH}/output_o_new/fis_version.txt
- chmod 777 ${SUPERMAN_OUTPUT_PATH}
-
-else
- #wenku
- rm -rf ${WENKU_OUTPUT_PATH}/output_o_old
- cd ${WENKU_CODE_PATH}
- ${OLD_FISP_FIS_PATH}/bin/fis release -cd ${WENKU_OUTPUT_PATH}/output_o_old --no-color
- echo $v > ${WENKU_OUTPUT_PATH}/output_o_old/fis_version.txt
- chmod 777 -R ${WENKU_OUTPUT_PATH}/output_o_old
-
- #tieba
- rm -rf ${TIEBA_OUTPUT_PATH}/output_o_old
- cd ${TIEBA_CODE_PATH}
- ${OLD_FISP_FIS_PATH}/bin/fis release -copd ${TIEBA_OUTPUT_PATH}/output_o_old --no-color
- echo $v > ${TIEBA_OUTPUT_PATH}/output_o_old/fis_version.txt
- chmod 777 -R ${TIEBA_OUTPUT_PATH}/output_o_old
-
- #batman
- rm -rf ${BATMAN_OUTPUT_PATH}/output_o_old
- for module in ${BATMAN_MODULES[@]}
- do
- cd ${BATMAN_CODE_PATH}/$module
- fisp release -copd ${BATMAN_OUTPUT_PATH}/output_o_old --no-color
- done
- echo $v > ${BATMAN_OUTPUT_PATH}/output_o_old/fis_version.txt
- chmod 777 -R ${BATMAN_OUTPUT_PATH}/output_o_old
-
- #place
- rm -rf ${PLACE_OUTPUT_PATH}/output_o_old
- for module in ${PLACE_MODULES[@]}
- do
- cd ${PLACE_CODE_PATH}/$module
- fisp release -copd ${PLACE_OUTPUT_PATH}/output_o_old --no-color
- done
- echo $v > ${PLACE_OUTPUT_PATH}/output_o_old/fis_version.txt
- chmod 777 -R ${PLACE_OUTPUT_PATH}/output_o_old
-
- #hao123
- rm -rf ${HAO123_OUTPUT_PATH}/output_o_old
- for module in ${HAO123_MODULES[@]}
- do
- cd ${HAO123_CODE_PATH}/$module
- fisp release -copd ${HAO123_OUTPUT_PATH}/output_o_old --no-color
- done
- echo $v > ${HAO123_OUTPUT_PATH}/output_o_old/fis_version.txt
- chmod 777 -R ${HAO123_OUTPUT_PATH}/output_o_old
-
- #superman
- rm -rf ${SUPERMAN_OUTPUT_PATH}/output_o_old
- for module in ${SUPERMAN_MODULES[@]}
- do
- cd ${SUPERMAN_CODE_PATH}/$module
- fisp release -copd ${SUPERMAN_OUTPUT_PATH}/output_o_old --no-color
- done
- echo $v > ${SUPERMAN_OUTPUT_PATH}/output_o_old/fis_version.txt
- chmod 777 -R ${SUPERMAN_OUTPUT_PATH}/output_o_old
-
-fi
diff --git a/test/util/diff/result/diffdetails.tpl b/test/util/diff/result/diffdetails.tpl
deleted file mode 100644
index 34a872b..0000000
--- a/test/util/diff/result/diffdetails.tpl
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-diff details
-
-
-
-
-
-
-
- | 红色代表老版本编译后的结果{$old} |
-
-
- | 绿色代表新版本编译后的结果{$new} |
-
-
- | diff details |
-
-
- |
-
- {$diffdata}
-
- |
-
-
-
-
-
diff --git a/test/util/diff/result/difflist.tpl b/test/util/diff/result/difflist.tpl
deleted file mode 100644
index b2ba0f0..0000000
--- a/test/util/diff/result/difflist.tpl
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
- diff file list
-
-
-
-
-
-
- | {$productname} diff info: |
-
-
-
-
-
- | file name |
- new({$newversion}) |
- old({$oldversion}) |
-
- {foreach $difflist as $value}
-
- | {$value.name} |
- {$value.new} |
- {$value.old} |
-
- {/foreach}
-
- |
-
-
-
-
diff --git a/test/util/diff/result/productsdiff.tpl b/test/util/diff/result/productsdiff.tpl
deleted file mode 100644
index 48cf845..0000000
--- a/test/util/diff/result/productsdiff.tpl
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
- diff file list
-
-
-
-
-product difflist info:
-
-
- | product name |
- diff result |
-
-{foreach $productsdiff as $value}
-
-
- | {$value.name} |
- click here >> |
-
-{/foreach}
-
-
-
-
-
-
diff --git a/test/util/diff/result_o/diffdetails.tpl b/test/util/diff/result_o/diffdetails.tpl
deleted file mode 100644
index 34a872b..0000000
--- a/test/util/diff/result_o/diffdetails.tpl
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-diff details
-
-
-
-
-
-
-
- | 红色代表老版本编译后的结果{$old} |
-
-
- | 绿色代表新版本编译后的结果{$new} |
-
-
- | diff details |
-
-
- |
-
- {$diffdata}
-
- |
-
-
-
-
-
diff --git a/test/util/diff/result_o/difflist.tpl b/test/util/diff/result_o/difflist.tpl
deleted file mode 100644
index b2ba0f0..0000000
--- a/test/util/diff/result_o/difflist.tpl
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
- diff file list
-
-
-
-
-
-
- | {$productname} diff info: |
-
-
-
-
-
- | file name |
- new({$newversion}) |
- old({$oldversion}) |
-
- {foreach $difflist as $value}
-
- | {$value.name} |
- {$value.new} |
- {$value.old} |
-
- {/foreach}
-
- |
-
-
-
-
diff --git a/test/util/diff/result_o/productsdiff.tpl b/test/util/diff/result_o/productsdiff.tpl
deleted file mode 100644
index 48cf845..0000000
--- a/test/util/diff/result_o/productsdiff.tpl
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
- diff file list
-
-
-
-
-product difflist info:
-
-
- | product name |
- diff result |
-
-{foreach $productsdiff as $value}
-
-
- | {$value.name} |
- click here >> |
-
-{/foreach}
-
-
-
-
-
-
diff --git a/test/util/diff/start.sh b/test/util/diff/start.sh
deleted file mode 100644
index f4dae18..0000000
--- a/test/util/diff/start.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env bash
-
-TEST_PATH=/home/work/repos/fis/test/util/diff
-cd ${TEST_PATH}
-if [ -f "result"$4"/report.xml" ]
-then
- rm "result"$4"/report.xml"
-fi
-sh product_code.sh $1 $2
-sh new_fis_ready.sh $4
-chmod +x old_fis_scp.sh
-./old_fis_scp.sh $3
-chmod +x old_fis_ready.sh
-./old_fis_ready.sh $3 $4
-rm -rf result$4/*.html
-sleep 2s
-php -f diffall.class.php $4
diff --git a/test/util/md5/test.sh b/test/util/md5/test.sh
deleted file mode 100644
index 66b2f67..0000000
--- a/test/util/md5/test.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-npm install -g lights
-lights install pc-demo
-cd ./pc-demo
-cd ./home
-fis release -m
-cd ../common
-fis release -m
-cd ../..
-root="/home/work/.fis-tmp/www"
-if [ -z "$root" ]; then {
- echo "can't find project!"
- npm uninstall lights
- rm -r pc-demo
- exit;
-}
-fi
-touch exchange.txt
-echo "$root">exchange.txt
-if [ ! -d "./result" ]; then
-mkdir result
-fi
-php tstRight.php
-rm exchange.txt
-if [ -f "${root}/exchange.txt" ]; then {
- rm ${root}/exchange.txt
-}
-fi
-npm uninstall -g lights
-rm -r pc-demo
\ No newline at end of file
diff --git a/test/util/md5/tstRight.php b/test/util/md5/tstRight.php
deleted file mode 100644
index b80b367..0000000
--- a/test/util/md5/tstRight.php
+++ /dev/null
@@ -1,78 +0,0 @@
-load($xmlFile);
- $testsuite = $dom->getElementsByTagName("testsuite")->item(0);
- $totalCount = $testsuite->getAttribute("tests");
- $totalFailure = $testsuite->getAttribute("failures");
-}else{
- $testsuites = $dom->createElement("testsuites");
- $dom->appendChild($testsuites);
- $testsuite = $dom->createElement("testsuite");
- $testsuites->appendChild($testsuite);
-}
-if($flag){
- $totalCount+=1;
- $totalFailure+=1;
- $testsuite->setAttribute("name","md5* ");
- $testsuite->setAttribute("tests",$totalCount);
- $testsuite->setAttribute("time",$totalCount);
- $testsuite->setAttribute("failures",$totalFailure);
- $testsuite->setAttribute("total",$totalCount);
-
- $testcase=$dom->createElement("testcase");
- $testsuite->appendChild($testcase);
- $testcase->setAttribute("name","testcase0");
- $testcase->setAttribute("time","1");
- $testcase->setAttribute("failures","1");
- $testcase->setAttribute("total","1");
-}else{
- $totalCount++;
- $testsuite->setAttribute("name","md5* ");
- $testsuite->setAttribute("tests",$totalCount);
- $testsuite->setAttribute("time",$totalCount);
- $testsuite->setAttribute("failures",$totalFailure);
- $testsuite->setAttribute("total",$totalCount);
-
- $testcase=$dom->createElement("testcase");
- $testsuite->appendChild($testcase);
- $testcase->setAttribute("name","testcase0");
- $testcase->setAttribute("time","1");
- $testcase->setAttribute("failures",0);
- $testcase->setAttribute("total",1);
-}
-$dom->save($xmlFile);
-?>