diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-05-11 21:48:28 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-05-14 18:08:06 +0300 |
commit | cbd7cabcc3e6b24e80521bfec230e905f420ff4f (patch) | |
tree | f30aa2cd077fcb6a1939a7fdb79a80346d44d350 /tests/sync.test | |
parent | 61cdde35094fc655eac2e6968b465f217e91d0ac (diff) |
Add some tests
Diffstat (limited to 'tests/sync.test')
-rw-r--r-- | tests/sync.test | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/tests/sync.test b/tests/sync.test new file mode 100644 index 0000000..1e044b2 --- /dev/null +++ b/tests/sync.test @@ -0,0 +1,66 @@ +# file : tests/sync.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include common.test project.test + +new += 2>! +init += cc "config.cxx=$config.cxx" -d prj 2>! +status += --all --recursive + +: dependency +: +{ + $clone_prj; + $init -C prj-cfg @cfg &prj/build/bootstrap/*** &prj-cfg/***; + + $new -t lib --vcs none libhello &libhello/***; + + cat <<EOI >+prj/repositories.manifest; + : + role: prerequisite + location: ../libhello + type: dir + EOI + + cat <<EOI >+prj/manifest; + depends: libhello + EOI + + sed -i -e 's/^(#import .+)$/import libs += libhello%lib{hello}/' \ + prj/prj/buildfile; + + cat <<EOI >=prj/prj/prj.cxx; + #include <iostream> + + #include <libhello/hello.hxx> + + using namespace std; + + int main (int argc, char* argv[]) + { + if (argc < 2) + { + cerr << "error: missing name" << endl; + return 1; + } + + hello::say_hello (cout, argv[1]); + } + EOI + + $* 2>>/~"%EOE%"; + fetching dir:$~/libhello \(prerequisite of dir:$~/prj\) + synchronizing: + % new libhello.0\.1\.0-a\.0\..+ \\\(required by prj\\\)% + % upgrade prj.0\.1\.0-a\.0\.19700101000000#1% + EOE + + $status -d prj >>~%EOO%; + prj configured 0.1.0-a.0.19700101000000#1 + % libhello configured 0\.1\.0-a\.0\..+% + EOO + + $build prj/ 2>! &prj/prj/prj$exe &?prj/prj/prj.exe.dlls/***; + prj/prj/prj 'testscript' >'Hello, testscript!' +} |