File: multithreaded.frm

package info (click to toggle)
form 5.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 8,312 kB
  • sloc: ansic: 110,546; cpp: 20,395; sh: 5,874; makefile: 545
file content (63 lines) | stat: -rw-r--r-- 1,200 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#:FilePatches 16
#:LargePatches 2
#:TermsInSmall 4

#ifndef `TEST'
  #message Use -D TEST=XXX
  #terminate
#else
  #include `NAME_' # `TEST'
#endif
.end

*--#[ multithreaded_1 :
#:FilePatches 16
#:LargePatches 2
#:TermsInSmall 4

* NOTE: tform -w4 -F -D TEST=multithreaded_1 multithreaded.frm
* should write the whole output to the log file (if not broken).
* Nothing should be printed in the standard output.
* This test checks the correct behaviour of threadstats discussed in:
* https://github.com/vermaseren/form/issues/470

#ifndef `N1'
  #define N1 "1"
#endif

#ifndef `N2'
  #define N2 "2"
#endif

#ifndef `N3'
  #define N3 "2"
#endif

#ifdef `TEST'

S x1,...,x9;
L F = (x1+...+x9)^`N1';
.sort
multiply (x1+...+x9)^`N2';
.sort
multiply (x1+...+x9)^`N3';
.sort
repeat id x1? = 1;
P +f;

#endif

.end
L F = 1;
P;
.sort
#system `FORM' -F -D TEST 1.frm
.end
assert succeeded?
# If the -F option in the above execution of (T)FORM works correctly,
# then F = 59049 is not printed in the standard output. So, the last
# printed expression of F must be 1.
assert result("F") =~ expr("1")
# The result should be written in the log file.
assert file("1.log") =~ pattern("59049")
*--#] multithreaded_1 :