<commit_before>#!/usr/bin/env sh

TEST_DIR=$PWD
BUILD=$TEST_DIR/../build/default/geoip.node

if   [ ! -e ../database/GeoIP.dat ] || [ ! -e ../database/GeoIPv6.dat ] || [ ! -e ../database/GeoLiteCity.dat ] || [ ! -e ../database/GeoLiteCityv6.dat ] || [ ! -e ../database/GeoIPOrg-111.dat ] || [ ! -e ../database/GeoIPASNum.dat ] || [ ! -e ../database/GeoIPRegion-515.dat ] || [ ! -e ../database/GeoIP-171_20040418.dat ]; then
  echo "You need downlaod dababases first"
  echo "See database/database.html"
  return 1
fi

if [ ! -e $BUILD ]; then
  echo "Start to building..."
  cd $TEST_DIR/.. || return 1
  node-waf configure build || return 1
  echo "Building is finished!"
fi

cd $TEST_DIR || return 1

echo "Start to test Country ipv4 module......"
echo "============================================================"
node ./country.js 
echo "============================================================"
echo "Country ipv4 module test is finished!"

echo ""

echo "Start to test Country ipv6 module......"
echo "============================================================"
node ./country6.js 
echo "============================================================"
echo "Country ipv6 module test is finished!"

echo ""                                                             

echo "Start to test City moduel......"
echo "============================================================"
node ./city.js
echo "============================================================"
echo "City moduel test is finished!"

echo ""

echo "Start to test Org module......"
echo "============================================================"
node ./org.js
echo "============================================================"
echo "Org module test is finished!"

echo ""

echo "Start to test Region module......"
echo "============================================================"
node ./region.js
echo "============================================================"
echo "Region module test is finished!"

echo ""

echo "Start to test NetSpeed module......"
echo "============================================================"<commit_msg>added city6 testing js script into shell script<commit_after>#!/usr/bin/env sh

TEST_DIR=$PWD
BUILD=$TEST_DIR/../build/default/geoip.node

if   [ ! -e ../database/GeoIP.dat ] || [ ! -e ../database/GeoIPv6.dat ] || [ ! -e ../database/GeoLiteCity.dat ] || [ ! -e ../database/GeoLiteCityv6.dat ] || [ ! -e ../database/GeoIPOrg-111.dat ] || [ ! -e ../database/GeoIPASNum.dat ] || [ ! -e ../database/GeoIPRegion-515.dat ] || [ ! -e ../database/GeoIP-171_20040418.dat ]; then
  echo "You need downlaod dababases first"
  echo "See database/database.html"
  return 1
fi

if [ ! -e $BUILD ]; then
  echo "Start to building..."
  cd $TEST_DIR/.. || return 1
  node-waf configure build || return 1
  echo "Building is finished!"
fi

cd $TEST_DIR || return 1

echo "Start to test Country ipv4 module......"
echo "============================================================"
node ./country.js 
echo "============================================================"
echo "Country ipv4 module test is finished!"

echo ""

echo "Start to test Country ipv6 module......"
echo "============================================================"
node ./country6.js 
echo "============================================================"
echo "Country ipv6 module test is finished!"

echo ""                                                             

echo "Start to test City moduel......"
echo "============================================================"
node ./city.js
echo "============================================================"
echo "City moduel test is finished!"

echo ""

echo "Start to test City ipv6 moduel......"
echo "============================================================"
node ./city6.js
echo "============================================================"
echo "City ipv6 moduel test is finished!"

echo ""             

echo "Start to test Org module......"
echo "============================================================"
node ./org.js
echo "============================================================"
echo "Org module test is finished!"

echo ""

echo "Start to test Region module......"
echo "============================================================"
node ./region.js
echo "============================================================"
echo "Region module test is finished!"

echo ""

echo "Start to test NetSpeed module......"
echo "============================================================"
{'fraction_non_alphanumeric': 0.4335911602209945, 'fraction_numerical': 0.013259668508287293, 'mean_word_length': 4.017738359201774, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3654413', 'n_tokens_mistral': 1208, 'n_tokens_neox': 1088, 'n_words': 338}