mucgly 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Mucgly
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  def Mucgly.version
4
4
  Mucgly::VERSION
5
5
  end
data/test/doit ADDED
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+ cd ..
3
+ c-compile
4
+ cd test
5
+ gdb
@@ -0,0 +1,4 @@
1
+ The blocked lines will not be visible in the output.
2
+ This is the last line visible before block.
3
+ This is the first line after block.
4
+ Last line...
@@ -0,0 +1,4 @@
1
+ typedef struct hookpair_s {
2
+ gchar* beg; /**< Hookbeg for input file. */
3
+ gchar* end; /**< Hookend for input file. */
4
+ } hookpair_t;
@@ -0,0 +1,4 @@
1
+ typedef struct hookpair_s {
2
+ gchar* beg; /**< Hookbeg for input file. */
3
+ gchar* end; /**< Hookend for input file. */
4
+ } hookpair_t;
@@ -0,0 +1,4 @@
1
+ The blocked lines will not be visible in the output.
2
+ This is the last line visible before block.
3
+ This is the first line after block.
4
+ Last line...
@@ -0,0 +1,4 @@
1
+ typedef struct hookpair_s {
2
+ gchar* beg; /**< Hookbeg for input file. */
3
+ gchar* end; /**< Hookend for input file. */
4
+ } hookpair_t;
@@ -0,0 +1,4 @@
1
+ typedef struct hookpair_s {
2
+ gchar* beg; /**< Hookbeg for input file. */
3
+ gchar* end; /**< Hookend for input file. */
4
+ } hookpair_t;
@@ -0,0 +1,11 @@
1
+ The blocked lines will not be visible in the output.
2
+ This is the last line visible before block.
3
+ -<:block>-\
4
+ Blocked line1.
5
+ Blocked line2.
6
+ Blocked line3.
7
+ Blocked line4.
8
+ Blocked line5.
9
+ -<:unblock>-\
10
+ This is the first line after block.
11
+ Last line...
data/test/test_mucgly.rb CHANGED
@@ -3,13 +3,14 @@ require 'test/unit'
3
3
 
4
4
 
5
5
  # Test execution routine.
6
- def runTest( cmdopts, test, sep = "" )
7
- rf = "result/#{test}#{sep}.txt"
8
- gf = "golden/#{test}#{sep}.txt"
6
+ def runTest( cmdopts, test, sep = ".rx.txt" )
7
+ rf = "result/#{test}.txt"
8
+ gf = "golden/#{test}.txt"
9
9
 
10
- system( "export RUBYLIB=../lib; ../bin/mucgly -i -m #{cmdopts} -f #{test}.rx.txt -o #{rf}" )
10
+ system( "export RUBYLIB=../lib; ../bin/mucgly -i -m #{cmdopts} -f #{test}#{sep} -o #{rf}" )
11
11
 
12
12
  if false
13
+ # if true
13
14
  # Populate golden files after inspection.
14
15
  system( "cp #{rf} #{gf}" )
15
16
  end
@@ -44,4 +45,10 @@ class MucglyTest < Test::Unit::TestCase
44
45
  assert( system( "diff #{rf2} #{gf2}" ), "FAILED: diff #{rf2} #{gf2}" )
45
46
  end
46
47
 
48
+ def test_block() runTest( "", "test_block" ); end
49
+
50
+ def test_multihook() runTest( "", "test_multihook", ".rx.c" ); end
51
+
52
+ def test_multihook_cli() runTest( "-u '/*..' -u '..*/' -u '_L/*' -u '_J*/'", "test_multihook_cli", ".rx.c" ); end
53
+
47
54
  end
@@ -0,0 +1,17 @@
1
+ -<+Mucgly.multihook( [ "/*..", "..*/", "_L/*", "_J*/" ] )>-
2
+ /*..+@name="hookpair"..*/
3
+ /*..+/Use the non-valid hookend within next macro for testing
4
+ that is does not cause panic..*/
5
+ typedef struct _L/*Mucgly.write(@name); %Q{..*/} _J*/_s {
6
+ gchar* beg; /**< Hookbeg for input file. */
7
+ gchar* end; /**< Hookend for input file. */
8
+ } hookpair_t;
9
+ /*..+:block..*/
10
+
11
+ //_J*/
12
+
13
+ typedef struct filestack_s {
14
+ GList* file; /**< Stack of files. */
15
+ } filestack_t;
16
+ /*..+:unblock..*/
17
+ /*..+:block..*/
@@ -0,0 +1,16 @@
1
+ /*..+@name="hookpair"..*/
2
+ /*..+/Use the non-valid hookend within next macro for testing
3
+ that is does not cause panic..*/
4
+ typedef struct _L/*Mucgly.write(@name); %Q{..*/} _J*/_s {
5
+ gchar* beg; /**< Hookbeg for input file. */
6
+ gchar* end; /**< Hookend for input file. */
7
+ } hookpair_t;
8
+ /*..+:block..*/
9
+
10
+ //_J*/
11
+
12
+ typedef struct filestack_s {
13
+ GList* file; /**< Stack of files. */
14
+ } filestack_t;
15
+ /*..+:unblock..*/
16
+ /*..+:block..*/
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mucgly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tero Isannainen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-05 00:00:00.000000000 Z
11
+ date: 2016-04-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |-
14
14
  Mucgly is a macro expander for inline macros that exist in the middle
@@ -46,22 +46,32 @@ files:
46
46
  - ext/mucgly/extconf.rb
47
47
  - ext/mucgly/mucgly.c
48
48
  - lib/version.rb
49
+ - test/doit
49
50
  - test/golden/test_basic.txt
51
+ - test/golden/test_block.txt
50
52
  - test/golden/test_file_ctrl.txt
53
+ - test/golden/test_multihook.txt
54
+ - test/golden/test_multihook_cli.txt
51
55
  - test/golden/test_redirect.txt
52
56
  - test/golden/test_specials_cli.txt
53
57
  - test/golden/test_specials_cmd.txt
54
58
  - test/result/test_basic.txt
59
+ - test/result/test_block.txt
55
60
  - test/result/test_file_ctrl.txt
61
+ - test/result/test_multihook.txt
62
+ - test/result/test_multihook_cli.txt
56
63
  - test/result/test_redirect.txt
57
64
  - test/result/test_specials_cli.txt
58
65
  - test/result/test_specials_cmd.txt
59
66
  - test/result/test_specials_cmd2.txt
60
67
  - test/test_basic.rx.txt
68
+ - test/test_block.rx.txt
61
69
  - test/test_file_ctrl.rx.txt
62
70
  - test/test_include.rb
63
71
  - test/test_include.txt
64
72
  - test/test_mucgly.rb
73
+ - test/test_multihook.rx.c
74
+ - test/test_multihook_cli.rx.c
65
75
  - test/test_skip.txt
66
76
  - test/test_specials_cli.rx.txt
67
77
  - test/test_specials_cmd.rx.txt
@@ -91,11 +101,18 @@ specification_version: 4
91
101
  summary: Mucgly processes inline macros.
92
102
  test_files:
93
103
  - test/test_skip.txt
104
+ - test/golden/test_block.txt
94
105
  - test/golden/test_basic.txt
95
106
  - test/golden/test_specials_cli.txt
107
+ - test/golden/test_multihook_cli.txt
96
108
  - test/golden/test_file_ctrl.txt
109
+ - test/golden/test_multihook.txt
97
110
  - test/golden/test_redirect.txt
98
111
  - test/golden/test_specials_cmd.txt
112
+ - test/test_multihook_cli.rx.c
113
+ - test/doit
114
+ - test/test_multihook.rx.c
115
+ - test/test_block.rx.txt
99
116
  - test/test_specials_cmd.rx.txt
100
117
  - test/test_include.rb
101
118
  - test/test_include.txt
@@ -103,9 +120,12 @@ test_files:
103
120
  - test/test_specials_cli.rx.txt
104
121
  - test/test_mucgly.rb
105
122
  - test/test_file_ctrl.rx.txt
123
+ - test/result/test_block.txt
106
124
  - test/result/test_basic.txt
107
125
  - test/result/test_specials_cli.txt
126
+ - test/result/test_multihook_cli.txt
108
127
  - test/result/test_file_ctrl.txt
128
+ - test/result/test_multihook.txt
109
129
  - test/result/test_specials_cmd2.txt
110
130
  - test/result/test_redirect.txt
111
131
  - test/result/test_specials_cmd.txt