# # # rename "contrib/mtnopt" # to "util/mtnopt" # # add_dir "tests/util_mtnopt" # # add_dir "util" # # add_file "tests/util_mtnopt/__driver__.lua" # content [8c03f2046edc1ede9beb0e3befafb417968a12b1] # # patch "Makefile.am" # from [4bd4212a2e021abffa9f0151375e47988fd0c7ce] # to [f38db1b6891b304f75527eb30853aa570ff15b4d] # ============================================================ --- tests/util_mtnopt/__driver__.lua 8c03f2046edc1ede9beb0e3befafb417968a12b1 +++ tests/util_mtnopt/__driver__.lua 8c03f2046edc1ede9beb0e3befafb417968a12b1 @@ -0,0 +1,14 @@ +mtn_setup() + +mtnopt=getpathof("mtnopt") + +-- check default operation +check({mtnopt}, 0, true) +check(qgrep('^MTN_database="'..test.root..'/test.db";$', "stdout")) +check(qgrep('^MTN_branch="testbranch";$', "stdout")) + +-- check operation with a specific key and just returning the value +check({mtnopt,'-v','-kbranch'}, 0, true) +check(not qgrep('^'..test.root..'/test.db$', "stdout")) +check(qgrep('^testbranch$', "stdout")) + ============================================================ --- Makefile.am 4bd4212a2e021abffa9f0151375e47988fd0c7ce +++ Makefile.am f38db1b6891b304f75527eb30853aa570ff15b4d @@ -344,6 +344,8 @@ EXTRA_PROGRAMS = noinst_PROGRAMS = txt2c EXTRA_PROGRAMS = +bin_SCRIPTS = mtnopt + mtn_SOURCES = $(MOST_SOURCES) monotone.cc nodist_mtn_SOURCES = std_hooks.c schema.c @@ -720,6 +722,10 @@ txt2c: txt2c.cc cmp -s address@hidden $@ || mv -f address@hidden $@ rm -f address@hidden +# Support for scripts +%: util/% + cp $< $@ + # This construct causes --strip-trailing to be applied only when # generating package_revision.c. TXT2CFLAGS =