srtest is a little program that tests ScriptRun. You can use it as an example of how to use ScriptRun. Here's what the output should look like:
Script 'DEVANAGARI' from 0 to 9.
Script 'ARABIC' from 9 to 17.
Script 'CYRILLIC' from 17 to 25.
Script 'LATIN' from 25 to 33.
Script 'HAN' from 33 to 35.
Script 'HIRAGANA' from 35 to 41.
Script 'KATAKANA' from 41 to 45.
Script 'DESERET' from 45 to 53.
On UNIX systems the simplest thing to do is to just copy scrptrun.h and scrptrun.cpp into your source directory. If you want to use them from <icu>/source/extra/scrpturn, it's a bit trickier: the default dependency rules don't work on source files in a different directory. You need to add separate dependency rules for scrptrun.o and scrptrun.d. See <icu>/source/samples/layout/Makefile.in for an example of how to do this. You'll also have to add -I$(top_srcdir)/extra/scrptrun to your compiler flags so that the compiler can find scrptrun.h. If your application has to build on multiple UNIX platforms, it might be difficult to wirte dependency rules that will work correctly on all platforms. In that case, you're probably better off copying the scrpturn files to your source directory.
Building srtest is easy, on Windows build the srtest workspace in <icu>\source\extra\scrptrun. On UNIX, connect to <top-build-dir>/extra/scrptrun and do "make all"