Tools: Test: Improve Matlab compatibility

The function getpid() is only available in Octave. Instead use
a random integer number as identification to avoid conflict with
possible several simultaneous simulations with temporary files.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This commit is contained in:
Seppo Ingalsuo 2020-04-23 19:52:48 +03:00 committed by Liam Girdwood
parent 3e7edf4e02
commit 509a906426
4 changed files with 12 additions and 11 deletions

View File

@ -61,9 +61,9 @@ end
fprintf('Using parameters Fmax=%.1f kHz, Fs=%.1f, ch=%d, Nch=%d, bits_in=%d\n', ...
test.f_max/1e3, test.fs/1e3, test.ch, test.nch, test.bits_in);
pid = getpid();
test.fn_in = sprintf('fr_test_in_%d.%s', pid, test.fmt);
test.fn_out = sprintf('fr_test_out_%d.%s', pid, test.fmt);
id = floor(rand(1,1) * 1e6);
test.fn_in = sprintf('fr_test_in_%d.%s', id, test.fmt);
test.fn_out = sprintf('fr_test_out_%d.%s', id, test.fmt);
test.f_ref = 997;
test.f_min = 20;

View File

@ -48,9 +48,9 @@ for ch = test.ch
test.fs/1e3, test.bits_in, ch, test.nch);
end
pid = getpid();
test.fn_in = sprintf('g_test_in_%d.%s', pid, test.fmt);
test.fn_out = sprintf('g_test_out_%d.%s', pid, test.fmt);
id = floor(rand(1,1) * 1e6);
test.fn_in = sprintf('g_test_in_%d.%s', id, test.fmt);
test.fn_out = sprintf('g_test_out_%d.%s', id, test.fmt);
test.f = 997;

View File

@ -47,9 +47,9 @@ for ch = test.ch
test.f_start, test.f_end, test.fs/1e3, test.bits_in, ch, test.nch );
end
pid = getpid();
test.fn_in = sprintf('thdnf_test_in_%d.%s', pid, test.fmt);
test.fn_out = sprintf('thdnf_test_out_%d.%s', pid, test.fmt);
id = floor(rand(1,1) * 1e6);
test.fn_in = sprintf('thdnf_test_in_%d.%s', id, test.fmt);
test.fn_out = sprintf('thdnf_test_out_%d.%s', id, test.fmt);
noct = ceil(log(test.f_end/test.f_start)/log(2)); % Max 1 octave steps
test.f = logspace(log10(test.f_start),log10(test.f_end), noct);

View File

@ -69,8 +69,9 @@ fprintf('Using parameters Fs=%.1f, bits_in=%d', test.fs/1e3, test.bits_in);
fprintf(', ch=%d', test.ch );
fprintf(', Nch=%d\n', test.nch );
test.fn_in = sprintf('chirp_test_in.%s', test.fmt);
test.fn_out = sprintf('chirp_test_out.%s', test.fmt);
id = floor(rand(1,1) * 1e6);
test.fn_in = sprintf('chirp_test_in_%d.%s', id, test.fmt);
test.fn_out = sprintf('chirp_test_out_%d.%s', id, test.fmt);
%% Chirp parameters