<commit_before>#!/bin/sh

mkdir -p tests/tmp

# Parameters
for s in NEWBOX_PAD; do
	n=`grep "$s[[:space:]]*=" src/ccbi/space/space.d | sed -E 's/.*([0-9]+)[,;]/\1/'`
	if [ -z "$n" ]; then
		echo >&2 "$s not found in src/ccbi/space/space.d!"
		exit 1
	fi
	echo "$n" > tests/tmp/$s
done

# Supported geometries
for g in 1 2 3; do
	if ! `bin/ccbi -$g 2>&1 >/dev/null | grep -q 'unexpected argument'`; then
		touch tests/tmp/$g
	fi
done

# Supported fingerprints
for f in `bin/ccbi -v 2>&1 >/dev/null | awk '/Fingerprints/{x=1}x{print}' | sed 's/[,.:]/\n/g' | grep -v '^$' | sed '1d;s/^ *//' | tr A-Z a-z`; do
	touch tests/tmp/$f
done

prove -e tests/runner.pl -r tests $*

rm -r tests/tmp<commit_msg>Tests: fix multidigit parameter getting runtests.<commit_after>#!/bin/sh

mkdir -p tests/tmp

# Parameters
for s in NEWBOX_PAD; do
	n=`grep "$s[[:space:]]*=" src/ccbi/space/space.d | sed -E 's/[^0-9]*([0-9]+)[,;]/\1/'`
	if [ -z "$n" ]; then
		echo >&2 "$s not found in src/ccbi/space/space.d!"
		exit 1
	fi
	echo "$n" > tests/tmp/$s
done

# Supported geometries
for g in 1 2 3; do
	if ! `bin/ccbi -$g 2>&1 >/dev/null | grep -q 'unexpected argument'`; then
		touch tests/tmp/$g
	fi
done

# Supported fingerprints
for f in `bin/ccbi -v 2>&1 >/dev/null | awk '/Fingerprints/{x=1}x{print}' | sed 's/[,.:]/\n/g' | grep -v '^$' | sed '1d;s/^ *//' | tr A-Z a-z`; do
	touch tests/tmp/$f
done

prove -e tests/runner.pl -r tests $*

rm -r tests/tmp
{'fraction_non_alphanumeric': 0.22090592334494774, 'fraction_numerical': 0.020905923344947737, 'mean_word_length': 2.955922865013774, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5468171', 'n_tokens_mistral': 680, 'n_tokens_neox': 638, 'n_words': 182}