From 80b3e871cdb0465613f8b5b612ec151734c660ae Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 29 Nov 2024 17:10:05 -0500 Subject: [PATCH] test/main.cfg : Initial commit. (Moved here from main.cfg). --- src/cwtest/cfg/test/main.cfg | 84 ++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 src/cwtest/cfg/test/main.cfg diff --git a/src/cwtest/cfg/test/main.cfg b/src/cwtest/cfg/test/main.cfg new file mode 100644 index 0000000..b43ad1b --- /dev/null +++ b/src/cwtest/cfg/test/main.cfg @@ -0,0 +1,84 @@ +{ + test: { + test: { + base_dir: "~/src/cwtest/src/cwtest/cfg/test", + + resource_dir:"rsrc", + output_dir:"cur", + ref_dir:"ref", + + + // Notes: + // 0. Add a new test: + // - Create a function like this: rc_t my_test_func(const test_args_t& args); + // - Add the module name, function pair to the `_test_map[]` in cwTest.cpp. + // - Add an entry to the test parameters cfg. below. + // + Name the test case (e.g. `test_0`) and give the test parameters. + // + On the call to my_test_func() the args.module_args is set to the 'module_args' dictionary defined in the cfg. + // + Likewise args.test_args is set to the 'test_args' dictionary referenced by the test name label 'e.g. test_0:{ my_arg:1 }'. + // + // - Run the test like this: `cwtest test/main.cfg test /my_module test_0 echo` to see the results of the test run. + // The results of this run will be written into /cur/my_test/test_0/log.txt + // + // - Once the results have been validated copy the output from 'cur' to the `/ref/my_test/test_0/log.txt.` + // + // - Verify that the test passes: `cwtest test/main.cfg test /my_module test_0 compare` + // + // 1. The test spec. is recursive. Modules can be listed + // inside of modules. (e.g. 'lex' and 'flow'). + // + // 2. If a module spec. does not have an embedded + // 'module' or 'module_args' then the cases may + // be listed without a 'cases' label. + // (e.g. 'filesys','object', 'vop') + // + // 3. Command line args: + // | 'all' (required) The module path always begins with a '/'. + // | 'all' (required) + // 'gen_report' Print modulue/test label. + // 'compare' Run compare pass. + // 'echo' Print the generated test output to the console. + // 'args' All command line args after 'args' are passed to the tests. + // + // 4. Example command lines: + // r ~/src/cwtest/src/cwtest/cfg/test/main.cfg test /lex test_0 compare + // r ~/src/cwtest/src/cwtest/cfg/test/main.cfg test /flow test_0 compare + test: { + module_args: {} + + modules: { + lex:{ module_args:{}, cases: { test_0:{} } }, + filesys:{ test_0:{}}, + object:{ basic:{}, to_json:{} }, + vop:{ test_0:{} }, + time:{ test_0:{} }, + textBuf: { test_0:{} }, + audioBuf:{ test_0:{} } + mtx:{ test_0: { + m0: [ [0,3], [1,4], [2,5] ], + m1: [ [0,1,2],[3,4,5] ], + + m2: [ [[0,1],[2,3]], [[4,5],[6,7]], [[8,9],[10,11]] ], + m3: [ 0,1,2 ], + + m4: [ [10,13], [11,14], [12,15] ], + + y0: [ [5,14],[14,50] ], + y1: [ [9,12,15],[12,17,22],[15,22,29] ], + } }, + + flow:"flow_test.cfg", + flow_value:{ test_0:{} }, + + wt_bank: { test_0: { + wtb_cfg_fname:"/home/kevin/temp/wt1/bank", + }} + audio_transform: { wnd_func:{}, ola:{}, shift_buf:{}, wt_osc:{}, wt_seq_osc:{}, multi_ch_wt_seq_osc:{} }, + wt_note: { test_0:{} }, + thread_tasks: { test_0:{} }, + numeric_convert: { test_0:{} } + } + } + } + } +} \ No newline at end of file