Author: bapt Date: Thu Apr 20 11:32:18 2017 New Revision: 317187 URL: https://svnweb.freebsd.org/changeset/base/317187
Log: Add a regression test for diff -D Added: head/usr.bin/diff/tests/ifdef.out (contents, props changed) Modified: head/usr.bin/diff/tests/Makefile head/usr.bin/diff/tests/diff_test.sh Modified: head/usr.bin/diff/tests/Makefile ============================================================================== --- head/usr.bin/diff/tests/Makefile Thu Apr 20 09:05:53 2017 (r317186) +++ head/usr.bin/diff/tests/Makefile Thu Apr 20 11:32:18 2017 (r317187) @@ -21,7 +21,8 @@ ${PACKAGE}FILES+= \ unified_c9999.out \ unified_9999.out \ header.out \ - header_ns.out + header_ns.out \ + ifdef.out NETBSD_ATF_TESTS_SH+= netbsd_diff_test Modified: head/usr.bin/diff/tests/diff_test.sh ============================================================================== --- head/usr.bin/diff/tests/diff_test.sh Thu Apr 20 09:05:53 2017 (r317186) +++ head/usr.bin/diff/tests/diff_test.sh Thu Apr 20 11:32:18 2017 (r317187) @@ -4,6 +4,7 @@ atf_test_case simple atf_test_case unified atf_test_case header atf_test_case header_ns +atf_test_case ifdef simple_body() { @@ -70,10 +71,18 @@ header_ns_body() diff -u empty hello } +ifdef_body() +{ + atf_check -o file:$(atf_get_srcdir)/ifdef.out -s eq:1 \ + diff -D PLOP "$(atf_get_srcdir)/input_c1.in" \ + "$(atf_get_srcdir)/input_c2.in" +} + atf_init_test_cases() { atf_add_test_case simple atf_add_test_case unified atf_add_test_case header atf_add_test_case header_ns + atf_add_test_case ifdef } Added: head/usr.bin/diff/tests/ifdef.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/diff/tests/ifdef.out Thu Apr 20 11:32:18 2017 (r317187) @@ -0,0 +1,26 @@ +/* + * A comment + * +#ifndef PLOP + * And another bla +#else /* PLOP */ + * And another bla +#endif /* PLOP */ + * +#ifndef PLOP + * And yet another +#else /* PLOP */ + * and yet another +#endif /* PLOP */ + */ + +int +main(void) +{ +#ifdef PLOP + +#endif /* PLOP */ + printf("something"); + + return (0); +} _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"