Changeset 4153


Ignore:
Timestamp:
Mar 9, 2022, 6:55:40 AM (7 months ago)
Author:
Peter
Message:

New class OptionVersion?. closes #824.

Location:
trunk
Files:
3 added
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/test/Makefile.am

    r4152 r4153  
    141141
    142142EXTRA_PROGRAMS = $(CXX_TESTS)
    143 EXTRA_PROGRAMS += test/help.test
     143EXTRA_PROGRAMS += test/stdopt
    144144
    145145CLEANFILES += $(EXTRA_PROGRAMS)
     
    152152test/doxygen_test.sh \
    153153test/help_test.sh \
     154test/version_option_test.sh \
    154155test/yat_config_test.sh \
    155156test/yat_config_cblas_test.sh \
     
    200201test/bam_read_filter.log: test/data/foo.sorted.bam
    201202test/bam_region_iterator.log: test/data/foo.sorted.bam
    202 test/cmd_test.log: test/help.test $(shell_test_deps)
    203 test/help_test.log: test/help.test $(shell_test_deps)
     203test/cmd_test.log: test/stdopt $(shell_test_deps)
     204test/help_test.log: test/stdopt $(shell_test_deps)
    204205test/kendall.log: $(top_srcdir)/test/data/kendall.txt
    205206test/pileup.log: test/data/foo.sorted.bam
     
    208209test/vcf_file.log: $(srcdir)/test/data/foo.vcf
    209210test/vcf_file2.log: test/data/foo.vcf.gz
     211
     212test/version_option_test.log: test/stdopt $(shell_test_deps)
    210213
    211214test/yat_config_test.log: build_support/yat-config \
  • trunk/test/cmd_test.sh

    r3114 r4153  
    2626. test/init.sh || exit 99
    2727
    28 run ../../help.test 1 --no-foo
     28run ../../stdopt 1 --no-foo
    2929grep foo stderr || exit_fail
    3030test -e stdout || exit_fail
  • trunk/test/help_test.sh

    r3114 r4153  
    2626. test/init.sh || exit 99
    2727
    28 run ../../help.test 0 --nonsense --help
     28prog=../../stdopt
     29run $prog 0 --nonsense --help
    2930test -s stderr && exit_fail
    3031grep 'Usage:' stdout || exit_fail
    3132
    32 run ../../help.test 0 -nonsense --help
     33run $prog 0 -nonsense --help
    3334test -s stderr && exit_fail
    3435grep 'Usage:' stdout || exit_fail
    3536
    36 run ../../help.test 0 nonsense --help
     37run $prog 0 nonsense --help
    3738test -s stderr && exit_fail
    3839grep 'Usage:' stdout || exit_fail
    3940
    40 run ../../help.test 1 --help-me
     41run $prog 1 --help-me
    4142test -s stderr || exit_fail
    42 grep 'help.test:.*help-me' stderr || exit_fail
     43grep 'stdopt:.*help-me' stderr || exit_fail
    4344
    4445exit_success
  • trunk/test/stdopt.cc

    r4152 r4153  
    2525#include "yat/utility/Exception.h"
    2626#include "yat/utility/OptionHelp.h"
     27#include "yat/utility/OptionVersion.h"
    2728
    2829#include <cstdlib>
     
    3334
    3435int main(int argc, char* argv[])
    35 { 
     36{
    3637  CommandLine cmd;
    3738  OptionHelp help(cmd);
     39  // VERSION and PACKAGE #defined in config.h
     40  OptionVersion version(cmd, "stdopt", VERSION, "2022",
     41                        {"John Doe", "Jane Doe"}, PACKAGE);
    3842  try {
    3943    cmd.parse(argc, argv);
  • trunk/yat/utility/Makefile.am

    r4129 r4153  
    4848  yat/utility/OptionHelp.cc \
    4949  yat/utility/OptionSwitch.cc \
     50  yat/utility/OptionVersion.cc \
    5051  yat/utility/PCA.cc \
    5152  yat/utility/split.cc \
     
    116117  $(srcdir)/yat/utility/OptionHelp.h \
    117118  $(srcdir)/yat/utility/OptionSwitch.h \
     119  $(srcdir)/yat/utility/OptionVersion.h \
    118120  $(srcdir)/yat/utility/OstreamIterator.h \
    119121  $(srcdir)/yat/utility/PCA.h \
Note: See TracChangeset for help on using the changeset viewer.