aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/external/c-testsuite/runners/single-exec/c2go
blob: e0dd596ca0ae0e4dc4a820f0d90e08e75e51ba82 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#! /bin/sh

set -e
set -u


t=$1

cat $t

set -x

mkdir "$t-c2go"

if ! c2go transpile -o "$t-c2go/main.go" "$t"
then
    exit 1
fi

if ! (cd "$t-c2go" && go build -o "$t.bin")
then
    exit 1
fi

if ! "$t.bin" > "$t.output" 2>&1
then
    exit 1
fi

if ! diff -u "$t.expected" "$t.output"
then
    exit 1
fi