<commit_before>#! /bin/bash

# Exit on error
set -e

# Clean up initial files
function clean() {
    rm -f test-main main.o cbd cbd.test
}

clean

# Run tests
go test

# Build everything
go install
go build cmds/cbdcc.go
go build cmds/cbd.go
mv cbdcc cbd $GOPATH/bin

# The compile the program
export CBD_POTENTIAL_HOST=''

cbdcc gcc -c data/main.c -o main.o
cbdcc gcc main.o -o test-main

# Maybe we should test the output somehow
./test-main

# Clean up
clean

# Now lets do it again over the network
cbd &
d_pid=$!
trap "kill -9 ${d_pid}" EXIT

export CBD_POTENTIAL_HOST="localhost"

cbdcc gcc -c data/main.c -o main.o
cbdcc gcc main.o -o test-main
./test-main

clean<commit_msg>Update the test script to explicitly check the output of the test program<commit_after>#! /bin/bash

# Exit on error
set -e

# Clean up initial files
function clean() {
    rm -f test-main main.o cbd cbd.test
}

function checkout() {
    testout=$(./test-main)

    if [ "$testout" != "Hello, world!" ]; then
        echo "Output Invalid got value '$testout'"
        exit 1
    fi
}

clean

# Run tests
go test

# Build everything
go install
go build cmds/cbdcc.go
go build cmds/cbd.go
mv cbdcc cbd $GOPATH/bin

# The compile the program
export CBD_POTENTIAL_HOST=''

cbdcc gcc -c data/main.c -o main.o
cbdcc gcc main.o -o test-main
checkout # Test the output


# Clean up
clean

# Now lets do it again over the network
cbd &
d_pid=$!
trap "kill -9 ${d_pid}" EXIT

export CBD_POTENTIAL_HOST="localhost"

cbdcc gcc -c data/main.c -o main.o
cbdcc gcc main.o -o test-main
checkout # Test the output

clean

# Now lets do again over with a server
{'fraction_non_alphanumeric': 0.09846153846153846, 'fraction_numerical': 0.0018461538461538461, 'mean_word_length': 3.1907216494845363, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1899042', 'n_tokens_mistral': 619, 'n_tokens_neox': 602, 'n_words': 227}