Add (currently failing) test cases for profiled programs.
This commit is contained in:
parent
5783872703
commit
4fcb013cbf
|
@ -1,4 +1,4 @@
|
||||||
# $NetBSD: t_hello.sh,v 1.1 2017/05/14 00:07:07 kamil Exp $
|
# $NetBSD: t_hello.sh,v 1.2 2017/05/18 10:29:47 martin Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011 The NetBSD Foundation, Inc.
|
# Copyright (c) 2011 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
|
@ -31,6 +31,12 @@ hello_head() {
|
||||||
atf_set "require.progs" "c++"
|
atf_set "require.progs" "c++"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
atf_test_case hello_profile
|
||||||
|
hello_head() {
|
||||||
|
atf_set "descr" "compile and run \"hello world\" with profiling option"
|
||||||
|
atf_set "require.progs" "c++"
|
||||||
|
}
|
||||||
|
|
||||||
atf_test_case hello_pic
|
atf_test_case hello_pic
|
||||||
hello_pic_head() {
|
hello_pic_head() {
|
||||||
atf_set "descr" "compile and run PIC \"hello world\""
|
atf_set "descr" "compile and run PIC \"hello world\""
|
||||||
|
@ -59,6 +65,16 @@ EOF
|
||||||
atf_check -s exit:0 -o inline:"hello world\n" ./hello
|
atf_check -s exit:0 -o inline:"hello world\n" ./hello
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hello_profile_body() {
|
||||||
|
cat > test.cpp << EOF
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
int main(void) {printf("hello world\n");exit(0);}
|
||||||
|
EOF
|
||||||
|
atf_check -s exit:0 -o ignore -e ignore c++ -pg -o hello test.cpp
|
||||||
|
atf_check -s exit:0 -o inline:"hello world\n" ./hello
|
||||||
|
}
|
||||||
|
|
||||||
hello_pic_body() {
|
hello_pic_body() {
|
||||||
cat > test.cpp << EOF
|
cat > test.cpp << EOF
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -139,6 +155,7 @@ atf_init_test_cases()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_add_test_case hello
|
atf_add_test_case hello
|
||||||
|
atf_add_test_case hello_profile
|
||||||
atf_add_test_case hello_pic
|
atf_add_test_case hello_pic
|
||||||
atf_add_test_case hello_pie
|
atf_add_test_case hello_pie
|
||||||
atf_add_test_case hello32
|
atf_add_test_case hello32
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $NetBSD: t_hello.sh,v 1.4 2017/05/13 23:51:39 kamil Exp $
|
# $NetBSD: t_hello.sh,v 1.5 2017/05/18 10:29:47 martin Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011 The NetBSD Foundation, Inc.
|
# Copyright (c) 2011 The NetBSD Foundation, Inc.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
|
@ -31,6 +31,12 @@ hello_head() {
|
||||||
atf_set "require.progs" "cc"
|
atf_set "require.progs" "cc"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
atf_test_case hello_profile
|
||||||
|
hello_head() {
|
||||||
|
atf_set "descr" "compile and run \"hello world\" with profiling option"
|
||||||
|
atf_set "require.progs" "cc"
|
||||||
|
}
|
||||||
|
|
||||||
atf_test_case hello_pic
|
atf_test_case hello_pic
|
||||||
hello_pic_head() {
|
hello_pic_head() {
|
||||||
atf_set "descr" "compile and run PIC \"hello world\""
|
atf_set "descr" "compile and run PIC \"hello world\""
|
||||||
|
@ -59,6 +65,16 @@ EOF
|
||||||
atf_check -s exit:0 -o inline:"hello world\n" ./hello
|
atf_check -s exit:0 -o inline:"hello world\n" ./hello
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hello_profile_body() {
|
||||||
|
cat > test.c << EOF
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
int main(void) {printf("hello world\n");exit(0);}
|
||||||
|
EOF
|
||||||
|
atf_check -s exit:0 -o ignore -e ignore cc -o hello -pg test.c
|
||||||
|
atf_check -s exit:0 -o inline:"hello world\n" ./hello
|
||||||
|
}
|
||||||
|
|
||||||
hello_pic_body() {
|
hello_pic_body() {
|
||||||
cat > test.c << EOF
|
cat > test.c << EOF
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -139,6 +155,7 @@ atf_init_test_cases()
|
||||||
{
|
{
|
||||||
|
|
||||||
atf_add_test_case hello
|
atf_add_test_case hello
|
||||||
|
atf_add_test_case hello_profile
|
||||||
atf_add_test_case hello_pic
|
atf_add_test_case hello_pic
|
||||||
atf_add_test_case hello_pie
|
atf_add_test_case hello_pie
|
||||||
atf_add_test_case hello32
|
atf_add_test_case hello32
|
||||||
|
|
Loading…
Reference in New Issue