AT_SETUP([Add source])
AS_MKDIR_P([empty])
AT_DATA([empty/configure.ac],
[[AC_CONFIG_FILES(Makefile)
]])
AT_DATA([empty/Makefile.am],
[[
bin_PROGRAMS = target1
]])



AT_DATA([expect],
[[ROOT (): empty1
    TARGET (): target1
      PROPERTY (Installation directory): bindir
      SOURCE (): source1
    SOURCE (): configure.ac
    SOURCE (): Makefile.am
]])
AT_DATA([reference],
[[
bin_PROGRAMS = target1

target1_SOURCES = \
	source1
]])
AT_PARSER_CHECK([load empty \
		 move empty1 \
		 add source 0:2 source1 \
		 list \
		 save])
AT_CHECK([diff -b empty1/Makefile.am reference])
AT_PARSER_CHECK([load empty1 \
		 list])
AT_CHECK([diff -b output expect])



AT_DATA([expect],
[[ROOT (): empty2
    TARGET (): target1
      PROPERTY (Installation directory): bindir
      SOURCE (): source1
      SOURCE (): source2
    SOURCE (): configure.ac
    SOURCE (): Makefile.am
]])
AT_DATA([reference],
[[
bin_PROGRAMS = target1

target1_SOURCES = \
	source1 \
	source2
]])
AT_PARSER_CHECK([load empty1 \
		 move empty2 \
		 add source 0:2 source2 after 0:2:0\
		 list \
		 save])
AT_CHECK([diff -b empty2/Makefile.am reference])
AT_PARSER_CHECK([load empty2 \
		 list])
AT_CHECK([diff -b output expect])



AT_DATA([expect],
[[ROOT (): empty3
    TARGET (): target1
      PROPERTY (Installation directory): bindir
      SOURCE (): source2
    SOURCE (): configure.ac
    SOURCE (): Makefile.am
]])
AT_DATA([reference],
[[
bin_PROGRAMS = target1

target1_SOURCES = \
	source2
]])
AT_PARSER_CHECK([load empty2 \
		 move empty3 \
		remove 0:2:0 \
		 list \
		 save])
AT_CHECK([diff -b empty3/Makefile.am reference])
AT_PARSER_CHECK([load empty3 \
		 list])
AT_CHECK([diff -b output expect])




AT_DATA([expect],
[[ROOT (): empty4
    TARGET (): target1
      PROPERTY (Installation directory): bindir
    SOURCE (): configure.ac
    SOURCE (): Makefile.am
]])
AT_DATA([reference],
[[
bin_PROGRAMS = target1
]])
AT_PARSER_CHECK([load empty3 \
		 move empty4 \
		remove 0:2:0 \
		 list \
		 save])
AT_CHECK([diff -b empty4/Makefile.am reference])
AT_PARSER_CHECK([load empty4 \
		 list])
AT_CHECK([diff -b output expect])



AT_DATA([expect],
[[ROOT (): empty5
    TARGET (): target1
      PROPERTY (Installation directory): bindir
      SOURCE (): source1
    SOURCE (): configure.ac
    SOURCE (): Makefile.am
]])
AT_DATA([reference],
[[
bin_PROGRAMS = target1

target1_SOURCES = \
	source1
]])
AT_PARSER_CHECK([load empty4 \
		 move empty5 \
		 add source 0:2 source1 \
		 list \
		 save])
AT_CHECK([diff -b empty5/Makefile.am reference])
AT_PARSER_CHECK([load empty5 \
		 list])
AT_CHECK([diff -b output expect])



AS_MKDIR_P([empty6])
AT_DATA([empty6/configure.ac],
[[AC_CONFIG_FILES(Makefile)
]])
AT_DATA([empty6/Makefile.am],
[[
bin_PROGRAMS = target1

target1_SOURCES =
]])
AT_DATA([expect],
[[ROOT (): empty6
    TARGET (): target1
      PROPERTY (Installation directory): bindir
      SOURCE (): source1
    SOURCE (): configure.ac
    SOURCE (): Makefile.am
]])
AT_DATA([reference],
[[
bin_PROGRAMS = target1

target1_SOURCES =source1
]])
AT_PARSER_CHECK([load empty6 \
		 add source 0:2 source1 \
		 list \
		 save])
AT_CHECK([diff -b empty6/Makefile.am reference])
AT_PARSER_CHECK([load empty6 \
		 list])
AT_CHECK([diff -b output expect])



AS_MKDIR_P([empty7])
AT_DATA([empty7/configure.ac],
[[AC_CONFIG_FILES(Makefile)
]])
AT_DATA([empty7/Makefile.am],
[[
bin_PROGRAMS = target1

target1_SOURCES = source1.c source2.c
]])
AT_DATA([reference],
[[
bin_PROGRAMS = target1

target1_SOURCES = source2.c
]])
AT_PARSER_CHECK([load empty7 \
		 remove 0:2:0 \
		 remove 0:2:0 \
		 list \
		 save])
AT_CHECK([diff -b empty7/Makefile.am reference])



AS_MKDIR_P([empty8])
AT_DATA([empty8/configure.ac],
[[AC_CONFIG_FILES(Makefile)
]])
AT_DATA([empty8/Makefile.am],
[[
bin_PROGRAMS = target1

target1_SOURCES = source1.c
]])
AT_DATA([reference],
[[
bin_PROGRAMS = target1

target1_SOURCES =
]])
AT_PARSER_CHECK([load empty8 \
		 remove 0:2:0 \
		 remove 0:2:0 \
		 list \
		 save])



AT_CLEANUP
