pm2/test/bash/binary.sh
Jean-Nicolas LAGNEAU 7d3bd3fabe pm2 --interpreter is not needed anymore
pm2 now recognize the extension of the file but you can still use
interpreter flag for specific extensions.
2014-11-12 18:49:07 +01:00

41 lines
892 B
Bash

#!/usr/bin/env bash
SRC=$(cd $(dirname "$0"); pwd)
source "${SRC}/include.sh"
echo -e "\033[1mRunning tests:\033[0m"
cd $file_path
#
# Testing pm2 execution of binary files
#
$pm2 start `which watch` -- ls
OUT=`$pm2 prettylist | grep exec_interpreter | sed "s/[\'|,|:]//g" | awk -F' ' '{print $2}'`
[ $OUT = "none" ] || fail "$1"
success "$1"
$pm2 kill
$pm2 start binary-js-file
OUT=`$pm2 prettylist | grep exec_interpreter | sed "s/[\'|,|:]//g" | awk -F' ' '{print $2}'`
[ $OUT = "node" ] || fail "$1"
success "$1"
$pm2 kill
$pm2 start binary-js-file.js
OUT=`$pm2 prettylist | grep exec_interpreter | sed "s/[\'|,|:]//g" | awk -F' ' '{print $2}'`
[ $OUT = "node" ] || fail "$1"
success "$1"
$pm2 kill
$pm2 start binary-py-file.py
OUT=`$pm2 prettylist | grep exec_interpreter | sed "s/[\'|,|:]//g" | awk -F' ' '{print $2}'`
[ $OUT = "python" ] || fail "$1"
success "$1"
$pm2 kill