</ItemGroup>\r
<ItemGroup>\r
<CustomBuild Include="..\..\..\test\stress\data\text.txt">\r
- <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">cd %(RootDir)%(Directory) && perl -X split.pl && copy %(RootDir)%(Directory)\dictionary.txt $(TargetDir)\dictionary.txt</Command>\r
- <Command Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">cd %(RootDir)%(Directory) && perl -X split.pl && copy %(RootDir)%(Directory)\dictionary.txt $(TargetDir)\dictionary.txt</Command>\r
- <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">cd %(RootDir)%(Directory) && perl -X split.pl && copy %(RootDir)%(Directory)\dictionary.txt $(TargetDir)\dictionary.txt</Command>\r
- <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">cd %(RootDir)%(Directory) && perl -X split.pl && copy %(RootDir)%(Directory)\dictionary.txt $(TargetDir)\dictionary.txt</Command>\r
- <Command Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">cd %(RootDir)%(Directory) && perl -X split.pl && copy %(RootDir)%(Directory)\dictionary.txt $(TargetDir)\dictionary.txt</Command>\r
- <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">cd %(RootDir)%(Directory) && perl -X split.pl && copy %(RootDir)%(Directory)\dictionary.txt $(TargetDir)\dictionary.txt</Command>\r
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">cd %(RootDir)%(Directory) && perl -X split.pl text.txt $(TargetDir)\dictionary.txt</Command>\r
+ <Command Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">cd %(RootDir)%(Directory) && perl -X split.pl text.txt $(TargetDir)\dictionary.txt</Command>\r
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">cd %(RootDir)%(Directory) && perl -X split.pl text.txt $(TargetDir)\dictionary.txt</Command>\r
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">cd %(RootDir)%(Directory) && perl -X split.pl text.txt $(TargetDir)\dictionary.txt</Command>\r
+ <Command Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">cd %(RootDir)%(Directory) && perl -X split.pl text.txt $(TargetDir)\dictionary.txt</Command>\r
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">cd %(RootDir)%(Directory) && perl -X split.pl text.txt $(TargetDir)\dictionary.txt</Command>\r
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Build text dictionary</Message>\r
<Message Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">Build text dictionary</Message>\r
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Build text dictionary</Message>\r
framework/stress_test.cpp
)
+add_custom_command(
+ OUTPUT ${EXECUTABLE_OUTPUT_PATH}/dictionary.txt
+ MAIN_DEPENDENCY ${PROJECT_SOURCE_DIR}/test/stress/data/text.txt
+ COMMAND perl -X ${PROJECT_SOURCE_DIR}/test/stress/data/split.pl ${PROJECT_SOURCE_DIR}/test/stress/data/text.txt ${EXECUTABLE_OUTPUT_PATH}/dictionary.txt
+)
+set_property(SOURCE framework/stress_test.cpp APPEND PROPERTY OBJECT_DEPENDS ${EXECUTABLE_OUTPUT_PATH}/dictionary.txt)
+
add_library(${CDSSTRESS_FRAMEWORK_LIBRARY} OBJECT ${CDSSTRESS_FRAMEWORK_SOURCES})
include_directories(
\r
my %words ;\r
\r
-open( my $f, "text.txt" ) ;\r
+my $input_file = shift;\r
+my $output_file = shift;\r
+\r
+open( my $f, $input_file ) or die "Cannot open input file $input_file";\r
binmode $f ;\r
\r
my $text = '' ;\r
}\r
}\r
\r
-open (my $dst, ">dictionary.txt") ;\r
+open (my $dst, ">$output_file") or die "Cannot open output file $output_file";\r
binmode $dst ;\r
\r
my $nCount = 0 ;\r
$nCount++ foreach (keys %words) ;\r
print $dst $nCount, "\n" ;\r
\r
-print "Generate test dictionary...\n" ;\r
+print "Generate test dictionary $output_file ...\n" ;\r
print $dst $_, "\n" foreach (keys %words) ;\r
\r
close $dst ;\r