added tests for wrapped_fork

This commit is contained in:
Joni Shkurti 2015-05-19 17:22:33 +02:00
parent 6c22eabe61
commit d5add60bfd
3 changed files with 37 additions and 0 deletions

26
test/bash/wrapped_fork.sh Normal file
View File

@ -0,0 +1,26 @@
#!/usr/bin/env bash
SRC=$(cd $(dirname "$0"); pwd)
source "${SRC}/include.sh"
cd $file_path
echo "################## Wrapped fork ###################"
$pm2 kill
echo "Testing wrapped fork mode values"
node path-check.js > path-check1.txt
$pm2 start path-check.js -o path-check2.txt
sleep 1
OUT=`diff path-check1.txt path-check2.txt`
rm path-check1.txt
rm path-check2.txt
[ -z "$OUT" ] || fail "The outputs are not identical"
success "The outputs are identical"
$pm2 kill

9
test/fixtures/path-check.js vendored Normal file
View File

@ -0,0 +1,9 @@
console.log(__filename);
console.log(module.filename);
console.log(module.parent);
console.log(module.children);
console.log(__dirname);
console.log(module);
console.log(process.env.PWD);
console.log(require.main.filename);
console.log(require.main === module);

View File

@ -69,6 +69,8 @@ bash ./test/bash/module.sh
spec "module system"
bash ./test/bash/vizion.sh
spec "vizion features (versioning control)"
bash ./test/bash/wrapped_fork.sh
spec "wrapped fork"
bash ./test/bash/pmx_injection.sh
spec "automatic pmx injection"