<commit_before>#!/bin/sh

#
# file: travis-ci.sh
#
# author: Copyright (C) 2016 <NAME> http://www.distortec.com http://www.freddiechopin.info
#
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
# distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

set -e
set -u

if [ ${#} -ne 1 ]; then
	echo 'This script requires 1 argument!' >&2
	exit 1
fi

# "install" phase
install() {
	mkdir -p "${HOME}/toolchains"
	cd "${HOME}/toolchains"

	echo "Downloading gcc-arm-none-eabi-5_3-160412-linux-x64.tar.xz..."
	wget http://www.freddiechopin.info/en/download/category/11-bleeding-edge-toolchain?download=143%3Ableeding-edge-toolchain-160412-64-bit-linux -O gcc-arm-none-eabi-5_3-160412-linux-x64.tar.xz
	echo "Extracting gcc-arm-none-eabi-5_3-160412-linux-x64.tar.xz..."
	tar -xf gcc-arm-none-eabi-5_3-160412-linux-x64.tar.xz
	cat > gcc-arm-none-eabi-5_3-160412.sh <<- EOF
	export PATH="$(pwd)/gcc-arm-none-eabi-5_3-160412/bin:\${PATH-}"
	EOF

	echo "Downloading gcc-arm-none-eabi-4_9-150928-linux-x64.tar.xz..."
	wget http://www.freddiechopin.info/en/download/category/11-bleeding-edge-toolchain?download=122%3Ableeding-edge-toolchain-150928-64-bit-linux -O gcc-arm-none-eabi-4_9-150928-linux-x64.tar.xz
	echo "Extracting gcc-arm-none-eabi-4_9-150928-linux-x64.tar.xz..."
	tar -xf gcc-arm-none-eabi-4_9-150928-linux-x64.tar.xz
	mkdir gcc-arm-none-eabi-4_9-150928/bin/lib
	gcc -shared -o gcc-arm-none-eabi-4_9-150928/bin/lib/libfl.so.2 -lfl
	cat > gcc-arm-none-eabi-4_9-150928.sh <<- EOF
	export LD_LIBRARY_PATH="$(pwd)/gcc-arm-none-eabi-4_9-150928/bin/lib"
	export PATH="$(pwd)/gcc-arm-none-eabi-4_9-150928/bin:\${PATH-}"
	EOF
}

# "script" phase
script() {
	(
	echo "Testing with gcc-arm-none-eabi-5_3-160412..."
	. "${HOME}/toolchains/gcc-arm-none-eabi-5_3-160412.sh"
	./scripts/buildAllConfigurations.sh
	)

	(
	echo "Testing with gcc-arm-none-eabi-4_9-150928..."
	. "${HOME}/toolchains/gcc-arm-none-eabi-4_9-150928.sh"
	./scripts/buildAllConfigurations.sh
	)
}<commit_msg>Automatically find all scripts with toolchain parameters<commit_after>#!/bin/sh

#
# file: travis-ci.sh
#
# author: Copyright (C) 2016 <NAME>giel http://www.distortec.com http://www.freddiechopin.info
#
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
# distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

set -e
set -u

if [ ${#} -ne 1 ]; then
	echo 'This script requires 1 argument!' >&2
	exit 1
fi

# "install" phase
install() {
	mkdir -p "${HOME}/toolchains"
	cd "${HOME}/toolchains"

	echo "Downloading gcc-arm-none-eabi-5_3-160412-linux-x64.tar.xz..."
	wget http://www.freddiechopin.info/en/download/category/11-bleeding-edge-toolchain?download=143%3Ableeding-edge-toolchain-160412-64-bit-linux -O gcc-arm-none-eabi-5_3-160412-linux-x64.tar.xz
	echo "Extracting gcc-arm-none-eabi-5_3-160412-linux-x64.tar.xz..."
	tar -xf gcc-arm-none-eabi-5_3-160412-linux-x64.tar.xz
	cat > gcc-arm-none-eabi-5_3-160412.sh <<- EOF
	export PATH="$(pwd)/gcc-arm-none-eabi-5_3-160412/bin:\${PATH-}"
	EOF

	echo "Downloading gcc-arm-none-eabi-4_9-150928-linux-x64.tar.xz..."
	wget http://www.freddiechopin.info/en/download/category/11-bleeding-edge-toolchain?download=122%3Ableeding-edge-toolchain-150928-64-bit-linux -O gcc-arm-none-eabi-4_9-150928-linux-x64.tar.xz
	echo "Extracting gcc-arm-none-eabi-4_9-150928-linux-x64.tar.xz..."
	tar -xf gcc-arm-none-eabi-4_9-150928-linux-x64.tar.xz
	mkdir gcc-arm-none-eabi-4_9-150928/bin/lib
	gcc -shared -o gcc-arm-none-eabi-4_9-150928/bin/lib/libfl.so.2 -lfl
	cat > gcc-arm-none-eabi-4_9-150928.sh <<- EOF
	export LD_LIBRARY_PATH="$(pwd)/gcc-arm-none-eabi-4_9-150928/bin/lib"
	export PATH="$(pwd)/gcc-arm-none-eabi-4_9-150928/bin:\${PATH-}"
	EOF
}

# "script" phase
script() {
	toolchains="$(find "${HOME}/toolchains/" -mindepth 1 -maxdepth 1 -name '*.sh' | sort)"
	for toolchain in ${toolchains}; do
		(
		echo "Using ${toolchain}..."
		. "${toolchain}"
		./scripts/buildAllConfigurations.sh
		)
	done
}
{'fraction_non_alphanumeric': 0.18157380254154448, 'fraction_numerical': 0.09481915933528837, 'mean_word_length': 3.6144306651634723, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1508500', 'n_tokens_mistral': 2030, 'n_tokens_neox': 1761, 'n_words': 278}