mkdir src
mkdir ext
mkdir obj_ext
copy ../projects/base.gpr .
copy ../projects/extending.gpr .
load extending.gpr
dump

create_spec Pkg src/pkg.ads
create_body Pkg src/pkg.adb
create_separate Pkg Sub src/pkg-sub.adb
refresh
dump

# Overload the separate in the extending project
create_separate Pkg Sub ext/pkg-sub.adb
refresh
dump

# And remove it afterwards: CU should be updated
remove ext/pkg-sub.adb
refresh
dump

# Now remove from the extended project: extending should be updated
# accordingly
remove src/pkg-sub.adb
refresh
dump

# remove body of pkg from extended project: source list of both views
# should be updated accordingly
remove src/pkg.adb
refresh
dump

create_body Pkg ext/pkg.adb
refresh
dump

# test extends all
unload
remove extending.gpr
copy ../projects/base2.gpr .
copy ../projects/extending2.gpr .
mkdir src2
remove ext/pkg.adb
create_body Pkg src/pkg.adb
create_spec Pkg src2/pkg.ads
load extending2.gpr
dump

create_spec Pkg2 src2/pkg2.ads
create_body Pkg2 src2/pkg2.adb
remove src2/pkg.ads
refresh
dump

unload
