This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RFA: Delete `weird.exp:p v_comb' test


> Jim Blandy writes:
> 
> 
>> We were testing GDB's ability to make sense of old-ABI C++ objects
>> built by hand-written assembly code, not compiler-generated code.
> 
> 
> Yeah.  We would like gdb to support assembly code, but I don't see a
> need for it to support hand-written V2 C++ stabs symbols.
> 
> I vote for killing the test in both the root and branch.
> 
> BTW I expanded my test runs to include both gcc 2.95.3 and gcc 3.0.2,
> so I am getting coverage of v2 support.  I haven't quite figured out how
> to publish my multi-dimensional gdb.log / gdb.sum results though.

That was the purpose of the test results page.  Perhaphs you could dust 
the scripts off?

I've also an evil awk script (attached).

Andrew

#!/bin/sh

if awk --version < /dev/null 2>&1 | grep -i gnu > /dev/null
then
    AWK=awk
else
    AWK=gawk
fi

$AWK '
function trace (msg) {
    print msg >> "/dev/stderr"
}


# returns a SUPSEP separated list created by sorting TABLE.
function qsort (table, middle, tmp, left, nr_left, right, nr_right, result) {
    middle = ""
    for (middle in table) { break; }
    nr_left = 0;
    nr_right = 0;
    for (tmp in table) {
	if (tmp < middle) {
	    nr_left++
	    left[tmp] = tmp
	} else if (tmp > middle) {
	    nr_right++
	    right[tmp] = tmp
	}
    }
    #print "qsort " nr_left " " middle " " nr_right > "/dev/stderr"
    result = ""
    if (nr_left > 0) {
	result = qsort(left) SUBSEP
    }
    result = result middle
    if (nr_right > 0) {
	result = result SUBSEP qsort(right)
    }
    return result
}


function print_headings (html_p, file, title, target, i) {
    if (html_p) {
	printf "<tr><td></td><th>"					>> file
    }
    printf title							>> file
    if (html_p) {
	printf "</th>"							>> file
    }
    for (i = 1; i <= nr_targets; i++) {
	target = sorted_targets[i]
	if (html_p) {
	    printf "<th>" i "<br>" target "</th>"				>> file
	} else {
	    printf "\t" i						>> file
	}
    }
    if (html_p) {
	printf "</tr>"							>> file
    }
    printf "\n"								>> file
}

function print_test (file, test, nr, i) {
    printf "<tr>"							>> file
    printf "<td>%d</td>", nr						>> file
    printf "<th align=left>%s</th>", test				>> file
    for (i = 1; i <= nr_targets; i++) {
	target = sorted_targets[i];
	result = results[target, test]
	if (result == "FAIL") {
	    printf "<th>%s</th>", result				>> file
	} else {
	    printf "<td align=center>%s</td>", result			>> file
	}
    }
    printf "</tr>\n"							>> file
}

function print_totals (html_p, file, status, target, i, j) {
    for (i = 1; i <= nr_statuses; i++) {
	status = sorted_statuses[i];
	if (html_p) {
	    printf "<tr><td></td><th align=left>"			>> file
	}
	printf status							>> file
	if (html_p) {
	    printf "</th>"						>> file
	}
	for (j = 1; j <= nr_targets; j++) {
	    target = sorted_targets[j];
	    if (html_p) {
		printf "<th>"						>> file
	    } else {
		printf "\t"
	    }
	    printf totals[target, status]				>> file
	    if (html_p) {
		printf "</th>"						>> file
	    }
	}
	if (html_p) {
	    printf "</tr>"						>> file
	}
	printf "\n"							>> file
    }
}

function print_table_start (file, title, full_title, i, target) {
    full_title = "Failure Table: " title;
    trace("Generating " file " (" full_title ")")
    print "<html>"							>> file
    print "<head>"							>> file
    print "<title>" full_title "</title>"				>> file
    print "</head>"							>> file

    print "<body>"							>> file
    print "<h1><center>" full_title "</center></h1>"			>> file
    print "<center>"							>> file
    print "<table>"							>> file
    for (i = 1; i <= nr_targets; i++) {
	target = sorted_targets[i]
	print "<tr>"							>> file
	print "<td>" i "</td>"						>> file
	print "<td>" target "</td>"					>> file
	print "<td>" target_file[target] "</td>"			>> file
	print "</tr>"							>> file
    }
    print "</table>"							>> file
    print "</center>"							>> file
    print "<table>"							>> file
}

function print_table_end (file) {
    print "</table>"							>> file
    print "</body>"							>> file
    print "</html>"							>> file
}

function print_opening (file, title) {
    printf "" > file
    print_table_start(file, title);
    print_headings(1, file, title);
    print_totals(1, file);
}

function print_closing (file, title, nr) {
    trace(title ": " nr);
    print_totals(1, file);
    print_headings(1, file, title);
    print_table_end(file);
}

BEGIN {
    nr_runs = 0
}
/Running target/ {
    nr_runs++
    sub (/Running target/, "");
    gsub (/ /, "");
    gsub (/\//, " ");
    nr = 1;
    do {
	target = $0 " (" nr++ ")";
    } while (target in targets)
    targets[target] = target
    target_file[target] = FILENAME
    trace("Parsing " nr_runs ": " target " " (target_file[target]));
    next
}

# Collect up sizeof???

# Collect up the results
/^PASS:/ || /^FAIL:/ || /^XFAIL:/ || /^XPASS:/ {
    # accumulate statuses
    status = $0
    sub (/:.*$/, "", status)
    statuses[status] = status
    # accumulate tests
    test = $0
    sub (/^[A-Z]*: /, "", test)
    gsub (/ *\([^)]*\)/, "", test)
    tests[test] = test

    # accumulate result counts
    totals[target, status] += 1;
    results[target, test] = status;
    totals[test, status] += 1;
}


END {

    # sort the test names
    trace("Sorting results")
    nr_tests = split (qsort(tests), sorted_tests, SUBSEP);
    trace("Number of tests " nr_tests)
#    for (i = 0; i < nr_tests; i++) {
#	print i " " sorted_tests[i] > "/dev/stderr"
#    }
    nr_targets = split (qsort(targets), sorted_targets, SUBSEP);
    nr_statuses = split (qsort(statuses), sorted_statuses, SUBSEP);

    print_headings(0, "/dev/stderr", "Summary")
    print_totals(0, "/dev/stderr")

    ####

    # heading
    file = "diff.html"
    print_opening(file, "Differences");

    # body - differences
    nr = 0
    for (i = 1; i <= nr_tests; i++) {
	test = sorted_tests[i];
	different = 0;
	fail = 0;
	result = "<uninitialized>";
	for (target in targets) {
	    if (result == "<uninitialized>") {
		result = results[target, test];
	    } else if (result != results[target, test]) {
		different = 1
	    }
	    if (results[target, test] == "FAIL") {
		fail = 1;
	    }
#	    print "TEST=" test, "different=" different, "fail=" fail, "result=" result > "/dev/stderr"
	}
	if (different) {
	    print_test(file, test, ++nr);
	}
    }

    print_closing(file, "Differences", nr);

    ####

    file = "fail.html"
    print_opening(file, "Failures");

    # body - failures
    nr = 0
    for (i = 1; i <= nr_tests; i++) {
	test = sorted_tests[i]
	if (totals[test, "FAIL"] > 0) {
	    print_test(file, test, ++nr);
	}
    }

    print_closing(file, "Failures", nr);

    ####

    file = "pass.html"
    print_opening(file, "Passes");

    # body - passes
    nr = 0
    for (i = 1; i <= nr_tests; i++) {
	test = sorted_tests[i]
	if (totals[test, "PASS"] > 0) {
	    print_test(file, test, ++nr);
	}
    }

    print_closing(file, "Passes", nr);
}
' "$@"

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]