2019-10-20 22:42:26 +02:00
|
|
|
package test
|
|
|
|
|
|
|
|
import (
|
2019-10-22 19:53:26 +02:00
|
|
|
"fmt"
|
2019-10-20 22:42:26 +02:00
|
|
|
"github.com/SRI-CSL/gllvm/shared"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
2019-10-28 15:38:49 +01:00
|
|
|
func Test_basic_functionality(t *testing.T) {
|
2019-10-22 19:53:26 +02:00
|
|
|
args := []string{"../data/helloworld.c", "-o", "../data/hello"}
|
2019-10-20 22:42:26 +02:00
|
|
|
|
|
|
|
exitCode := shared.Compile(args, "clang")
|
|
|
|
|
|
|
|
if exitCode != 0 {
|
|
|
|
t.Errorf("Compile of %v returned %v\n", args, exitCode)
|
|
|
|
} else {
|
|
|
|
fmt.Println("Compiled OK")
|
|
|
|
}
|
2019-10-25 22:22:52 +02:00
|
|
|
|
|
|
|
args = []string{"get-bc", "-v", "../data/hello"}
|
|
|
|
|
|
|
|
exitCode = shared.Extract(args)
|
|
|
|
|
|
|
|
if exitCode != 0 {
|
|
|
|
t.Errorf("Extraction of %v returned %v\n", args, exitCode)
|
|
|
|
} else {
|
|
|
|
fmt.Println("Extraction OK")
|
|
|
|
}
|
2019-10-26 02:37:23 +02:00
|
|
|
|
2019-10-20 22:42:26 +02:00
|
|
|
}
|